You are a developer at a company that has built a serverless application that allows users to get NBA stats.
The application consists of three different levels of subscription Free, Premium and Enterprise, implemented using stages in API Gateway.
The Free level allows developers to access stats up to 5 games per player, and premium and enterprise get full access to the database.
Your manager has asked you to limit the free level to 100 concurrent requests at any given point in time.
How can this be achieved?
Click on the arrows to vote for the correct answer
A. B. C. D.Answer: B.
Option A is incorrect as changing Burst to 50 and Rate to 50 will mean that 50 concurrent requests can be made and processed at any given point in time.
Option B is CORRECT as changing Burst to 100 and Rate to 100 will allow 100 concurrent requests to be made and processed at any given point in time.
Option C is incorrect as changing Burst to 50 and Rate to 100 will allow 50 concurrent requests to be made but 100 processed at any given point in time.
The remaining 50 requests will be a 429 error and will have to retry after an interval.
Option D is incorrect as not all options are correct.
Reference:
https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-request-throttling.html https://aws.amazon.com/blogs/aws/new-usage-plans-for-amazon-api-gateway/The correct answer to the question is B. Under usage plan for the stage change Burst to 100 and Rate to 100.
API Gateway provides the ability to create usage plans to limit and meter usage of API resources for different levels of subscription. Usage plans can define different limits on requests, such as the number of requests per second or the number of concurrent requests.
To limit the free level to 100 concurrent requests at any given point in time, we need to create a usage plan for the Free level and set the limit for concurrent requests to 100. We can achieve this by following these steps:
Once the usage plan is created, we need to associate it with the Free stage. We can do this by following these steps:
Now, any requests made to the Free stage will be subject to the limits defined in the usage plan, including the limit of 100 concurrent requests at any given point in time.
Option A (Burst to 50 and Rate to 50) and Option C (Burst to 50 and Rate to 100) are incorrect because they do not meet the requirement of limiting the free level to 100 concurrent requests. Only Option B (Burst to 100 and Rate to 100) meets the requirement. Therefore, the correct answer is option B.