Why sequenced? They could be guessed easily. How about something like Hashids that use the autoincrementing integer ID. That way you end up with a unique random string where you can determine the length and character set used, that is based on the ID. https://github.com/vinkla/hashids
Custom Sequence Number Generation for Order
Hello,
I have planned a custom sequence number generation for Order Id using MYSQL stored procedures.
Eg, Order id : ORD000001
Any other suggestion and tips.
And let me know if you have already did this in any other method.
Best Regards, Satz
@satz that is what I would do personally, then depending on who needs to see the Order ID you can show the appropriate one.
Some use cases/examples:
It is far easier to keep the auto incrementing IDs as the primary key for the purpose of setting up model relationships. But you add the HashIds field for let's say, external users, where you might want a constant length of 7 characters, so that it can be easily identified without confusion.
On your site/app you can use the HashId to find and search for orders, and as there is no apparent sequence to them they won't be able to be guessed (not easily anyway).
I have set up HashIds for timesheet management, user management. With regards to the timesheet, I use it so employees can call in and quote their 5-character alphanumeric timesheet ID. It is much easier to understand 5 distinct characters instead of potentially 5 numbers.
Please or to participate in this conversation.