I'm building an inventory system which requires unique keys for orders,
customers, etc. across multiple stores (and therefore servers). Originally
I used the UUID key generator.. which works fine but alas is rather user
unfriendly with its 30 digits etc.
I'm thinking of extending the HighLow generator such that it retrieves an
index as per normal then pre-pends it with a specified prefix set as an
attribute to the keygenerator statement in the mapping file. The prefix
would be set to reflect the store or server id at deployment and would serve
to ensure keys generated on different servers are unique across all servers
while keeping the size of the code small enough to be memorable by users.
The resulting code for a Customer object might be: 'CA0000001' or
'CB0000001' for stores A and B or perhaps '10000001' or '20000001' should an
integer result be required.
This would allow ids to be more meaningful for users of the system, ensure
uniqueness (assuming appropriate setup) and allow orders, etc.. to be traced
to the store they were created on.
I'm just wondering if: 1)anyone has done this already, 2)if there's a better
way, 3)how to register a new key generator with Castor, 4)are there other
Castor related technical issues I need to be aware of.
Thanks in advance for your advice.
Jon
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev