This is a Rosetta Code post.
Story
Rate limiting an API means returning 429 Too many requests when the called exceeds quota. This can help with denial-of-service (DoS) attacks and help with performance when many components are trying to use the API at once.
Also see What makes a great API
Task
Implement a rate lmiting service where for a fixed time window a customer can only perform x requests, the service just needs to return true or false. The consumption of the service (so the actual API) is out of scope for this post.
Solutions
WIP!