1. method 2 of using the MySQL auto-increment field is not accepted. in high concurrency, make sure that the unique increment is 3. using C language to compile PHP extensions does not count first. Thank you! 1. the method of using the MySQL auto-increment field is not accepted.
2. Ensure high concurrency
Unique Increment
3. Using C language to write PHP extensions is not counted
Thank you!
Reply content:
1. Do not accept the use of MySQL auto-increment Fields
2. Ensure high concurrencyUnique Increment
3. Using C language to write PHP extensions is not counted
Thank you!
Refer to the ObjectID algorithm of MongoDB. You can consider including the following parts in the ID to prevent conflicts.
- Machine hash (preventing ID conflicts between multiple machines)
- Process ID (preventing multi-process conflicts)
- Timestamp (SEC)
- Auto-increment value (auto-increment in the same second)
Putting the time at the most meeting can achieve a basically increasing effect
UUID1 effect similar, PHP has ready-made implementation of https://github.com/ramsey/uuid
Incremental. please sort the requests.