@@ -139,8 +139,11 @@ coordinating Machine IDs in your deployment.
139139
140140Task is not trivial, but neither is impossible. Here are a few ideas:
141141
142- * Coordinate ID assignment via something like etcd _ or ZooKeeper _ using lease _
143- pattern. Optimal, but a bit bothersome to implement.
142+ * Coordinate ID assignment using:
143+ * Lease _ pattern (etcd _, ZooKeeper _)
144+ * Distributed locks:
145+ * Redlock _ (Redis _, Valkey _)
146+ * Advisory locks (PostgreSQL _, MariaDB _, etc...)
144147* Reinvent Twitter's SnowFlake _ by having a centralized service/sidecar. Extra
145148 round-trips SonyFlake intended to avoid.
146149* Assign Machine IDs manually. DevOps team will hate you.
@@ -174,10 +177,15 @@ should figure out on your own. Here's some numbers for you to start
174177
175178.. [# ] 1409529600 + 0x874AD4993 / 100 = 2026-03-05T09:15:19.87Z
176179 .. _UUIDv6 : https://www.rfc-editor.org/rfc/rfc9562.html#name-uuid-version-6
177- .. _etcd : https://etcd.io/
178- .. _ZooKeeper : https://zookeeper.apache.org/
180+ .. _Lease : https://martinfowler.com/articles/patterns-of-distributed-systems/lease.html
181+ .. _etcd : https://etcd.io/docs/v3.6/tasks/developer/how-to-create-lease/
182+ .. _ZooKeeper : https://zookeeper.apache.org/doc/r3.9.5/recipes.html#sc_recipes_Locks
183+ .. _Redlock : https://martin.kleppmann.com/2016/02/08/how-to-do-distributed-locking.html
184+ .. _Redis : https://redis.io/docs/latest/develop/clients/patterns/distributed-locks/
185+ .. _Valkey : https://valkey.io/topics/distlock/
186+ .. _PostgreSQL : https://www.postgresql.org/docs/current/explicit-locking.html#ADVISORY-LOCKS
187+ .. _MariaDB : https://mariadb.com/docs/server/reference/sql-functions/secondary-functions/miscellaneous-functions/get_lock
179188.. _SnowFlake : https://en.wikipedia.org/wiki/Snowflake_ID
180- .. _lease : https://martinfowler.com/articles/patterns-of-distributed-systems/lease.html
181189.. _LCG : https://en.wikipedia.org/wiki/Linear_congruential_generator
182190
183191Clock Rollback
@@ -215,7 +223,7 @@ above was that IDs lost its "monotonically increasing" property [#]_. Ofc, some
215223of our and other team's code were dependent on this SonyFlake's feature. Duh.
216224
217225Adding even more workarounds like pre-generate IDs, sort them and ingest was
218- a compelling idea, but I did not feel right. Hence, this library was born.
226+ a compelling idea, but it did not feel right. Hence, this library was born.
219227
220228.. [# ] E.g. if you cycle through generators with Machine IDs 0xCAFE and 0x1337
221229 You may get the following IDs: ``0x0874b2a7a0cafe00 ``,
0 commit comments