March 3, 2010 at 3:01 am
Hi, I am looking for best practice for the following design problem:
As an example: In an order processing DB I have customers, addresses, orders, and products shipped. Having normalised my data I have addresses related to customers, and orders related to customers and addresses so that a customer can have many addresses and the order has one of those as a ship to.
What is considered the best practice for locking this information in so that post shipment changes in the linked address do not change the archive data for where the order was shipped?
Solutions could be:
1) Do not allow addresses to be edited but create a new one when changes happen and 'archive' the previous, or
2) Record the address detail (as opposed to the link) in the order table.
To my mind both have pros and cons. What is considered best practice for this sort of problem?
tx
Jim
March 3, 2010 at 3:58 am
Second option is better, this will make things simpler.
But still you need to work on issue addresses history. You can soft delete old records by adding auditing fields to the table (like isdeleted, delete date etc) and making only one record as a active or you can archive those records to history table keeping only last record to the main address table.
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply