SlideShare a Scribd company logo
All rights reserved by Postman Inc
Not Your Grandma’s
Rate Limiting
Meenakshi Dhanani
Developer Relations Engineer,
GraphQL
Bonjour de l’Inde
Meenakshi Dhanani (aka Meena) 󰏝
@mdhananii
DEVELOPER RELATIONS ENGINEER, GRAPHQL
Likes:
- Yoga, strength training 󰙥
- Spanish 󰎼
“
@getpostman @mdhananii
Introduction to Rate Limiting APIs
Challenges with Rate Limiting GraphQL APIs
Optimization Techniques for GraphQL APIs
Real world examples
Road Ahead
1
2
3
4
5
Overview
@getpostman @mdhananii
Introduction to
Rate Limiting
THE CONTEXT
@getpostman @mdhananii
Rate Limiting
● Minimize load
Rate limiting enforces a controlled flow of
requests, preventing system congestion and
downtime due to excessive demand.
● Ensure fair usage
Rate limiting ensures fair usage by setting
predefined limits on how often each client or user
can access resources, preventing any single
entity from monopolizing the system's resources.
Safeguards against bursts of incoming traffic
@getpostman @mdhananii
An API rate limit is essentially a
way for Shopify to ensure
stability of the platform
Zameer Masjedee
Office of the President, Technology Lead at Shopify
“
@getpostman @mdhananii
Challenges with
Rate Limiting
GraphQL APIs
THE PROBLEM
@getpostman @mdhananii
@getpostman @mdhananii
Optimizing for
GraphQL
THE SOLUTION
@getpostman @mdhananii
@getpostman @mdhananii
Query Cost Analysis
● Type complexity
Type complexity reflects the size of the data retrieved
by a query.
● Resolve complexity
Resolve complexity reflects the server’s query
execution cost
Shopify Engineering Blog
@getpostman @mdhananii
Benefits of Cost Analysis for Service Providers
● Inform load balancing
Distribute incoming queries across server instances
based on their complexity, ensuring even processing
and preventing overloading of resources.
● Resolver resource allocation
Developers can allocate resources more effectively,
optimize resolver functions, and prioritize high-impact
queries, resulting in better overall performance and
efficient use of server resources.
● Threat prevention
Attackers are discouraged from crafting overly
complex or deeply nested queries that could degrade
server performance or cause denial-of-service
attacks.
● Monetization
Pricing based on the execution cost or response size.
@getpostman @mdhananii
Query Cost vs Execution Time
Query Cost
Analysis
Techniques
THE HOW
@getpostman @mdhananii
@getpostman @mdhananii
Static Cost Analysis
Blocks queries above a certain complexity, before they execute
@getpostman @mdhananii
Dynamic Cost Analysis
Block queries above a certain complexity, during execution
@getpostman @mdhananii
Response Cost Analysis
Calculates complexity after the execution, based on the response.
@getpostman @mdhananii
Key Considerations
● Introspection Queries
Ensuring that introspection queries are subject to rate
limiting or handled separately is crucial for security.
● Pagination
Pagination arguments significantly impact cost
calculation. The same field with different pagination
sizes can have vastly different costs.
● Upper Bound vs Actual Response
When clients request a large number of items, but the
actual response contains fewer items, there's a
potential mismatch between the charged cost and the
delivered value
● Complexity Calculation Overhead
The process of calculating query complexity itself can
introduce overhead, especially for deeply nested
queries.
Examples
REAL WORLD SCHEMAS
@getpostman @mdhananii
@getpostman @mdhananii
Shopify Query Cost Analysis
@getpostman @mdhananii
GitHub Query Cost Analysis
@getpostman @mdhananii
Yelp Query Cost Analysis
@getpostman @mdhananii
No Right Answer
Examples illustrate a good rate limiting strategy
consists of not one but a combination of all these
techniques.
@getpostman @mdhananii
Traditional Architecture for Rate Limiting
● Gateways/Routers
API gateways can centralize the management
of APIs, making it easier to control access,
monitor traffic, and troubleshoot problems.
Road Ahead
@getpostman @mdhananii
SNEAK PEEK INTO THE FUTURE
@getpostman @mdhananii
Implementation Strategies
● Compilers
A compiler transforms GraphQL queries into an
optimized representation. This representation can
then be used to implement rate limiting more
efficiently.
● Machine Learning Approach
Machine learning can be used to learn the patterns of
legitimate and malicious traffic. This information can
then be used to optimize the rate limiting rules to
better protect the API from abuse.
During this session, we learned:
● What is rate limiting APIs?
● Why is rate limiting for GraphQL different from other APIs?
● Query cost analysis - techniques, examples
● Peek into future strategies
Recap
@getpostman @mdhananii
GraphQL Concepts
@getpostman @mdhananii
API Rate Limits and Working with GraphQL
https://www.shopify.com/partners/blog/graphql-rate-limits
A Guide to GraphQL Rate Limiting and Security
https://xuorig.medium.com/a-guide-to-graphql-rate-limiting-security-e62a86ef8114
Why does GraphQL need cost analysis? | Morris Matsa
https://mmatsa.com/blog/why-cost-analysis/
A Principled Approach to GraphQL Query Cost Analysis
https://arxiv.org/pdf/2009.05632.pdf
Additional Resources
@getpostman @mdhananii
Q&A
Please tell us about your
experience!
@getpostman @mdhananii
Thank You
@getpostman @mdhananii

More Related Content

Similar to Apidays Paris 2023 - Not Your Grandma’s Rate Limiting, Meenakshi Dhanani, Postman

SigOpt for Hedge Funds
SigOpt for Hedge FundsSigOpt for Hedge Funds
SigOpt for Hedge Funds
SigOpt
 
Webapp Automation Testing of performance marketing and media platform
Webapp Automation Testing of performance marketing and media platformWebapp Automation Testing of performance marketing and media platform
Webapp Automation Testing of performance marketing and media platform
Knoldus Inc.
 
GridMAP: Next generation energy analysis tools.
GridMAP: Next generation energy analysis tools.GridMAP: Next generation energy analysis tools.
GridMAP: Next generation energy analysis tools.
Iain Beveridge
 
Selling commercial Solar +/or Energy Storage solutions? You need GridMAP!
Selling commercial Solar +/or Energy Storage solutions? You need GridMAP!    Selling commercial Solar +/or Energy Storage solutions? You need GridMAP!
Selling commercial Solar +/or Energy Storage solutions? You need GridMAP!
Iain Beveridge
 
Qualitia - Scriptless Test Automation Platform
Qualitia - Scriptless Test Automation PlatformQualitia - Scriptless Test Automation Platform
Qualitia - Scriptless Test Automation Platform
Monica Paul
 
Data mining for_java_and_dot_net 2016-17
Data mining for_java_and_dot_net 2016-17Data mining for_java_and_dot_net 2016-17
Data mining for_java_and_dot_net 2016-17
redpel dot com
 
Agile Mumbai 2019 Conference | Intelligent DevOps enabling Enterprise Agilit...
Agile Mumbai 2019 Conference |  Intelligent DevOps enabling Enterprise Agilit...Agile Mumbai 2019 Conference |  Intelligent DevOps enabling Enterprise Agilit...
Agile Mumbai 2019 Conference | Intelligent DevOps enabling Enterprise Agilit...
AgileNetwork
 
How can we use LangChain for Data Analysis_ A Detailed Perspective.pdf
How can we use LangChain for Data Analysis_ A Detailed Perspective.pdfHow can we use LangChain for Data Analysis_ A Detailed Perspective.pdf
How can we use LangChain for Data Analysis_ A Detailed Perspective.pdf
Bluebash
 
Big Data - Hadoop and MapReduce for QA and testing by Aditya Garg
Big Data - Hadoop and MapReduce for QA and testing by Aditya GargBig Data - Hadoop and MapReduce for QA and testing by Aditya Garg
Big Data - Hadoop and MapReduce for QA and testing by Aditya Garg
QA or the Highway
 
AyyappaKumar_AutomationTesting
AyyappaKumar_AutomationTestingAyyappaKumar_AutomationTesting
AyyappaKumar_AutomationTestingAyyappa Kumar
 
Rushcode overview
Rushcode overviewRushcode overview
Rushcode overview
rushcodeharish
 
Getting start with Performance Testing
Getting start with Performance Testing Getting start with Performance Testing
Getting start with Performance Testing
Yogesh Deshmukh
 
Rpa consulting service in cognic
Rpa consulting service in cognicRpa consulting service in cognic
Rpa consulting service in cognic
Cognic Systems Pvt Ltd
 
Optimizing API Performance Testing A Comprehensive Guide
Optimizing API Performance Testing A Comprehensive GuideOptimizing API Performance Testing A Comprehensive Guide
Optimizing API Performance Testing A Comprehensive Guide
Testrig Technologies
 
[Webinar] Getting started with server-side testing - presented by WiderFunnel...
[Webinar] Getting started with server-side testing - presented by WiderFunnel...[Webinar] Getting started with server-side testing - presented by WiderFunnel...
[Webinar] Getting started with server-side testing - presented by WiderFunnel...
Chris Goward
 
