search

Home  >  Q&A  >  body text

java - 请问大家在应用服务器集群下如何生成全局唯一且递增的流水号?

请问大家在应用服务器集群下如何生成全局唯一且递增的流水号?

PHP中文网PHP中文网2814 days ago399

reply all(3)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 17:56:39

    If it is not incremented, there is a solution based on machine code differentiation.

    It is to automatically or manually assign a globally unique machine ID to each server, using the "machine ID + local unique auto-increment" method to complete.

    But this does not meet the requirements of the topic.

    Another solution is to set up a server to complete the serial number service: serially generate a globally unique and incremental serial number.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:56:39

    If it is a server cluster, the database should be the same, so the above problem does not necessarily exist. Please also ask the author to describe the problem carefully.

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 17:56:39

    redis incr

    reply
    0
  • Cancelreply