API Rate Limiting: Should it be per user, or per IP address?
Kaelen Kim
·3460 views
hey everyone, i'm architecting a new public-facing api and running into a common dilemma: how to implement rate limiting effectively. we want to prevent abuse but also be fair to legitimate users. should we focus on limiting requests per api key (per user/application) or per source ip address? each has pros and cons. ip limiting is simpler to implement initially but can unfairly penalize users behind shared ips (like corporate networks or public wi-fi). api key limiting is more granular and fairer to individual users but requires managing keys and might be bypassed if a key is compromised. what are your experiences and recommendations for balancing security, fairness, and implementation effort?
34 comments