In mysql, there are several problems with using auto-increment columns (not least the fact that it does not scale for equivalent nodes).
Although you can support the sequence generator almost anywhere (memcache, files, database), PHP does not use the extended semantics of file locking - in addition to the performance impact, you can quickly find yourself in a transaction blocking situation. It does not scale to large volumes.
If you have PL / SQL available, I would recommend using a sequence generator there - as an alternative, you might consider creating a generator in PHP and sqlite.
I would highly recommend implementing your generator to create format numbers:
$ use_number = ++ $ sequence_number. str_pad ($ node_id, '0', $ max_nodes, STR_PAD_LEFT);
Where node_id is a number that uniquely references the storage substrate where the current sequence number is stored. And $ max_nodes is slightly larger than the maximum number of digits found in $ node_id (for example, 3 will allow up to 999 nodes).
Alternatively, consider it as a string with punctuation between two parts (and / or store 2 parts in different database columns).
FROM.
source share