2020 10-08 measuring-qualityinproduction
2020 10-08 measuring-qualityinproduction2020 10-08 measuring-qualityinproduction
2020 10-08 measuring-qualityinproduction
Abigail Bangser
 
Past Experiences and Future Challenges using Automatic Performance Modelling ...
Past Experiences and Future Challenges using Automatic Performance Modelling ...Past Experiences and Future Challenges using Automatic Performance Modelling ...
Past Experiences and Future Challenges using Automatic Performance Modelling ...
Paul Brebner
 
Quality at the speed of digital
Quality   at the speed of digitalQuality   at the speed of digital
Quality at the speed of digital
rajni singh
 
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
Amazon Web Services
 
Quality automation at walmart scale
Quality automation at walmart scaleQuality automation at walmart scale
Quality automation at walmart scale
Test Armada
 

Similar to Apidays Paris 2023 - Not Your Grandma’s Rate Limiting, Meenakshi Dhanani, Postman (20)

SigOpt for Hedge Funds
SigOpt for Hedge FundsSigOpt for Hedge Funds
SigOpt for Hedge Funds
 
Webapp Automation Testing of performance marketing and media platform
Webapp Automation Testing of performance marketing and media platformWebapp Automation Testing of performance marketing and media platform
Webapp Automation Testing of performance marketing and media platform
 
GridMAP: Next generation energy analysis tools.
GridMAP: Next generation energy analysis tools.GridMAP: Next generation energy analysis tools.
GridMAP: Next generation energy analysis tools.
 
Selling commercial Solar +/or Energy Storage solutions? You need GridMAP!
Selling commercial Solar +/or Energy Storage solutions? You need GridMAP!    Selling commercial Solar +/or Energy Storage solutions? You need GridMAP!
Selling commercial Solar +/or Energy Storage solutions? You need GridMAP!
 
Qualitia - Scriptless Test Automation Platform
Qualitia - Scriptless Test Automation PlatformQualitia - Scriptless Test Automation Platform
Qualitia - Scriptless Test Automation Platform
 
Data mining for_java_and_dot_net 2016-17
Data mining for_java_and_dot_net 2016-17Data mining for_java_and_dot_net 2016-17
Data mining for_java_and_dot_net 2016-17
 
Agile Mumbai 2019 Conference | Intelligent DevOps enabling Enterprise Agilit...
Agile Mumbai 2019 Conference |  Intelligent DevOps enabling Enterprise Agilit...Agile Mumbai 2019 Conference |  Intelligent DevOps enabling Enterprise Agilit...
Agile Mumbai 2019 Conference | Intelligent DevOps enabling Enterprise Agilit...
 
How can we use LangChain for Data Analysis_ A Detailed Perspective.pdf
How can we use LangChain for Data Analysis_ A Detailed Perspective.pdfHow can we use LangChain for Data Analysis_ A Detailed Perspective.pdf
How can we use LangChain for Data Analysis_ A Detailed Perspective.pdf
 
Big Data - Hadoop and MapReduce for QA and testing by Aditya Garg
Big Data - Hadoop and MapReduce for QA and testing by Aditya GargBig Data - Hadoop and MapReduce for QA and testing by Aditya Garg
Big Data - Hadoop and MapReduce for QA and testing by Aditya Garg
 
AyyappaKumar_AutomationTesting
AyyappaKumar_AutomationTestingAyyappaKumar_AutomationTesting
AyyappaKumar_AutomationTesting
 
Rushcode overview
Rushcode overviewRushcode overview
Rushcode overview
 
Getting start with Performance Testing
Getting start with Performance Testing Getting start with Performance Testing
Getting start with Performance Testing
 
Rpa consulting service in cognic
Rpa consulting service in cognicRpa consulting service in cognic
Rpa consulting service in cognic
 
Optimizing API Performance Testing A Comprehensive Guide
Optimizing API Performance Testing A Comprehensive GuideOptimizing API Performance Testing A Comprehensive Guide
Optimizing API Performance Testing A Comprehensive Guide
 
[Webinar] Getting started with server-side testing - presented by WiderFunnel...
[Webinar] Getting started with server-side testing - presented by WiderFunnel...[Webinar] Getting started with server-side testing - presented by WiderFunnel...
[Webinar] Getting started with server-side testing - presented by WiderFunnel...
 
2020 10-08 measuring-qualityinproduction
2020 10-08 measuring-qualityinproduction2020 10-08 measuring-qualityinproduction
2020 10-08 measuring-qualityinproduction
 
