Maxim Mironjuk
-
March 19, 2025
Symfony's RateLimiter component reliably protects endpoints from abuse, but only if the chosen storage backend actually matches the underlying infrastructure. In-memory storage is meant for tests and only counts requests within a single PHP process, which behind a load balancer with multiple server instances effectively means an attacker can multiply the limit by the number of instances. This article compares in-memory storage, the generic cache adapter, and Redis as shared state, walks through the concrete configuration of RateLimiterFactory, and explains the practical difference between sliding window and token bucket policies.