A solution to generating unique identifiers for distributed high concurrency

method one:

   Also generates a unique identifier (36-bit) based on the UUID that comes with Java

 

Method Two:

   The unique ID is generated by the Snowflake algorithm. The SnowFlake algorithm is an algorithm designed by Twitter to generate a unique ID in a distributed system. It can meet Twitter's request for tens of thousands of message ID allocation per second. These message IDs are unique and There is roughly an increasing order.

 

Method three:

    It is realized through the database, such as building 5 database tables, test1, test2, test3, test4, test5, the starting value of each table is 1, 2, 3, 4, 5. . n, the growth step size of each table is set to n. This method is to generate a unique self-increment sequence. If it is convenient for future expansion, start to build more tables.

 

Method four:

     Obtain the system-level unique identifier through the incl method of redis.

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327036829&siteId=291194637