Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

gitwithravish's avatar

Database Design : Timestamp column or saperate history table.

In case of database design requirement where it is required to record changes for records in an entity? For example,

-> Record changes the user make in his bank details

-> Price and quantity changes for a products.

As far as I know there are two possibilities here. I can add a timestamp column and add merge it with primary key. For example PRIMARY(product_id, timestamp). And another way is to create a product_history table.

What are the pros and cons of both approaches?

0 likes
1 reply

Please or to participate in this conversation.