notexOPENOverview
Notex/Systems/Design a unique ID generator in distributed systems

Design a unique ID generator in distributed systems

Always free to read

In this chapter, you are asked to design a unique ID generator in distributed systems. Your first thought might be to use a primary key with the auto_increment attribute in a…

079 LESSONS · 10 MIN
  1. 07.01Design a unique ID generator in distributed systemsIn this chapter, you are asked to design a unique ID generator in distributed systems. Your first thought might be to use a primary key with the auto_increment attribute in a…READING1 MIN
  2. 07.02Step 1 - Understand the problem and establish design scopeAsking clarification questions is the first step to tackle any system design interview question. Here is an example of candidate-interviewer interaction: Candidate: What are…READING1 MIN
  3. 07.03Step 2 - Propose high-level design and get buy-inMultiple options can be used to generate unique IDs in distributed systems. The options we considered are: Multi-master replicationUniversally unique identifier (UUID)Ticket…READING1 MIN
  4. 07.04Multi-master replicationAs shown in Figure 7-2, the first approach is multi-master replication. This approach uses the databases’ auto_increment feature. Instead of increasing the next ID by 1, we…READING1 MIN
  5. 07.05UUIDA UUID is another easy way to obtain unique IDs. UUID is a 128-bit number used to identify information in computer systems. UUID has a very low probability of getting…READING1 MIN
  6. 07.06Ticket ServerTicket servers are another interesting way to generate unique IDs. Flicker developed ticket servers to generate distributed primary keys [2]. It is worth mentioning how the…READING1 MIN
  7. 07.07Twitter snowflake approachApproaches mentioned above give us some ideas about how different ID generation systems work. However, none of them meet our specific requirements; thus, we need another…READING1 MIN
  8. 07.08Step 3 - Design deep diveIn the high-level design, we discussed various options to design a unique ID generator in distributed systems. We settle on an approach that is based on the Twitter snowflake…READING2 MIN
  9. 07.09Step 4 - Wrap upIn this chapter, we discussed different approaches to design a unique ID generator: multi-master replication, UUID, ticket server, and Twitter snowflake-like unique ID…READING1 MIN

References

Step 4 - Wrap up
  1. Universally unique identifier: https://en.wikipedia.org/wiki/Universally_unique_identifier
  2. Ticket Servers: Distributed Unique Primary Keys on the Cheap: https://code.flickr.net/2010/02/08/ticket-servers-distributed-unique-primary-keys-on-thecheap/
  3. Announcing Snowflake: https://blog.twitter.com/engineering/en_us/a/2010/announcingsnowflake.html
  4. Network time protocol: https://en.wikipedia.org/wiki/Network_Time_Protocol
KEEP EXPLORING

One note leads to another.

Back to the library →
⌕
Search across the entire library ⌘ K