2. 1. API Metering
Also called API rate limiting, metering is the process of managing access to APIs,
and only allowing a given number of API calls per specified time period.
3. API METERING
X-API-Key:
12345
node.js
• Extract API key from HTTP header
• Lookup (service or database) current usage and
quota
• Determine whether call allowed or reject with
appropriate message
MORE EFFICIENT
IMPROVES
PERFORMANCE
LESS DISRUPTION
WHEN CHANGED
LineRate.com 3
4. 2. Y-axis scaling
Y-axis scaling is a sharding-based routing pattern that uses some variable within
each request - either in the URI or in the HTTP headers - to determine which
service or application instance a request should be forwarded to.
5. Y-AXIS SCALING
Service A
Service B
Service C
/login/
/checkout/
/search/
node.js
• Evaluate URI
• Steer to the appropriate service based on
function
• Can be extended to pull service name from
database for real-time updates
MORE EFFICIENT
IMPROVES
PERFORMANCE
BETTER
ABSTRACTION
LineRate.com 5
6. 3. Data scrubbing
Data scrubbing is a security technique that ensures sensitive or confidential data
is not returned to the user.
7. DATA SCRUBBING
Service A
Service B
Service C
{username: “Joe Bob”,
account: “123-45-678”}
{username: “Joe Bob”,
account: “xxx-xx-678”}
node.js
• Intercept response
• If specified pattern / data is discovered, remove
or scrub to obfuscate
• Return clean data to user
COMPLIANCE
SECURITY
LESS DISRUPTION
WHEN CHANGED
LineRate.com 7
8. 4. Exception Handling
Exception handling allows the app proxy to “retry” requests to app instances that
fail. This is particularly useful in cases where 5xx and 4xxx error messages are
returned and indicate a problem with the web server or app instance.
9. EXCEPTION HANDLING
GET /original-request/
(RETRY) GET /original-request/
node.js
• Intercept response
• If HTTP response matches specified status codes
retry the request and mark the original as
unavailable
• May perform additional logging or actions as
indicated by the script
IMPROVE
UPTIME
FASTER
NOTIFICATION
BETTER USER
EXPERIENCE
LineRate.com 9
10. 5. Content Sharding
Similar to Y-axis scaling, content sharding allows for finer grained distribution of
requests based on content type such as images, documents, static text or
database-backed content.
11. CONTENT SHARDING
Images
Static text
Scripts
node.js
• Evaluate URI and/or Content-Type HTTP header
• Steer to the appropriate service based on content
type
• Can be extended to pull service name from
database for real-time updates
IMPROVE
SCALABILITY
IMPROVED
PERFORMANCE
BETTER USER
EXPERIENCE
LineRate.com 11
13. 13
With a programmable proxy like LineRate
Data Path
Data path
programmability enables
custom application data
and traffic handling logic
Node.js
LINE RATE
NODE.JS
• Deployed in the data path between
an end user and the application
• Fluent in SSL and HTTP
• Can execute custom logic using
node.js (including modules from
NPM)