Design a rate-limiting mechanism to protect public-facing APIs from abuse while maintaining low latency.