A PostgreSQL-based database changes logger for Rails applications, storing version history in a JSONB column using triggers.
Logidze is a Ruby gem for Rails applications that logs database record changes using PostgreSQL triggers. It stores the entire version history in a JSONB column within the same table, providing an API to browse, diff, and revert changes. It solves the need for efficient and integrated change auditing without requiring separate audit tables.
Rails developers building applications that require detailed audit trails, version history, or the ability to revert records to previous states, particularly those already using PostgreSQL.
Developers choose Logidze for its performance (database-level triggers), simplicity (no extra tables), and seamless Rails integration. It offers a more efficient alternative to gems like Audited or PaperTrail by storing logs inline and providing a rich time-travel API.
Database changes log for Rails
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses PostgreSQL triggers for database-level logging, which benchmarks show is faster than application-level gems like PaperTrail, reducing overhead.
Stores version history in a JSONB column within the same table, eliminating the need for separate audit tables and simplifying queries.
Provides ActiveRecord-integrated methods like #at, #undo!, and #diff_from for easy version browsing, reverts, and diffs without custom code.
Allows attaching metadata such as user IDs or IP addresses to changes via Logidze.with_meta, enhancing audit trails.
Heavily relies on PostgreSQL features like JSONB and triggers, making it incompatible with other databases like MySQL or SQLite.
Requires switching to SQL schema dumps or adding the fx gem for schema.rb compatibility, which can complicate deployment and team workflows.
Does not track changes after record deletion, as admitted in the README, requiring separate soft-delete solutions for full audit history.