Update: Hello HN!, Please use this for discussion
In a distributed storage environment you may no longer generate IDs in traditional ways. You need a fast service that generates IDs, which, given constraints such as bit size, isn’t obvious to build.
Twitter’s Snowflake does it following a set of their own constraints, but given more lenient constraints there are other ways such as compositing an ID with a time component and random jitter. There are also important risks and guarantees to take into consideration.
Parting Ways with Auto Increments
You want to generate IDs when you’re working in a sharded setup; in which non of the shards can take responsibility for generating IDs on its own.
Further, you might want an independent service or component to be responsible for ID generation, in a complex transactional usecases, where multiple systems might be affected.
In other cases you’ll want to perform intricate tracking which requires generation at the client side, or far from the server.