We have a use-case where we need to replicate the orders for a merchant in run-time in our database. We plan to use a combination of orderId and modifiedTime(of the order) to keep track of the changes in the order. We have thought of an approach mentioned below. Please provide your feedback in this approach and suggest any better approach you may think of.
So, our primary key will be orderId,modifiedTime for which we will store all the details of the order. We will keep on polling orders on a regular basis. If we find that for an existing order we have higher modifiedTime timeStamp then we will delete the existing order details and insert the new order details.