SlideShare a Scribd company logo
1 of 35
Scaling APIs
Feeding your Speeds


April 5, 2012




Greg Brail       @gbrail
Brian Pagano     @brianpagano
@gbrail   @brianpagano
groups.google.com/group/api-craft
youtube.com/apigee
New!

       IRC Channel
         #api-craft
        on freenode
What is scale to an API?


Developers: Lots of developers building apps
Apps: Lots of apps for end users to use
End users: Millions and millions of app users
Versions: Lots of API versions to manage
API calls: All of these things result in API calls…
Today’s Topic: API Calls

Today we are going to focus on handling huge numbers
of API calls in an API infrastructure

        Ever been in a meeting where someone said,
“let’s not talk about ‘speeds and feeds’ today?”

                               This is not that meeting.
Why do APIs need to scale?

Thousands of app developers…
                                      Each one must be managed, signed up, etc.
Thousands of apps…
                               Each one has credentials that need to be validated
Millions of end users…
                                  Each one has one or more OAuth access tokens


Result in lots of API calls. For example:
                                                         One million end users,
                                                     Making 1000 API calls a day,
                               Results in one billion API calls a day,
                   Or about 11,000 API calls per second on average
Tracking API calls

Today we’ll mainly talk about throughput

Measured in API calls or transactions per second (tps)
  For an API, usually as the number of users increases,
  throughput increases


As throughput increases, latency often increases too
  It’s not enough just to handle lots of throughput – it’s
  important to handle it with a reasonable amount of latency
What Limits Scale?


Disk                 Database

Network              App server

CPU                  API Proxy

Memory               Load balancer

                     Cache servers
What are some limits?


Seek time               Database design & tuning
Rotational speed        App server coding & config
Transfer speed          Proxy configuration
Clock speed             Load balancer policies
Number of cores         Cache configuration
Amount of RAM           And many more…
Some examples

We’re going to talk about things to look at as
throughput grows from one level of traffic to another…
                         1 tps
                         10 tps
                        100 tps
                       1000 tps
                     10,000 tps
                   100,000 tps
                  and beyond…..
Image from valdosta.edu
At 1 transaction per second

86,400 per day / 2.5 million per month

Almost everything can handle this.

What about the database?
   If each API call makes several big SQL queries, it may not!
Strategies for 1 tps


Test (always)
Tune the database installation
Tune the database design
Monitor query performance
Test again!
image from istockphoto.com
At 10 transactions per second

864,000 per day / 25 million per month

Most infrastructure can still handle this.

What about the application server?
   Is the app well-designed enough?
   Does it make an excessive number of database calls?
Strategies for 10 tps


Ensure that the app server is properly optimized
  Do API calls make the minimum number of database calls?
  Do API calls depend on large numbers of external services?
image from istockphoto.com
At 100 transactions per second

8.6 million per day / 259 million per month

(Now we are starting to get somewhere)

RDBMS systems may struggle
Less-efficient app servers may struggle
“Free” tiers on hosting platforms aren’t an option
Strategies for 100 tps

Database optimization and tuning is critical here
  Allocate fast storage, and lots of it
  Allocate lots of memory
  Tune the database to use it!
  Find bad queries and fix them or optimize them


App server tuning is critical here
  Are there enough threads in the thread pool?
  Are there enough processes?
Image from http://www.jigzone.com
At 1000 transactions per second

86 million per day / 2.5 billion per month

Now everything may start to break…

What is the mix between reads and writes?
Strategies for 1000 tps

Understand the mix between reads and writes
  Cache the reads as much as you can
  If you can cache them closer to the client, better


Understand your app server performance
  Faster app servers should still be able to handle (like Java)
  RoR, Python, PHP, etc will require much bigger clusters
  Stateless app servers are your friend!
More strategies for 1000 tps

Can the database handle the load?
  It can if most transactions are reads
  And you cache as much as you can


Otherwise it’s time to scale the database layer
  Sharded RDBMSes
  Or a scalable NoSQL database works here
At 10,000 transactions per second

864 million per day / 25 billion per month

If most transactions are reads, caching is your friend

Otherwise, this is serious business
  No single database can handle this
  Few single app servers can handle this
  If API calls are large, what will the bandwidth be?
Strategies for 10,000 tps

Caching is even more essential
  Even a simple cache can handle this load on one or two boxes


