Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

does no one know about _A tables anymore? This has been a solved thing since the 1970s


Can you elaborate? I've been coding since the 90s and have never heard the term _A table before.


sometimes called audit or journal tables.

Every time something is updated or deleted, the entire previous record is inserted into its corresponding _A table with who did it and when (and optionally for what transaction number)

so delete from foo results in an insert into foo_A before the delete occurs. so update to bar results in an insert into bar_A before the update occurs and rolling back a delete results in picking the old values out of the _A table and rolling back an update results in picking the old values out of the _A table and inserting the current values into the _A table before the updating the main table.


I guess there's plenty of technical solutions to track changes, like scd or snapshots or audit tables - what I find interesting about git approach it's that it's much more user-friendly vs. SQL archeology to understand what changed?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: