Contents
The auditing approach of pgMemento is nothing new. Define triggers to log changes in your database is a well known practice. There are other tools which can also be used. When I started the development for pgMemento I wasn't aware of that there are so many solutions out there (and new ones popping up every once in while).
If you prefer to work with validity intervals for each row try out the temporal_tables extension by Vlad Arkhipov or the table_version extension by Jeremy Palmer. This talk by Magnus Hagander goes in a similar direction.
If you like the idea of generic logging, but you prefer hstore over JSONB check out audit trigger 91plus by Craig Ringer. It does not provide functions to restore previous database state or to rollback certain transactions.
If you want to use a tool, that's proven to run in production for several years take a closer look at Cyan Audit by Moshe Jacobsen. Logs are structured on columnar level, so auditing can also be switched off for certain columns. DDL changes on tables are caught by an event trigger. Rollbacks of transactions are possible for single tables.
If you think the days for using triggers for auditing are numbered because of the new logical decoding feature of PostgreSQL you are probably right. But this technology is still young and there are not many tools out there that provide the same functionality like pgMemento. A notable implementation is Logicaldecoding by Sebastian R. Schmidt. pgaudit by David Steele is great for logging transaction metadata (not the data itself).
Contributors
- Felix Kunde (implementation, planning)
- Serge Latyntsev (extension, builds)
We would be very happy if there are other PostgreSQL developers out there who are interested in pgMemento and willing to help to improve it. Together we might create a powerful, easy-to-use versioning approach for PostgreSQL.
Special Thanks
- Lenz Weber, Maria Haubner & Mayflower team --> For using pgMemento in production
- Petra Sauer --> For support and discussions on a pgMemento research paper
- Hans-Jürgen Schönig --> recommend to use a generic JSON auditing
- Christophe Pettus --> recommend to only log changes
- Claus Nagel --> conceptual advices about logging
- Nikolai Lebedev --> feedback, discussion and sharing ideas
- Grant Bakker --> feedback and testing
- Ugur Yilmaz --> feedback and suggestions
- Maximilian Allies --> For setting up Travis yml script
- Steve --> coming up with the idea of a
session_info
field - Adam Brusselback --> benchmarking and bugfixing
- Franco Ricci --> bugfixing