What is the best practice for storing metadata of individual records in a database?
I need to store common meta data such as creation time and time of last update for many tables in my database. I found a few different solutions:
Store the meta data directly in the tables.
Pros:
- Meta data is directly linked to records
- No joins are required to retrieve meta data
Cons:
- A lot of duplicate columns are required (unless inheritance is used)
- Meta data and business data are not separated
Create a general meta data table with and use soft foreign keys to link data to the correct tables and records.
Pros:
- No duplication of columns
- Meta data is separated from business data
Cons:
- No direct links between meta data and data (FK's can't be used)
- Joins require an additional condition
Create individual meta data tables for each table requiring meta data.
Pros:
- Meta data is directly linked to records
- Meta data is separated from business data
Cons:
- A lot of extra tables are required
- A lot of duplicate columns are required (unless inheritance is used)
Are there more options, pros or cons than the ones I mentioned here? And what is the best practice for storing this meta data?