Designing Authentication for 100 Million Users with Bloom FiltersDesigning Authentication for 100 Million Users with Bloom Filters
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started
System Design: Scaling Authentication to 100 Million Users
How would I design a login system for an application with 100 million registered users?
I'd start with the fundamentals: indexed database lookups, connection pooling, rate limiting, secure password hashing, and measurable latency targets.
Then I'd investigate whether a probabilistic data structure could reduce unnecessary database traffic.
The approach: Bloom Filter pre-check
A Bloom Filter can quickly identify usernames that are definitely absent from the registered-user set.
For 100 million entries with a target false-positive rate of 1%: - Raw bit-array memory: approximately 114 MiB - Optimal number of hash functions: approximately 7 - False positives: possible - False negatives: none under correct initialization and maintenance
Proposed request flow Login Request → Bloom Filter → Indexed User Lookup → Password Verification → Session Issuance
If a username is definitely absent, the system can avoid a database lookup. If it might exist, the request proceeds through the normal authentication process.
Production considerations: - Maintain filter consistency as users are created or deleted. - Prevent account enumeration through error messages and timing differences. - Apply rate limits and abuse detection. - Benchmark database latency and password-hashing throughput under realistic peak traffic. - Add caching, replicas, or sharding only when measured bottlenecks justify them.
The key takeaway: 100 million registered users alone does not determine the architecture. Peak login traffic, request distribution, latency requirements, and database capacity do.
A Bloom Filter is an optimization for a specific bottleneck, not a replacement for a properly designed authentication system.
Post image
Back to feed
The network for creativity
Join 1.25M professional creatives like you
Connect with clients, get discovered, and run your business 100% commission-free
Creatives on Contra have earned over $150M and we are just getting started