API / APIGEE Gateway Interview Questions
What is the difference between Quota and SpikeArrest policies in Apigee?
Both policies limit traffic, but they operate on very different time scales and serve different purposes. Confusing them is a common interview question because both say 'rate limiting' but do fundamentally different jobs.
| Aspect | Quota | SpikeArrest |
|---|---|---|
| Purpose | Business-level entitlement enforcement | Protect backend from sudden traffic spikes |
| Time window | Minutes, hours, days, weeks, or months | Smoothed over seconds or minutes |
| Counter tracking | Per app / developer / API product | Per Apigee message processor (no central count) |
| When reset | At end of the defined interval | Continuous sliding window |
| Example use | Developer on Free tier: max 1,000 calls/day | Allow max 100 requests/second across all callers |
| What happens on violation | Returns 429 (Quota Exceeded) | Returns 429 (Spike Arrest Violation) |
<!-- Quota policy: business entitlement --> <Quota name="Quota" type="rollingwindow"> <Allow count="1000"/> <!-- 1000 calls... --> <Interval>1</Interval> <TimeUnit>day</TimeUnit> <!-- ...per day --> <Identifier ref="verifyapikey.VerifyAPIKey.client_id"/> <!-- per app --> </Quota> <!-- SpikeArrest policy: smooth out bursts --> <SpikeArrest name="SpikeArrest"> <!-- Allow max 10 requests per second Apigee converts to "1 req per 100ms" --> <Rate>10ps</Rate> <!-- ps = per second, pm = per minute --> </SpikeArrest> <!-- Best practice: use BOTH SpikeArrest runs first to prevent sudden spikes Then Quota enforces the developer's entitlement -->
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