Database writes are problematic
  No single database server can write 10,000 times per second
  Scalable, eventually-consistent databases can scale this big,
  (like Cassandra)
More for 10,000

App servers
  You’ll need a cluster of app servers no matter what!
  What about session management?
  What about load balancing?
100,000 API calls per second

8.6 billion per day!

Now your API is truly impressive
  (either that or it is very poorly designed!)


You will need racks of infrastructure no matter what!
Some other considerations


API design

Client design

Latency

Bandwidth
What about API design?

Every API call has overhead:
      TCP connection / SSL handshake / load balancer CPU / API
        proxy CPU / App server CPU and thread pool / database
                                        connections / disk I/O…


Do you need to make so many?
 Can you design your APIs to support fewer high-value API calls?
                         Can you have “batch” calls in your API?
What about the client?

Can client apps use the API more efficiently?
  Don’t make the same API calls over and over
  Utilize compression
  Utilize conditional requests in HTTP
     Which means that the API server should support them!
  Request only the data that’s needed
     Which means that the API server should trim responses
     Or paginate them
What about latency?

Latency kills user experience!


How can the API server reduce it?
  Remove steps in the processing flow through caching
  Cache closer to the API clients
What about the network?

What kind of network connection to you have?
  For instance, in EC2 you get 1Gbps,
  Or about 122 megabytes / second
  At 10,000 tps, for instance, that’s 12K per API call
THANK YOU
Questions and ideas to:

@gbrail
@brianpagano

More Related Content

What's hot

Memcached Presentation
Memcached PresentationMemcached Presentation
Memcached PresentationAsif Ali
 
클라우드 MSP에 강력한 '보안'을 더하다 - 최광호 클라우드사업본부장, 안랩 :: AWS Summit Seoul 2021
클라우드 MSP에 강력한 '보안'을 더하다 - 최광호 클라우드사업본부장, 안랩 :: AWS Summit Seoul 2021클라우드 MSP에 강력한 '보안'을 더하다 - 최광호 클라우드사업본부장, 안랩 :: AWS Summit Seoul 2021
클라우드 MSP에 강력한 '보안'을 더하다 - 최광호 클라우드사업본부장, 안랩 :: AWS Summit Seoul 2021Amazon Web Services Korea
 
Implementing jsp tag extensions
Implementing jsp tag extensionsImplementing jsp tag extensions
Implementing jsp tag extensionsSoujanya V
 
Apache Hadoop Security - Ranger
Apache Hadoop Security - RangerApache Hadoop Security - Ranger
Apache Hadoop Security - RangerIsheeta Sanghi
 
06 august meetup - enterprise integration architecture
06   august meetup - enterprise integration architecture06   august meetup - enterprise integration architecture
06 august meetup - enterprise integration architectureAldo Fernandez
 
[AWS Techshift] 파트너 사업을 준비하기 위해 기억해야 할 5가지 - 양승호, AWS 파트너 사업 개발 담당 이사
[AWS Techshift] 파트너 사업을 준비하기 위해 기억해야 할 5가지 - 양승호, AWS 파트너 사업 개발 담당 이사[AWS Techshift] 파트너 사업을 준비하기 위해 기억해야 할 5가지 - 양승호, AWS 파트너 사업 개발 담당 이사
[AWS Techshift] 파트너 사업을 준비하기 위해 기억해야 할 5가지 - 양승호, AWS 파트너 사업 개발 담당 이사Amazon Web Services Korea
 
위험기반테스트접근 테스트계획 사례
위험기반테스트접근 테스트계획 사례위험기반테스트접근 테스트계획 사례
위험기반테스트접근 테스트계획 사례SangIn Choung
 
[2017 Windows on AWS] AWS 를 활용한 SQL Server 최적 활용 방안
[2017 Windows on AWS] AWS 를 활용한 SQL Server 최적 활용 방안[2017 Windows on AWS] AWS 를 활용한 SQL Server 최적 활용 방안
[2017 Windows on AWS] AWS 를 활용한 SQL Server 최적 활용 방안Amazon Web Services Korea
 
Idexcel Independent Testing Services Presentation
Idexcel Independent Testing Services PresentationIdexcel Independent Testing Services Presentation
Idexcel Independent Testing Services PresentationIdexcel
 
서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018Amazon Web Services Korea
 
AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...
AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...
AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...Amazon Web Services Korea
 
엔터프라이즈를 위한 AWS 지원 및 사례 (서수영) - AWS 웨비나 시리즈
엔터프라이즈를 위한 AWS 지원 및 사례 (서수영) - AWS 웨비나 시리즈엔터프라이즈를 위한 AWS 지원 및 사례 (서수영) - AWS 웨비나 시리즈
엔터프라이즈를 위한 AWS 지원 및 사례 (서수영) - AWS 웨비나 시리즈Amazon Web Services Korea
 
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesGetting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesAmazon Web Services
 
Introduction to Threat Detection and Remediation on AWS
Introduction to Threat Detection and Remediation on AWSIntroduction to Threat Detection and Remediation on AWS
Introduction to Threat Detection and Remediation on AWSAmazon Web Services
 

What's hot (20)

Memcached Presentation
Memcached PresentationMemcached Presentation
Memcached Presentation
 
클라우드 MSP에 강력한 '보안'을 더하다 - 최광호 클라우드사업본부장, 안랩 :: AWS Summit Seoul 2021
클라우드 MSP에 강력한 '보안'을 더하다 - 최광호 클라우드사업본부장, 안랩 :: AWS Summit Seoul 2021클라우드 MSP에 강력한 '보안'을 더하다 - 최광호 클라우드사업본부장, 안랩 :: AWS Summit Seoul 2021
클라우드 MSP에 강력한 '보안'을 더하다 - 최광호 클라우드사업본부장, 안랩 :: AWS Summit Seoul 2021
 
Overview of Amazon Web Services
Overview of Amazon Web ServicesOverview of Amazon Web Services
Overview of Amazon Web Services
 
Implementing jsp tag extensions
Implementing jsp tag extensionsImplementing jsp tag extensions
Implementing jsp tag extensions
 
Apache Hadoop Security - Ranger
Apache Hadoop Security - RangerApache Hadoop Security - Ranger
Apache Hadoop Security - Ranger
 
AWS Security Checklist
AWS Security ChecklistAWS Security Checklist
AWS Security Checklist
 
Introducing DynamoDB
Introducing DynamoDBIntroducing DynamoDB
Introducing DynamoDB
 
AWS EC2 and ELB troubleshooting
AWS EC2 and ELB troubleshootingAWS EC2 and ELB troubleshooting
AWS EC2 and ELB troubleshooting
 
06 august meetup - enterprise integration architecture
06   august meetup - enterprise integration architecture06   august meetup - enterprise integration architecture
06 august meetup - enterprise integration architecture
 
[AWS Techshift] 파트너 사업을 준비하기 위해 기억해야 할 5가지 - 양승호, AWS 파트너 사업 개발 담당 이사
[AWS Techshift] 파트너 사업을 준비하기 위해 기억해야 할 5가지 - 양승호, AWS 파트너 사업 개발 담당 이사[AWS Techshift] 파트너 사업을 준비하기 위해 기억해야 할 5가지 - 양승호, AWS 파트너 사업 개발 담당 이사
[AWS Techshift] 파트너 사업을 준비하기 위해 기억해야 할 5가지 - 양승호, AWS 파트너 사업 개발 담당 이사
 
위험기반테스트접근 테스트계획 사례
위험기반테스트접근 테스트계획 사례위험기반테스트접근 테스트계획 사례
위험기반테스트접근 테스트계획 사례
 
[2017 Windows on AWS] AWS 를 활용한 SQL Server 최적 활용 방안
[2017 Windows on AWS] AWS 를 활용한 SQL Server 최적 활용 방안[2017 Windows on AWS] AWS 를 활용한 SQL Server 최적 활용 방안
[2017 Windows on AWS] AWS 를 활용한 SQL Server 최적 활용 방안
 
Idexcel Independent Testing Services Presentation
Idexcel Independent Testing Services PresentationIdexcel Independent Testing Services Presentation
Idexcel Independent Testing Services Presentation
 
Test automation process
Test automation processTest automation process
Test automation process
 
Apache Ranger
Apache RangerApache Ranger
Apache Ranger
 
서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
서버리스 앱 배포 자동화 (김필중, AWS 솔루션즈 아키텍트) :: AWS DevDay2018
 
AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...
AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...
AWS Fargate와 Amazon ECS를 활용한 CI/CD 모범사례 - 유재석, AWS 솔루션즈 아키텍트 :: AWS Game Mast...
 
엔터프라이즈를 위한 AWS 지원 및 사례 (서수영) - AWS 웨비나 시리즈
엔터프라이즈를 위한 AWS 지원 및 사례 (서수영) - AWS 웨비나 시리즈엔터프라이즈를 위한 AWS 지원 및 사례 (서수영) - AWS 웨비나 시리즈
엔터프라이즈를 위한 AWS 지원 및 사례 (서수영) - AWS 웨비나 시리즈
 
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar SeriesGetting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
Getting Started With Continuous Delivery on AWS - AWS April 2016 Webinar Series
 
Introduction to Threat Detection and Remediation on AWS
Introduction to Threat Detection and Remediation on AWSIntroduction to Threat Detection and Remediation on AWS
Introduction to Threat Detection and Remediation on AWS
 

Similar to Scaling APIs: Predict, Prepare for, Overcome the Challenges

Starting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsStarting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsDynatrace
 
OSMC 2018 | What We Should All Worry About When Monitoring Serverless Applica...
OSMC 2018 | What We Should All Worry About When Monitoring Serverless Applica...OSMC 2018 | What We Should All Worry About When Monitoring Serverless Applica...
OSMC 2018 | What We Should All Worry About When Monitoring Serverless Applica...NETWAYS
 
Azure api management
Azure api managementAzure api management
Azure api managementJoTechies
 
Building a Great Web API - Evan Cooke - QCON 2011
Building a Great Web API - Evan Cooke - QCON 2011Building a Great Web API - Evan Cooke - QCON 2011
Building a Great Web API - Evan Cooke - QCON 2011Twilio Inc
 
Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011Eli White
 
Handling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsHandling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsDirecti Group
 
apidays Australia 2023 - The Playful Bond Between REST And Data Streams, Warr...
apidays Australia 2023 - The Playful Bond Between REST And Data Streams, Warr...apidays Australia 2023 - The Playful Bond Between REST And Data Streams, Warr...
apidays Australia 2023 - The Playful Bond Between REST And Data Streams, Warr...apidays
 
The Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data StreamsThe Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data Streamsconfluent
 
