ChaiPoha
ChaiPoha

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?

17mo ago
its_a_me_mario
its_a_me_mario

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.

ChaiPoha
ChaiPoha

Sounds good. How will we store these? Reconstruction of bloom filters can be lengthy too.

its_a_me_mario
its_a_me_mario

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.

Twitter
Twitter

Please don't make this another stack overflow.

FamousCoil13
FamousCoil13

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.

ChaiPoha
ChaiPoha

DB will work well until we have single instance. How to handle it when we shard our database?

Discover more
Curated from across
Shaktiman24
Shaktiman24Stealth11mo

Ways to login a user?

What are some ways to do a mobile number login of a user without asking OTP. Apart from these are there any other methods?

  • Truecaller Login
  • WhatsApp Login

Please share any jugads if you know !

AmbiguousChaos
AmbiguousChaosLaid off19mo

Flash sale | System Design

Just curious if we have to design some sort of flash sale. For example: let's say 100 iPhones at discounted price for window or may be booking tatkal on irctc.

Will it be good Design to serve the read from the replicas and during the pa...