Order management system - multiple data sources
Moderator: General Moderators
Order management system - multiple data sources
I am currently writing an order management system for a client of ours. They have 3 main sources of sales... and all of these sources can have their own "order number" or "invoice number" or what-have-you. I am having a hard time making a design decision on how I should manage this on the database level. I need to be able to sort all these orders by their source, as well as look them up by their source's order number. There is a possibility (although slight) that because of the multiple sources, I could end up with two orders with the same id. I'm not even going to tell you guys how I am doing it now, because I want to get un-tainted advice. My solution is proving to be very difficult to keep straight, and I just want some advice. Thanks! 
Re: Order management system - multiple data sources
Well first obvious solution sounds like you need composite PK, like PK(source_id, order_id ) or I didn't understand something.
Re: Order management system - multiple data sources
hmm... thats a good idea. right now I have a combined unique key for "source_id" and "source_order_id" but it is not the PK. I have an standard id PK field. I'll play around with that idea.