Scaling redirects to infinity on Vercel
Vercel introduces a Bloom filter-based redirect system that scales to millions of redirects with near-constant lookup latency, replacing sequential routing rules limited to 2,000 entries.
Redirects are trivial at a small scale, but at millions, latency and cost become real systems problems. Previously on Vercel, redirects were handled by routing rules and middleware. Routing rules support up to 2,000 complex redirects with wildcards, and they function as an ordered list evaluated in sequence. Each rule may involve regex matching, meaning a single request could trigger many expensive evaluations. This is acceptable for a few thousand routing rules, but as counts grow, per-request work increases linearly. Middleware offers more flexibility, but it adds latency by running extra code on every request.
To serve millions of redirects with low latency, we needed a dedicated lookup path with near-constant or logarithmic time per request. Building on our , we found a way to scale to millions of redirects.previous work to make global routing faster with Bloom filters With those goals in mind, we started with the simplest design we could think of, combining the redirects and Bloom filter in a single file. Since the redirect data was already JSON, and our Bloom filters already supported JSON exporting, we decided to use the JSONL file format to store this information. A Bloom…