eChat

Categories => Technology & Gadgets => Topic started by: Swati on Apr 17, 2026, 02:14 PM

Title: How Gmail checks username availability instantly (billions of users)
Post by: Swati on Apr 17, 2026, 02:14 PM
(https://i.ibb.co/vCPH40dX/d5mlatz5eovg1.png)
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Rajendra on Apr 17, 2026, 02:14 PM
Conditional if  (just being sarcastic)
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Yash on Apr 17, 2026, 02:14 PM
The username disappears before you even finish typing it.
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Sarika on Apr 17, 2026, 02:14 PM
Usually they use Bloom filters.
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Pooja on Apr 17, 2026, 02:14 PM
Bloom filter.
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Himani on Apr 17, 2026, 02:14 PM
Bloom filters or tries.
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Nitin on Apr 17, 2026, 02:14 PM
I search anything on Google and the results show up in about a second, even though there are trillions of data sources across the web.
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Sneha on Apr 17, 2026, 02:14 PM
Not millions, billions of accounts.
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Kavitha on Apr 17, 2026, 02:14 PM
1] Indexed database
2] Hashing
3] Distributed systems like Google Spanner

These make lookup possible in O(log n), insanely fast.

Bonus:
They cache hot usernames - popular ones and recent queries.

All of this together makes it possible.
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Harini on Apr 17, 2026, 02:14 PM
Many comments have already mentioned Bloom filters, but that's only part of the picture since they can tell if a username definitely doesn't exist. They can give false positives, saying a username may exist, so they're used as a fast pre‑check, not the final source of truth. There's a ByteMonk video https://youtu.be/_l5Q5kKHtR8 that explains this flow in detail - a must‑watch for me.
Title: Re: How Gmail checks username availability instantly (billions of users)
Post by: Shashi on Apr 17, 2026, 02:14 PM
Bloom filter.