Motivation

Modern web applications are polyglot and they are deployed on multiserver environments. Ids are used on DBMS, including NoSQL systems, server-side applications and web browsers.

UUIDs are safe and quick but they are not handy on databases and on browsers. Also, UUIDs are usually not ordered. Twitter Snowflake is an excellent solution but it is designed to fulfill specific requirements and to fit to Twitter’s architecture. For instance, it includes a Thrift Server, it is configured by Zookeper and its ids are consstructed according to a defined format.

In consideration of the above premises, a 64-bit id solution seems convenient for databases and server-side applications. Web browsers, on the contrary, as JavaScript represents numbers according to the IEEE 754 standard, don’t handle well 64-bit integers. For browsers, a decent string representation of the ids could be a useful.

To conclude, the targets if this library are summarized below:

Fork me on GitHub