Hi guys,
I was looking into ways to protect our services from exaggerated load by "runaway clients". Keep in mind that this is for in-house services.
My idea is to basically use different kinds of information to establish the origin of the caller.
Call this the "extraction" part of my system.
Then I have to relate this call to all other calls in a certain time box. This means I have to store a history of calls per origin caller.
Call this the "history" part of my system.
Finally I have to decide wether to allow the call or not.
Call this the "decision" part of the system.
Now, there are multiple possibilites to spread these there parts of the system:
- I could have a gateway for all API calls that acts as the extractor, history and decision part of the system.
- I could have filters on each individual service which acts both as extractor and decision and put the history in a separate service
- I could have filter which simply relays the call to a service acting as extractor, history and decision parts.
The thing I don't like about the gateway approach is that that system is handling all calls for the entire landscape. Yes, it does much less than the other services, but the infrastructure it runs on is comparable and hence the load might kill it and all the services behind it won't be reachable.
The thing I don't like about any filter approach is that the service still has to handle the load of the call. This protects resources behind the service, but the infrastructure of the actual service still gets pounded.
Are there any other options? Are there ways to mitigate the impact on any of the above options?
After deciding on the rough architecture the next step will be building the actual API :) thats gonna be more fun!
Cheers,
Felipe