mirror of
https://github.com/chai2010/advanced-go-programming-book.git
synced 2025-05-24 12:32:21 +00:00
add diagram for dist id
This commit is contained in:
parent
3e3a85291a
commit
ee85198e7f
@ -0,0 +1,26 @@
|
||||
# 6.7. 分布式 id 生成器
|
||||
|
||||
```
|
||||
|
||||
datacenter_id sequence_id
|
||||
unused
|
||||
│ │
|
||||
│ │ │
|
||||
│ │ │
|
||||
│ │ │ │ │
|
||||
│ │ │ │ │
|
||||
▼ │◀────────────────── 41 bits ────────────────────▶│ ▼ ▼
|
||||
┌─────┼──────────────────────────────────────────────────────┼────────┬────────┬────────────────┐
|
||||
│ 0 │ 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0 │ 00000 │ 00000 │ 0000 0000 0000 │
|
||||
└─────┴──────────────────────────────────────────────────────┴────────┴────────┴────────────────┘
|
||||
▲ ▲
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
│ │
|
||||
|
||||
time in milliseconds worker_id
|
||||
|
||||
```
|
Loading…
x
Reference in New Issue
Block a user