I(not a DBA) am considering designing Audit tables for an application that needs to be really fast as well fully audited (undo is not necessary). I referred to some from so and I found variations of the below
- Create an
insert
onlytable
with _to and _from and create a
view
from these. - Create an
Insert
only table with justlast_updated
. - Create a separate
Audit table
with both old and new values - Create a separate
Audit header table
andAudit Detail table
I am choosing the following option and reasoning:
3 . Separate table but a single per table audit table – and just have created_by, created_date, updated_by and updated_date columns
- because I think insert only table would create too many records and might slow down quickly considering it will be a hotspot data for my application.
- Views will still be slower since they are just stored queries?
- Separate Audit table would help be separate functionality and feels right.
- Separate Header/Details is too much of an overhead
My question is considering the characteristics of application please provide if this makes sense.
Best Answer
what database is this, make sure to check your DB if it has some inbuilt native solution. But still if you want to develop Audit part do consider