System Design - unique usernames
Problem: Keep usernames unique Single DB: pretty straight forward to have unique check on the column itself. What solutions can work for disturbuted systems?
Jordon Olive
Stealth
a year ago
If you just want to check if the username already exists in DB use a bloom filter. If you want to store it as well, use a DHT.
Sounds good. How will we store these? Reconstruction of bloom filters can be lengthy too.
Jordon Gabriel
Stealth
a year ago
In a sharded database. Use consistent hashing to know what’s stored in which shard.
You don’t have to do these from scratch pretty sure aws and other cloud providers have prebuilt services for these type of problems.
Kendall Carmden
Stealth
a year ago
Please don't make this another stack overflow.
Kendall Gabriel
Stealth
a year ago
Have a username database(not necessarily seperate from a current existing one) which stores username against a GUID. Then use this GUID as a secondary key everywhere else in database. Make sure uniqueness check is maintained in other databases as well.
DB will work well until we have single instance. How to handle it when we shard our database?
Discover More
Curated from across