We want to keep track of production data of a Rails app, so that we can analyse them in a few months.
To be more precise, we have a few data Models with a "status" and dates column that can change frequently. The idea is to write somewhere a new line in a DB or log file every time the status or any other attribute changes. These line consists in a copy of all the attributes for this object.
I see different solutions:
- using observer with after_save, and replicate the saved data to a reporting Mysql Db
- using a logger system.
- do it a different level, on the DB level, detecting changes in a table and copying the affected rows to the reporting DB.
It's easier to extract data then if they are stored in a DB. Log files are faster and don't slow down the process that much. I can't figure out what is the best way or if there is any other solution/implementation.