Archiving Voided Data
In OpenMRS, "voiding" soft-deletes records, causing tables especially immutable ones like Observations (obs) to accumulate massive amounts of inactive data over time. This unbounded growth degrades system performance and complicates database maintenance. This project implements a "Real-Time Archival Trigger" to maintain lean primary tables. When a record is voided, a Hibernate interceptor will execute an atomic transaction to immediately copy the data to a dedicated obs_archive table and hard-delete it from the active table. To manage the infinite growth of the archive, a scheduled background JobRunr task will permanently purge expired records by dropping old partitions from the archive table based on configurable retention policies (e.g., after 7 years).
Project details
Technologies
Not listed in the archive