Platformatic Gateway now includes request deduplication to solve the thundering herd problem. When many concurrent requests hit the same uncached route, only one request goes upstream while the rest wait and receive the same response. The feature uses a leader/waiter model with configurable storage (in-memory or Valkey for horizontal scaling), route whitelisting, custom key functions, and TTL-based deadlock prevention. Benchmarks show 10,000 requests reduced to just 100 upstream calls. Built-in metrics (leader, waiter, replay, fallback counts) let teams verify production impact. Particularly useful for self-hosted Next.js apps handling cache-cold traffic spikes.

10m read timeFrom blog.platformatic.dev
Post cover image
Table of contents
A Local BenchmarkHow It WorksThe Simplest ConfigurationPer-Application OverridesChoosing The Deduplication KeyRoute WhitelistingStorage: Memory Or ValkeyOperational BehaviorCustom Gateway HandlersMetricsConclusion
131 Impressions