Past Experiences and Future Challenges using Automatic Performance Modelling ...
Past Experiences and Future Challenges using Automatic Performance Modelling ...Past Experiences and Future Challenges using Automatic Performance Modelling ...
Past Experiences and Future Challenges using Automatic Performance Modelling ...
 
Quality at the speed of digital
Quality   at the speed of digitalQuality   at the speed of digital
Quality at the speed of digital
 
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
Breaking Up the Monolith While Migrating to AWS (GPSTEC320) - AWS re:Invent 2018
 
Quality automation at walmart scale
Quality automation at walmart scaleQuality automation at walmart scale
Quality automation at walmart scale
 

More from apidays

Apidays Helsinki 2024 - APIs ahoy, the case of Customer Booking APIs in Finn...
Apidays Helsinki 2024 -  APIs ahoy, the case of Customer Booking APIs in Finn...Apidays Helsinki 2024 -  APIs ahoy, the case of Customer Booking APIs in Finn...
Apidays Helsinki 2024 - APIs ahoy, the case of Customer Booking APIs in Finn...
apidays
 
Apidays Helsinki 2024 - From Chaos to Calm- Navigating Emerging API Security...
Apidays Helsinki 2024 -  From Chaos to Calm- Navigating Emerging API Security...Apidays Helsinki 2024 -  From Chaos to Calm- Navigating Emerging API Security...
Apidays Helsinki 2024 - From Chaos to Calm- Navigating Emerging API Security...
apidays
 
