Am having relational database MySQL. The requirement is to archive the records of few tables and their related records to be completely removed from the active database and archive it to access later if required. The web application is built on Rails BTW.
Is there a way, where any insertion or update on the original database is reflected to the archived database and deletions on original database are not updated to the archived database.
That way archived database has complete data both active and archived. And the original database has only live-accessible data.
Or is there any different and efficient solution. Why because, if we were to do brute force approach, by whenever the data moved to the archived database, all the records and their dependent records need to be identified and moved to the archived database and then remove the respective records in the original database.
With the Rails framework deleting the related and dependent records is relatively easy when dependent: :destroy is configured correctly.
Copyright License:
Author:「kishore」,Reproduced under the CC 4.0 BY-SA copyright license with link to original source & disclaimer.
Link to:https://stackoverflow.com/questions/62323810/database-archiving-with-full-database