Was dealing with the APIGEE gateway development recently and found out that the usage of Spike Arrest is very limiting to certain integrations (Backend only). As per recommended by APIGEE, we should avoid the usage of concurrent rate limit here and potentially replaced it with spike arrest.
But the way how Spike Arrest is implemented is kinda dodgy, E.g. spike arrest of 10 tps indicates that it will return trigger spike arrest limit exception when it receives more than 1 request per 100ms.
With such behaviour, it looks like the rate control has to be control at the client side. It is definitely possible to do it from the client backend, but what about those APIs which are used directly from the Front End ?
Would like to understand what is the recommended identifier for a Spike Arrest under different scenarios
Backend Integration
- Probably by per client id via API key or auth token
Front End / SPA
A hard one, as unlike backend it is impossible to control request rate from the browser considering multiple user multiple tab, however, I have considered
- IP ? (but single IP != single user session)
- Browser SessionId ?
- Rest client to be spike arrest error aware and to perform a retry ?
- Should not use spike arrest ?
Any insights are welcome and appreciated