Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

An identifier generator inspired by Twitter Snowflake, but focuses on easy decentration and intergration with Hibernate.

Notifications You must be signed in to change notification settings

hanzhao/hibernate-snowball-id-generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hibernate Snowball ID Generator

Snowball is an identifier generator inspired by Twitter Snowflake, but focuses on easy decentration and intergration with Hibernate in a local network. Snowball generates unique, increasing id in different machines.

Format

The identifiers that Snowball generates are 64-bit intergers, and format like:

|--- unused[1] ---|--- timestamp[41] ---|--- worker[10] ---|--- sequence[12] ---|

The 41-bit timestamp ranges from Twitter epoch(2010-11-04T01:42:54.657Z) to 2080-07-10T17:30:30.208Z. And that 10-bit worker id is generated by low 10-bits of ip address. The 12-bit sequence number limits that no more than 4096 identifiers can be generated in 1 milliseconds.

License

The MIT License.

About

An identifier generator inspired by Twitter Snowflake, but focuses on easy decentration and intergration with Hibernate.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages