Question

I'm working on building a webapp and received a partial database schema. Some of the tables have datestamp columns to keep track of when the record was last updated.

My question is twofold: what is/are the purpose(s) or benefit(s) of tracking when a record was updated, and when should it be done?

Thanks

Was it helpful?

Solution

You would want an "updated_at" column if a user wants to sort or filter by when a row was last updated.

Look at Google Drive's main listing window. There is a column "Last Modified" that you can sort on, to look at documents that you most recently modified. You would need a database column with the last modified date to be able to sort by that value.

Another example is an API where API users only want to download new information, so they could filter (using a WHERE clause) for records that had changed only since their last download.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top