java - 请问大家在应用服务器集群下如何生成全局唯一且递增的流水号?
PHP中文网
PHP中文网 2017-04-17 17:54:39
0
3
340

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

PHP中文网
PHP中文网

认证高级PHP讲师

reply all(3)
洪涛

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.

Ty80

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.

左手右手慢动作

redis incr

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!