Skip to content
EID is a service for generating unique ID numbers at high scale.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Earnstone Unique ID Generator


EID is a service for generating unique ID numbers at high scale with some simple guarantees (based on the work from The service can be in-memory or run as a REST-ful web service using Jetty. The main differences between Snowflake and EID are

  • Java vs Scala - Our company uses Java.
  • REST Server vs Thrift Server - With a simple REST-ful interface we can access the service from anywhere without the need to generate thrift bindings. We are willing to sacrifice raw speed for usability. We are still able to generate 4K ids/sec per machine on our development hardware. If speed is a concern then look at using the in-memory version of EID.
  • No Zookeeper dependency - Zookeeper is great, but someone can mis-configure the Zookeeper location generating the same unqiue ids. Removing the dependancy puts more responsibility on the person configuring the EID services. So be careful when configuring the data center and worker ids.


How to Use EID

Extract the files and start/stop the server using the following commands

Usage: [-d] {start|stop|run|restart|check|supervise} [ CONFIGS ... ] 
$./bin/ start
$./bin/ stop

To check on the server status or manually generate unique ids navigate to http://localhost:43120

Example of how to use the REST interface to generate remote ids

// import com.sun.jersey.api.client.Client;
// import com.sun.jersey.api.client.WebResource;
Client c = Client.create();
WebResource r = c.resource("http://localhost:43120/nextId");
String idStr = r.get(String.class);
long id = Long.parseLong(idStr);

For multi-machine configuration make sure to change the data center and worker ids located in ./config/

You can’t perform that action at this time.