Building collaborative HTML5 apps using a backend-as-a-service (HTML5DevConf ...
Building collaborative HTML5 apps using a backend-as-a-service (HTML5DevConf ...Building collaborative HTML5 apps using a backend-as-a-service (HTML5DevConf ...
Building collaborative HTML5 apps using a backend-as-a-service (HTML5DevConf ...João Parreira
 
Become a Performance Diagnostics Hero
Become a Performance Diagnostics HeroBecome a Performance Diagnostics Hero
Become a Performance Diagnostics HeroTechWell
 
Netflix Edge Engineering Open House Presentations - June 9, 2016
Netflix Edge Engineering Open House Presentations - June 9, 2016Netflix Edge Engineering Open House Presentations - June 9, 2016
Netflix Edge Engineering Open House Presentations - June 9, 2016Daniel Jacobson
 
Building A Great API - Evan Cooke, Cloudstock, December 2010
Building A Great API - Evan Cooke, Cloudstock, December 2010Building A Great API - Evan Cooke, Cloudstock, December 2010
Building A Great API - Evan Cooke, Cloudstock, December 2010Twilio Inc
 
Leveraging Microservice Architectures & Event-Driven Systems for Global APIs
Leveraging Microservice Architectures & Event-Driven Systems for Global APIsLeveraging Microservice Architectures & Event-Driven Systems for Global APIs
Leveraging Microservice Architectures & Event-Driven Systems for Global APIsconfluent
 
Big and fast a quest for relevant and real-time analytics
Big and fast a quest for relevant and real-time analyticsBig and fast a quest for relevant and real-time analytics
Big and fast a quest for relevant and real-time analyticsNatalino Busa
 
Big Data Use Cases and Solutions in the AWS Cloud
Big Data Use Cases and Solutions in the AWS CloudBig Data Use Cases and Solutions in the AWS Cloud
Big Data Use Cases and Solutions in the AWS CloudAmazon Web Services
 
ConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web appsConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web appsPierre-Luc Maheu
 
Tidal scale short_story_v2
Tidal scale short_story_v2Tidal scale short_story_v2
Tidal scale short_story_v2Chuck Piercey
 
Leveraging The Cloud In 2009
Leveraging The Cloud In 2009Leveraging The Cloud In 2009
Leveraging The Cloud In 2009Ed Laczynski
 

Similar to Scaling APIs: Predict, Prepare for, Overcome the Challenges (20)

Starting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for OpsStarting Your DevOps Journey – Practical Tips for Ops
Starting Your DevOps Journey – Practical Tips for Ops
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
OSMC 2018 | What We Should All Worry About When Monitoring Serverless Applica...
OSMC 2018 | What We Should All Worry About When Monitoring Serverless Applica...OSMC 2018 | What We Should All Worry About When Monitoring Serverless Applica...
OSMC 2018 | What We Should All Worry About When Monitoring Serverless Applica...
 
Azure api management
Azure api managementAzure api management
Azure api management
 
Building a Great Web API - Evan Cooke - QCON 2011
Building a Great Web API - Evan Cooke - QCON 2011Building a Great Web API - Evan Cooke - QCON 2011
Building a Great Web API - Evan Cooke - QCON 2011
 
Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011Big data and APIs for PHP developers - SXSW 2011
Big data and APIs for PHP developers - SXSW 2011
 
Handling Data in Mega Scale Systems
Handling Data in Mega Scale SystemsHandling Data in Mega Scale Systems
Handling Data in Mega Scale Systems
 
apidays Australia 2023 - The Playful Bond Between REST And Data Streams, Warr...
apidays Australia 2023 - The Playful Bond Between REST And Data Streams, Warr...apidays Australia 2023 - The Playful Bond Between REST And Data Streams, Warr...
apidays Australia 2023 - The Playful Bond Between REST And Data Streams, Warr...
 
The Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data StreamsThe Playful Bond Between REST And Data Streams
The Playful Bond Between REST And Data Streams
 
Building collaborative HTML5 apps using a backend-as-a-service (HTML5DevConf ...
Building collaborative HTML5 apps using a backend-as-a-service (HTML5DevConf ...Building collaborative HTML5 apps using a backend-as-a-service (HTML5DevConf ...
Building collaborative HTML5 apps using a backend-as-a-service (HTML5DevConf ...
 
Sydney summit-lock note
Sydney summit-lock noteSydney summit-lock note
Sydney summit-lock note
 
Become a Performance Diagnostics Hero
Become a Performance Diagnostics HeroBecome a Performance Diagnostics Hero
Become a Performance Diagnostics Hero
 
Netflix Edge Engineering Open House Presentations - June 9, 2016
Netflix Edge Engineering Open House Presentations - June 9, 2016Netflix Edge Engineering Open House Presentations - June 9, 2016
Netflix Edge Engineering Open House Presentations - June 9, 2016
 
Building A Great API - Evan Cooke, Cloudstock, December 2010
Building A Great API - Evan Cooke, Cloudstock, December 2010Building A Great API - Evan Cooke, Cloudstock, December 2010
Building A Great API - Evan Cooke, Cloudstock, December 2010
 
Leveraging Microservice Architectures & Event-Driven Systems for Global APIs
Leveraging Microservice Architectures & Event-Driven Systems for Global APIsLeveraging Microservice Architectures & Event-Driven Systems for Global APIs
Leveraging Microservice Architectures & Event-Driven Systems for Global APIs
 
Big and fast a quest for relevant and real-time analytics
Big and fast a quest for relevant and real-time analyticsBig and fast a quest for relevant and real-time analytics
Big and fast a quest for relevant and real-time analytics
 
Big Data Use Cases and Solutions in the AWS Cloud
Big Data Use Cases and Solutions in the AWS CloudBig Data Use Cases and Solutions in the AWS Cloud
Big Data Use Cases and Solutions in the AWS Cloud
 
ConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web appsConFoo 2017: Introduction to performance optimization of .NET web apps
ConFoo 2017: Introduction to performance optimization of .NET web apps
 
Tidal scale short_story_v2
Tidal scale short_story_v2Tidal scale short_story_v2
Tidal scale short_story_v2
 
Leveraging The Cloud In 2009
Leveraging The Cloud In 2009Leveraging The Cloud In 2009
Leveraging The Cloud In 2009
 

More from Apigee | Google Cloud

Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Apigee | Google Cloud
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldApigee | Google Cloud
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Apigee | Google Cloud
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketApigee | Google Cloud
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsApigee | Google Cloud
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessApigee | Google Cloud
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorApigee | Google Cloud
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailApigee | Google Cloud
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranApigee | Google Cloud
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!Apigee | Google Cloud
 

More from Apigee | Google Cloud (20)

How Secure Are Your APIs?
How Secure Are Your APIs?How Secure Are Your APIs?
How Secure Are Your APIs?
 
Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)Magazine Luiza at a glance (1)
Magazine Luiza at a glance (1)
 
Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs Monetization: Unlock More Value from Your APIs
Monetization: Unlock More Value from Your APIs
 
Apigee Demo: API Platform Overview
Apigee Demo: API Platform OverviewApigee Demo: API Platform Overview
Apigee Demo: API Platform Overview
 
Ticketmaster at a glance
Ticketmaster at a glanceTicketmaster at a glance
Ticketmaster at a glance
 
AccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First WorldAccuWeather: Recasting API Experiences in a Developer-First World
AccuWeather: Recasting API Experiences in a Developer-First World
 
Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?Which Application Modernization Pattern Is Right For You?
Which Application Modernization Pattern Is Right For You?
 
Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2Apigee Product Roadmap Part 2
Apigee Product Roadmap Part 2
 
The Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management MarketThe Four Transformative Forces of the API Management Market
The Four Transformative Forces of the API Management Market
 
Walgreens at a glance
Walgreens at a glanceWalgreens at a glance
Walgreens at a glance
 
Apigee Edge: Intro to Microgateway
Apigee Edge: Intro to MicrogatewayApigee Edge: Intro to Microgateway
Apigee Edge: Intro to Microgateway
 
Managing the Complexity of Microservices Deployments
Managing the Complexity of Microservices DeploymentsManaging the Complexity of Microservices Deployments
Managing the Complexity of Microservices Deployments
 
Pitney Bowes at a glance
Pitney Bowes at a glancePitney Bowes at a glance
Pitney Bowes at a glance
 
Microservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices SuccessMicroservices Done Right: Key Ingredients for Microservices Success
Microservices Done Right: Key Ingredients for Microservices Success
 
Adapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet KapoorAdapt or Die: Opening Keynote with Chet Kapoor
Adapt or Die: Opening Keynote with Chet Kapoor
 
Adapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg BrailAdapt or Die: Keynote with Greg Brail
Adapt or Die: Keynote with Greg Brail
 
Adapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant JhingranAdapt or Die: Keynote with Anant Jhingran
Adapt or Die: Keynote with Anant Jhingran
 
London Adapt or Die: Opening Keynot
London Adapt or Die: Opening KeynotLondon Adapt or Die: Opening Keynot
London Adapt or Die: Opening Keynot
 
London Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynoteLondon Adapt or Die: Lunch keynote
London Adapt or Die: Lunch keynote
 
London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!London Adapt or Die: Closing Keynote — Adapt Now!
London Adapt or Die: Closing Keynote — Adapt Now!
 

Recently uploaded

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 

Recently uploaded (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 

Scaling APIs: Predict, Prepare for, Overcome the Challenges

  • 1. Scaling APIs Feeding your Speeds April 5, 2012 Greg Brail @gbrail Brian Pagano @brianpagano
  • 2. @gbrail @brianpagano
  • 5. New! IRC Channel #api-craft on freenode
  • 6. What is scale to an API? Developers: Lots of developers building apps Apps: Lots of apps for end users to use End users: Millions and millions of app users Versions: Lots of API versions to manage API calls: All of these things result in API calls…
  • 7. Today’s Topic: API Calls Today we are going to focus on handling huge numbers of API calls in an API infrastructure Ever been in a meeting where someone said, “let’s not talk about ‘speeds and feeds’ today?” This is not that meeting.
  • 8. Why do APIs need to scale? Thousands of app developers… Each one must be managed, signed up, etc. Thousands of apps… Each one has credentials that need to be validated Millions of end users… Each one has one or more OAuth access tokens Result in lots of API calls. For example: One million end users, Making 1000 API calls a day, Results in one billion API calls a day, Or about 11,000 API calls per second on average
  • 9. Tracking API calls Today we’ll mainly talk about throughput Measured in API calls or transactions per second (tps) For an API, usually as the number of users increases, throughput increases As throughput increases, latency often increases too It’s not enough just to handle lots of throughput – it’s important to handle it with a reasonable amount of latency
  • 10. What Limits Scale? Disk Database Network App server CPU API Proxy Memory Load balancer Cache servers
  • 11. What are some limits? Seek time Database design & tuning Rotational speed App server coding & config Transfer speed Proxy configuration Clock speed Load balancer policies Number of cores Cache configuration Amount of RAM And many more…
  • 12. Some examples We’re going to talk about things to look at as throughput grows from one level of traffic to another… 1 tps 10 tps 100 tps 1000 tps 10,000 tps 100,000 tps and beyond…..
  • 14. At 1 transaction per second 86,400 per day / 2.5 million per month Almost everything can handle this. What about the database? If each API call makes several big SQL queries, it may not!
  • 15. Strategies for 1 tps Test (always) Tune the database installation Tune the database design Monitor query performance Test again!
  • 17. At 10 transactions per second 864,000 per day / 25 million per month Most infrastructure can still handle this. What about the application server? Is the app well-designed enough? Does it make an excessive number of database calls?
  • 18. Strategies for 10 tps Ensure that the app server is properly optimized Do API calls make the minimum number of database calls? Do API calls depend on large numbers of external services?
  • 20. At 100 transactions per second 8.6 million per day / 259 million per month (Now we are starting to get somewhere) RDBMS systems may struggle Less-efficient app servers may struggle “Free” tiers on hosting platforms aren’t an option
  • 21. Strategies for 100 tps Database optimization and tuning is critical here Allocate fast storage, and lots of it Allocate lots of memory Tune the database to use it! Find bad queries and fix them or optimize them App server tuning is critical here Are there enough threads in the thread pool? Are there enough processes?
  • 23. At 1000 transactions per second 86 million per day / 2.5 billion per month Now everything may start to break… What is the mix between reads and writes?
  • 24. Strategies for 1000 tps Understand the mix between reads and writes Cache the reads as much as you can If you can cache them closer to the client, better Understand your app server performance Faster app servers should still be able to handle (like Java) RoR, Python, PHP, etc will require much bigger clusters Stateless app servers are your friend!
  • 25. More strategies for 1000 tps Can the database handle the load? It can if most transactions are reads And you cache as much as you can Otherwise it’s time to scale the database layer Sharded RDBMSes Or a scalable NoSQL database works here
  • 26. At 10,000 transactions per second 864 million per day / 25 billion per month If most transactions are reads, caching is your friend Otherwise, this is serious business No single database can handle this Few single app servers can handle this If API calls are large, what will the bandwidth be?
  • 27. Strategies for 10,000 tps Caching is even more essential Even a simple cache can handle this load on one or two boxes Database writes are problematic No single database server can write 10,000 times per second Scalable, eventually-consistent databases can scale this big, (like Cassandra)
  • 28. More for 10,000 App servers You’ll need a cluster of app servers no matter what! What about session management? What about load balancing?
  • 29. 100,000 API calls per second 8.6 billion per day! Now your API is truly impressive (either that or it is very poorly designed!) You will need racks of infrastructure no matter what!
  • 30. Some other considerations API design Client design Latency Bandwidth
  • 31. What about API design? Every API call has overhead: TCP connection / SSL handshake / load balancer CPU / API proxy CPU / App server CPU and thread pool / database connections / disk I/O… Do you need to make so many? Can you design your APIs to support fewer high-value API calls? Can you have “batch” calls in your API?
  • 32. What about the client? Can client apps use the API more efficiently? Don’t make the same API calls over and over Utilize compression Utilize conditional requests in HTTP Which means that the API server should support them! Request only the data that’s needed Which means that the API server should trim responses Or paginate them
  • 33. What about latency? Latency kills user experience! How can the API server reduce it? Remove steps in the processing flow through caching Cache closer to the API clients
  • 34. What about the network? What kind of network connection to you have? For instance, in EC2 you get 1Gbps, Or about 122 megabytes / second At 10,000 tps, for instance, that’s 12K per API call
  • 35. THANK YOU Questions and ideas to: @gbrail @brianpagano

Editor's Notes

  1. Creative Commons Attribution-Share Alike 3.0 United States License