Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Five Ways to Scale your
API Without Touching Your
Code
Steven Willmott
3scale Inc.
@njyx, @3scale
3scale is…
API
Infrastructure
Provider
!
Power 350+
APIs
!
110,000
Developers
writing Apps
!
API Tech Operations
API Busin...
+ As of today
Also have a
new service for
Developers
!
Track
Transform
Analyze
API Traffic
!
http://www.apitools.com
Onward to Scaling…
What does Scaling Mean?
A: Handling more
Transactions per second?
A: Handling more
Transactions per second?
A: Making more Customers
Happy per Second
(whilst using the same resources)
• Decoupling Layers
• Caching
• Compression
• Database Changes
• Streaming / Real-time
• Smaller Payloads
• SSL Optimizati...
Suppose you have…
• Fixed Hardware
Resources
• (Mostly) Static
Application
Code Base
Five Scaling Tips That Don’t
Scale Transactions
1. API Design
• Do methods / calls fit use cases?
• Are you passing a lot of internal IDs
around?
• Are some methods more e...
Expected Use of Your API
Expected
Unexpected
DesiredUndesired
Yay!
Innovation
Not so
Good
Oh-Oh..
Concept: Thor Mitchel / ...
2. API Call Aggregation
• Creating Aggregate Methods which
compose base functionalities
• Cut Access to Individual Methods...
3. Rate Limiting
• Rate Limits and Clear communication
change Developer behavior
• Rate limits generally mean more
sensibl...
4. Off Boarding Calls
• Calls that are never made you don’t
have to handle!
• Client Side Caching
• Allow it in your Terms...
3scale XtremeCapacity
3scale XC Nodes offboard Lookup & Processing to Local Resources
5. SDK Provision
• It can be tough for third developers
to write good code
• Writing SDKs can make it easier
• Encodes bes...
Five Techniques
1. API Design
2. API Call Aggregation
3. Rate Limiting
4. Off Boarding Calls
5. SDK Provision
Almost Certa...
Conclusions
Make sure you are asking the right
question!
Your API structure and policies
massively affect how it scales
Ou...
3scale: http://www.3scale.net
APItools: http://www.apitools.com
APICodex: http://apicodex.3scale.net
Thank You!
Contact:
http://www.3scale.net
@njyx - steve@3scale.net
Upcoming SlideShare
Loading in …5
×

Five Ways to Scale your API Without Touching Your Code

5,756 views

Published on

Scalability Talk from the http://www.apistrategyconference.com/ Scalability Session - Five Ways to Scale your API Without Touching Your Code. Steven Willmott, 3scale.

Published in: Technology

Five Ways to Scale your API Without Touching Your Code

  1. 1. Five Ways to Scale your API Without Touching Your Code Steven Willmott 3scale Inc. @njyx, @3scale
  2. 2. 3scale is… API Infrastructure Provider ! Power 350+ APIs ! 110,000 Developers writing Apps ! API Tech Operations API Business Operations Developer Support (Selection) 3scale.net
  3. 3. + As of today Also have a new service for Developers ! Track Transform Analyze API Traffic ! http://www.apitools.com
  4. 4. Onward to Scaling…
  5. 5. What does Scaling Mean?
  6. 6. A: Handling more Transactions per second?
  7. 7. A: Handling more Transactions per second?
  8. 8. A: Making more Customers Happy per Second (whilst using the same resources)
  9. 9. • Decoupling Layers • Caching • Compression • Database Changes • Streaming / Real-time • Smaller Payloads • SSL Optimization ! ! Getting the Question Right • Do all of the transaction scaling plus more • Change API Structure • Change Client Design Params • Think about Client needs to rethink transaction loads • Share scaling burden with developers ! Scaling Transaction Scaling Customers Very Important Often Forgotten
  10. 10. Suppose you have… • Fixed Hardware Resources • (Mostly) Static Application Code Base
  11. 11. Five Scaling Tips That Don’t Scale Transactions
  12. 12. 1. API Design • Do methods / calls fit use cases? • Are you passing a lot of internal IDs around? • Are some methods more expensive to execute than others? • Does the API Design mean heavy load calls are being made even if that data is not needed? • Are clients making many calls when they should be making one? Method / Structure Design Add Specific Methods Remove Methods Unbundle & Rebundle
  13. 13. Expected Use of Your API Expected Unexpected DesiredUndesired Yay! Innovation Not so Good Oh-Oh.. Concept: Thor Mitchel / Google
  14. 14. 2. API Call Aggregation • Creating Aggregate Methods which compose base functionalities • Cut Access to Individual Methods • Taylor to Clients or Use Cases • Adjust the set of compound methods over time • Works best when you own all the clients Post-Hoc API Design e.g Great talk by Daniel Jacobsen APIStrat New York: ! http://bit.ly/1gAN6mp
  15. 15. 3. Rate Limiting • Rate Limits and Clear communication change Developer behavior • Rate limits generally mean more sensible code is being written and your servers are taxed less • Rate Limits stop fringe high volume users from negatively impacting everybody else • Make sure the limits are published - Developers hate undocumented limits Restrict Outlier Usage e.g Own build… Make sure key use cases are still feasible, and that rate limits are published.
  16. 16. 4. Off Boarding Calls • Calls that are never made you don’t have to handle! • Client Side Caching • Allow it in your Terms of Service • Build it into your SDKs, suggest it in your code samples • Calculate your rate limits by assuming caching • Use Caching headers • Consider caching both reads and writes Make the Client Work! e.g Again you need to ensure the core API Use cases are still supported if you go this route
  17. 17. 3scale XtremeCapacity 3scale XC Nodes offboard Lookup & Processing to Local Resources
  18. 18. 5. SDK Provision • It can be tough for third developers to write good code • Writing SDKs can make it easier • Encodes best practice in terms of API Calls • Makes Call Patterns more predictable • You can encode counterpart behavior to your rate limits • Local check for errors in calls (so your backend never receives them). Optimize your Clients e.g SDKs can create maintenance issues - but critical for large developer bases
  19. 19. Five Techniques 1. API Design 2. API Call Aggregation 3. Rate Limiting 4. Off Boarding Calls 5. SDK Provision Almost Certainly you have some wins here….
  20. 20. Conclusions Make sure you are asking the right question! Your API structure and policies massively affect how it scales Out of the Box thinking can save a lot of dollars (and the planet)
  21. 21. 3scale: http://www.3scale.net APItools: http://www.apitools.com APICodex: http://apicodex.3scale.net
  22. 22. Thank You! Contact: http://www.3scale.net @njyx - steve@3scale.net

×