antirez/redis — pull request #610 by pyr (2012-07-30 10:50:19+00:00)
Title: Now that sentinel is coming along I'd like to reintroduce this PR

it operates in the same cluster ordering space (though it is
orders of magnitude simpler). For simple setups avoid the
installation of snowflake or similar tools has a lot of merit.

This was the original PR text:

This is similar to what snowflake and the recent boundary
solution do, but it makes sense to use redis for that type
of use cases for people wanting a simple way to get
incremental ids in distributed systems without an additional
daemon requirement.

Unique IDs are composed as follows:

epoch seconds: 4 bytes
epoch mseconds: 4 bytes
host name: 6 bytes
sequence id: 2 bytes
host name is truncated to 6 chars, so the appropriate config
directive id-generation-name should be set on each machines
wanting to yield ids if truncating hostname do 6 chars does
not suffice.