Apidays Helsinki 2024 - What is next now that your organization created a (si...
Apidays Helsinki 2024 - What is next now that your organization created a (si...Apidays Helsinki 2024 - What is next now that your organization created a (si...
Apidays Helsinki 2024 - What is next now that your organization created a (si...
apidays
 
Apidays Helsinki 2024 - There’s no AI without API, but what does this mean fo...
Apidays Helsinki 2024 - There’s no AI without API, but what does this mean fo...Apidays Helsinki 2024 - There’s no AI without API, but what does this mean fo...
Apidays Helsinki 2024 - There’s no AI without API, but what does this mean fo...
apidays
 
Apidays Helsinki 2024 - Sustainable IT and API Performance - How to Bring The...
Apidays Helsinki 2024 - Sustainable IT and API Performance - How to Bring The...Apidays Helsinki 2024 - Sustainable IT and API Performance - How to Bring The...
Apidays Helsinki 2024 - Sustainable IT and API Performance - How to Bring The...
apidays
 
Apidays Helsinki 2024 - Security Vulnerabilities in your APIs by Lukáš Ďurovs...
Apidays Helsinki 2024 - Security Vulnerabilities in your APIs by Lukáš Ďurovs...Apidays Helsinki 2024 - Security Vulnerabilities in your APIs by Lukáš Ďurovs...
Apidays Helsinki 2024 - Security Vulnerabilities in your APIs by Lukáš Ďurovs...
apidays
 
Apidays Helsinki 2024 - Data, API’s and Banks, with AI on top by Sergio Giral...
Apidays Helsinki 2024 - Data, API’s and Banks, with AI on top by Sergio Giral...Apidays Helsinki 2024 - Data, API’s and Banks, with AI on top by Sergio Giral...
Apidays Helsinki 2024 - Data, API’s and Banks, with AI on top by Sergio Giral...
apidays
 
Apidays Helsinki 2024 - Data Ecosystems Driving the Green Transition by Olli ...
Apidays Helsinki 2024 - Data Ecosystems Driving the Green Transition by Olli ...Apidays Helsinki 2024 - Data Ecosystems Driving the Green Transition by Olli ...
Apidays Helsinki 2024 - Data Ecosystems Driving the Green Transition by Olli ...
apidays
 
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
apidays
 
Apidays Helsinki 2024 - API Compliance by Design by Marjukka Niinioja, Osaango
Apidays Helsinki 2024 - API Compliance by Design by Marjukka Niinioja, OsaangoApidays Helsinki 2024 - API Compliance by Design by Marjukka Niinioja, Osaango
Apidays Helsinki 2024 - API Compliance by Design by Marjukka Niinioja, Osaango
apidays
 
Apidays Helsinki 2024 - ABLOY goes API economy – Transformation story by Hann...
Apidays Helsinki 2024 - ABLOY goes API economy – Transformation story by Hann...Apidays Helsinki 2024 - ABLOY goes API economy – Transformation story by Hann...
Apidays Helsinki 2024 - ABLOY goes API economy – Transformation story by Hann...
apidays
 
Apidays New York 2024 - The subtle art of API rate limiting by Josh Twist, Zuplo
Apidays New York 2024 - The subtle art of API rate limiting by Josh Twist, ZuploApidays New York 2024 - The subtle art of API rate limiting by Josh Twist, Zuplo
Apidays New York 2024 - The subtle art of API rate limiting by Josh Twist, Zuplo
apidays
 
Apidays New York 2024 - RESTful API Patterns and Practices by Mike Amundsen, ...
Apidays New York 2024 - RESTful API Patterns and Practices by Mike Amundsen, ...Apidays New York 2024 - RESTful API Patterns and Practices by Mike Amundsen, ...
Apidays New York 2024 - RESTful API Patterns and Practices by Mike Amundsen, ...
apidays
 
Apidays New York 2024 - Putting AI into API Security by Corey Ball, Moss Adams
Apidays New York 2024 - Putting AI into API Security by Corey Ball, Moss AdamsApidays New York 2024 - Putting AI into API Security by Corey Ball, Moss Adams
Apidays New York 2024 - Putting AI into API Security by Corey Ball, Moss Adams
apidays
 
Apidays New York 2024 - Prototype-first - A modern API development workflow b...
Apidays New York 2024 - Prototype-first - A modern API development workflow b...Apidays New York 2024 - Prototype-first - A modern API development workflow b...
Apidays New York 2024 - Prototype-first - A modern API development workflow b...
apidays
 
Apidays New York 2024 - Post-Quantum API Security by Francois Lascelles, Broa...
Apidays New York 2024 - Post-Quantum API Security by Francois Lascelles, Broa...Apidays New York 2024 - Post-Quantum API Security by Francois Lascelles, Broa...
Apidays New York 2024 - Post-Quantum API Security by Francois Lascelles, Broa...
apidays
 
Apidays New York 2024 - Increase your productivity with no-code GraphQL mocki...
Apidays New York 2024 - Increase your productivity with no-code GraphQL mocki...Apidays New York 2024 - Increase your productivity with no-code GraphQL mocki...
Apidays New York 2024 - Increase your productivity with no-code GraphQL mocki...
apidays
 
Apidays New York 2024 - Driving API & EDA Success by Marcelo Caponi, Danone
Apidays New York 2024 - Driving API & EDA Success by Marcelo Caponi, DanoneApidays New York 2024 - Driving API & EDA Success by Marcelo Caponi, Danone
Apidays New York 2024 - Driving API & EDA Success by Marcelo Caponi, Danone
apidays
 
Apidays New York 2024 - Build a terrible API for people you hate by Jim Benne...
Apidays New York 2024 - Build a terrible API for people you hate by Jim Benne...Apidays New York 2024 - Build a terrible API for people you hate by Jim Benne...
Apidays New York 2024 - Build a terrible API for people you hate by Jim Benne...
apidays
 
Apidays New York 2024 - API Secret Tokens Exposed by Tristan Kalos and Antoin...
Apidays New York 2024 - API Secret Tokens Exposed by Tristan Kalos and Antoin...Apidays New York 2024 - API Secret Tokens Exposed by Tristan Kalos and Antoin...
Apidays New York 2024 - API Secret Tokens Exposed by Tristan Kalos and Antoin...
apidays
 

More from apidays (20)

Apidays Helsinki 2024 - APIs ahoy, the case of Customer Booking APIs in Finn...
Apidays Helsinki 2024 -  APIs ahoy, the case of Customer Booking APIs in Finn...Apidays Helsinki 2024 -  APIs ahoy, the case of Customer Booking APIs in Finn...
Apidays Helsinki 2024 - APIs ahoy, the case of Customer Booking APIs in Finn...
 
Apidays Helsinki 2024 - From Chaos to Calm- Navigating Emerging API Security...
Apidays Helsinki 2024 -  From Chaos to Calm- Navigating Emerging API Security...Apidays Helsinki 2024 -  From Chaos to Calm- Navigating Emerging API Security...
Apidays Helsinki 2024 - From Chaos to Calm- Navigating Emerging API Security...
 
Apidays Helsinki 2024 - What is next now that your organization created a (si...
Apidays Helsinki 2024 - What is next now that your organization created a (si...Apidays Helsinki 2024 - What is next now that your organization created a (si...
Apidays Helsinki 2024 - What is next now that your organization created a (si...
 
Apidays Helsinki 2024 - There’s no AI without API, but what does this mean fo...
Apidays Helsinki 2024 - There’s no AI without API, but what does this mean fo...Apidays Helsinki 2024 - There’s no AI without API, but what does this mean fo...
Apidays Helsinki 2024 - There’s no AI without API, but what does this mean fo...
 
Apidays Helsinki 2024 - Sustainable IT and API Performance - How to Bring The...
Apidays Helsinki 2024 - Sustainable IT and API Performance - How to Bring The...Apidays Helsinki 2024 - Sustainable IT and API Performance - How to Bring The...
Apidays Helsinki 2024 - Sustainable IT and API Performance - How to Bring The...
 
Apidays Helsinki 2024 - Security Vulnerabilities in your APIs by Lukáš Ďurovs...
Apidays Helsinki 2024 - Security Vulnerabilities in your APIs by Lukáš Ďurovs...Apidays Helsinki 2024 - Security Vulnerabilities in your APIs by Lukáš Ďurovs...
Apidays Helsinki 2024 - Security Vulnerabilities in your APIs by Lukáš Ďurovs...
 
Apidays Helsinki 2024 - Data, API’s and Banks, with AI on top by Sergio Giral...
Apidays Helsinki 2024 - Data, API’s and Banks, with AI on top by Sergio Giral...Apidays Helsinki 2024 - Data, API’s and Banks, with AI on top by Sergio Giral...
Apidays Helsinki 2024 - Data, API’s and Banks, with AI on top by Sergio Giral...
 
Apidays Helsinki 2024 - Data Ecosystems Driving the Green Transition by Olli ...
Apidays Helsinki 2024 - Data Ecosystems Driving the Green Transition by Olli ...Apidays Helsinki 2024 - Data Ecosystems Driving the Green Transition by Olli ...
Apidays Helsinki 2024 - Data Ecosystems Driving the Green Transition by Olli ...
 
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
Apidays Helsinki 2024 - Bridging the Gap Between Backend and Frontend API Tes...
 
Apidays Helsinki 2024 - API Compliance by Design by Marjukka Niinioja, Osaango
Apidays Helsinki 2024 - API Compliance by Design by Marjukka Niinioja, OsaangoApidays Helsinki 2024 - API Compliance by Design by Marjukka Niinioja, Osaango
Apidays Helsinki 2024 - API Compliance by Design by Marjukka Niinioja, Osaango
 
Apidays Helsinki 2024 - ABLOY goes API economy – Transformation story by Hann...
Apidays Helsinki 2024 - ABLOY goes API economy – Transformation story by Hann...Apidays Helsinki 2024 - ABLOY goes API economy – Transformation story by Hann...
Apidays Helsinki 2024 - ABLOY goes API economy – Transformation story by Hann...
 
Apidays New York 2024 - The subtle art of API rate limiting by Josh Twist, Zuplo
Apidays New York 2024 - The subtle art of API rate limiting by Josh Twist, ZuploApidays New York 2024 - The subtle art of API rate limiting by Josh Twist, Zuplo
Apidays New York 2024 - The subtle art of API rate limiting by Josh Twist, Zuplo
 
Apidays New York 2024 - RESTful API Patterns and Practices by Mike Amundsen, ...
Apidays New York 2024 - RESTful API Patterns and Practices by Mike Amundsen, ...Apidays New York 2024 - RESTful API Patterns and Practices by Mike Amundsen, ...
Apidays New York 2024 - RESTful API Patterns and Practices by Mike Amundsen, ...
 
Apidays New York 2024 - Putting AI into API Security by Corey Ball, Moss Adams
Apidays New York 2024 - Putting AI into API Security by Corey Ball, Moss AdamsApidays New York 2024 - Putting AI into API Security by Corey Ball, Moss Adams
Apidays New York 2024 - Putting AI into API Security by Corey Ball, Moss Adams
 
Apidays New York 2024 - Prototype-first - A modern API development workflow b...
Apidays New York 2024 - Prototype-first - A modern API development workflow b...Apidays New York 2024 - Prototype-first - A modern API development workflow b...
Apidays New York 2024 - Prototype-first - A modern API development workflow b...
 
Apidays New York 2024 - Post-Quantum API Security by Francois Lascelles, Broa...
Apidays New York 2024 - Post-Quantum API Security by Francois Lascelles, Broa...Apidays New York 2024 - Post-Quantum API Security by Francois Lascelles, Broa...
Apidays New York 2024 - Post-Quantum API Security by Francois Lascelles, Broa...
 
Apidays New York 2024 - Increase your productivity with no-code GraphQL mocki...
Apidays New York 2024 - Increase your productivity with no-code GraphQL mocki...Apidays New York 2024 - Increase your productivity with no-code GraphQL mocki...
Apidays New York 2024 - Increase your productivity with no-code GraphQL mocki...
 
Apidays New York 2024 - Driving API & EDA Success by Marcelo Caponi, Danone
Apidays New York 2024 - Driving API & EDA Success by Marcelo Caponi, DanoneApidays New York 2024 - Driving API & EDA Success by Marcelo Caponi, Danone
Apidays New York 2024 - Driving API & EDA Success by Marcelo Caponi, Danone
 
Apidays New York 2024 - Build a terrible API for people you hate by Jim Benne...
Apidays New York 2024 - Build a terrible API for people you hate by Jim Benne...Apidays New York 2024 - Build a terrible API for people you hate by Jim Benne...
Apidays New York 2024 - Build a terrible API for people you hate by Jim Benne...
 
Apidays New York 2024 - API Secret Tokens Exposed by Tristan Kalos and Antoin...
Apidays New York 2024 - API Secret Tokens Exposed by Tristan Kalos and Antoin...Apidays New York 2024 - API Secret Tokens Exposed by Tristan Kalos and Antoin...
Apidays New York 2024 - API Secret Tokens Exposed by Tristan Kalos and Antoin...
 

Recently uploaded

一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
ewymefz
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
Subhajit Sahu
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
ocavb
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
StarCompliance.io
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
Opendatabay
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
ewymefz
 
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
correoyaya
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
Tiktokethiodaily
 
一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单
ewymefz
 
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
ukgaet
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Boston Institute of Analytics
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
axoqas
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
ewymefz
 
Tabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflowsTabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflows
alex933524
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
benishzehra469
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
TravisMalana
 
tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
theahmadsaood
 
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdfSample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Linda486226
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
ArpitMalhotra16
 

Recently uploaded (20)

一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
一比一原版(UPenn毕业证)宾夕法尼亚大学毕业证成绩单
 
Adjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTESAdjusting primitives for graph : SHORT REPORT / NOTES
Adjusting primitives for graph : SHORT REPORT / NOTES
 
一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单一比一原版(TWU毕业证)西三一大学毕业证成绩单
一比一原版(TWU毕业证)西三一大学毕业证成绩单
 
Investigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_CrimesInvestigate & Recover / StarCompliance.io / Crypto_Crimes
Investigate & Recover / StarCompliance.io / Crypto_Crimes
 
Criminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdfCriminal IP - Threat Hunting Webinar.pdf
Criminal IP - Threat Hunting Webinar.pdf
 
Opendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptxOpendatabay - Open Data Marketplace.pptx
Opendatabay - Open Data Marketplace.pptx
 
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
一比一原版(UMich毕业证)密歇根大学|安娜堡分校毕业证成绩单
 
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
Innovative Methods in Media and Communication Research by Sebastian Kubitschk...
 
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
1.Seydhcuxhxyxhccuuxuxyxyxmisolids 2019.pptx
 
一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单一比一原版(BU毕业证)波士顿大学毕业证成绩单
一比一原版(BU毕业证)波士顿大学毕业证成绩单
 
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
一比一原版(UVic毕业证)维多利亚大学毕业证成绩单
 
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project PresentationPredicting Product Ad Campaign Performance: A Data Analysis Project Presentation
Predicting Product Ad Campaign Performance: A Data Analysis Project Presentation
 
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
哪里卖(usq毕业证书)南昆士兰大学毕业证研究生文凭证书托福证书原版一模一样
 
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
一比一原版(IIT毕业证)伊利诺伊理工大学毕业证成绩单
 
Tabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflowsTabula.io Cheatsheet: automate your data workflows
Tabula.io Cheatsheet: automate your data workflows
 
Empowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptxEmpowering Data Analytics Ecosystem.pptx
Empowering Data Analytics Ecosystem.pptx
 
Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)Malana- Gimlet Market Analysis (Portfolio 2)
Malana- Gimlet Market Analysis (Portfolio 2)
 
tapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive datatapal brand analysis PPT slide for comptetive data
tapal brand analysis PPT slide for comptetive data
 
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdfSample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
Sample_Global Non-invasive Prenatal Testing (NIPT) Market, 2019-2030.pdf
 
standardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghhstandardisation of garbhpala offhgfffghh
standardisation of garbhpala offhgfffghh
 

Apidays Paris 2023 - Not Your Grandma’s Rate Limiting, Meenakshi Dhanani, Postman

  • 1. All rights reserved by Postman Inc Not Your Grandma’s Rate Limiting Meenakshi Dhanani Developer Relations Engineer, GraphQL
  • 2. Bonjour de l’Inde Meenakshi Dhanani (aka Meena) 󰏝 @mdhananii DEVELOPER RELATIONS ENGINEER, GRAPHQL Likes: - Yoga, strength training 󰙥 - Spanish 󰎼 “ @getpostman @mdhananii
  • 3. Introduction to Rate Limiting APIs Challenges with Rate Limiting GraphQL APIs Optimization Techniques for GraphQL APIs Real world examples Road Ahead 1 2 3 4 5 Overview @getpostman @mdhananii
  • 4. Introduction to Rate Limiting THE CONTEXT @getpostman @mdhananii
  • 5. Rate Limiting ● Minimize load Rate limiting enforces a controlled flow of requests, preventing system congestion and downtime due to excessive demand. ● Ensure fair usage Rate limiting ensures fair usage by setting predefined limits on how often each client or user can access resources, preventing any single entity from monopolizing the system's resources. Safeguards against bursts of incoming traffic @getpostman @mdhananii
  • 6. An API rate limit is essentially a way for Shopify to ensure stability of the platform Zameer Masjedee Office of the President, Technology Lead at Shopify “ @getpostman @mdhananii
  • 7. Challenges with Rate Limiting GraphQL APIs THE PROBLEM @getpostman @mdhananii
  • 10. @getpostman @mdhananii Query Cost Analysis ● Type complexity Type complexity reflects the size of the data retrieved by a query. ● Resolve complexity Resolve complexity reflects the server’s query execution cost Shopify Engineering Blog
  • 11. @getpostman @mdhananii Benefits of Cost Analysis for Service Providers ● Inform load balancing Distribute incoming queries across server instances based on their complexity, ensuring even processing and preventing overloading of resources. ● Resolver resource allocation Developers can allocate resources more effectively, optimize resolver functions, and prioritize high-impact queries, resulting in better overall performance and efficient use of server resources. ● Threat prevention Attackers are discouraged from crafting overly complex or deeply nested queries that could degrade server performance or cause denial-of-service attacks. ● Monetization Pricing based on the execution cost or response size.
  • 14. @getpostman @mdhananii Static Cost Analysis Blocks queries above a certain complexity, before they execute
  • 15. @getpostman @mdhananii Dynamic Cost Analysis Block queries above a certain complexity, during execution
  • 16. @getpostman @mdhananii Response Cost Analysis Calculates complexity after the execution, based on the response.
  • 17. @getpostman @mdhananii Key Considerations ● Introspection Queries Ensuring that introspection queries are subject to rate limiting or handled separately is crucial for security. ● Pagination Pagination arguments significantly impact cost calculation. The same field with different pagination sizes can have vastly different costs. ● Upper Bound vs Actual Response When clients request a large number of items, but the actual response contains fewer items, there's a potential mismatch between the charged cost and the delivered value ● Complexity Calculation Overhead The process of calculating query complexity itself can introduce overhead, especially for deeply nested queries.
  • 22. @getpostman @mdhananii No Right Answer Examples illustrate a good rate limiting strategy consists of not one but a combination of all these techniques.
  • 23. @getpostman @mdhananii Traditional Architecture for Rate Limiting ● Gateways/Routers API gateways can centralize the management of APIs, making it easier to control access, monitor traffic, and troubleshoot problems.
  • 25. @getpostman @mdhananii Implementation Strategies ● Compilers A compiler transforms GraphQL queries into an optimized representation. This representation can then be used to implement rate limiting more efficiently. ● Machine Learning Approach Machine learning can be used to learn the patterns of legitimate and malicious traffic. This information can then be used to optimize the rate limiting rules to better protect the API from abuse.
  • 26. During this session, we learned: ● What is rate limiting APIs? ● Why is rate limiting for GraphQL different from other APIs? ● Query cost analysis - techniques, examples ● Peek into future strategies Recap @getpostman @mdhananii
  • 28. API Rate Limits and Working with GraphQL https://www.shopify.com/partners/blog/graphql-rate-limits A Guide to GraphQL Rate Limiting and Security https://xuorig.medium.com/a-guide-to-graphql-rate-limiting-security-e62a86ef8114 Why does GraphQL need cost analysis? | Morris Matsa https://mmatsa.com/blog/why-cost-analysis/ A Principled Approach to GraphQL Query Cost Analysis https://arxiv.org/pdf/2009.05632.pdf Additional Resources @getpostman @mdhananii
  • 29. Q&A Please tell us about your experience! @getpostman @mdhananii