KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Can you share your thoughts how would you implement data versioning in PostgreSQL. (I've asked similar question regarding Cassandra and MongoDB . If you have any thoughts which db is better for that please share) Suppose that I need to version records in a simple address book. Address book records are stored in one table without relations for simplicity. I expect that the history: will be used infrequently will be used all at once to present it in a "time machine" fashion there won't be more versions than few hundred to a single record. history won't expire. I'm considering the following approaches: Create a new object table to store history of records with a copy of schema of addressbook table and add timestamp and foreign key to address book table. Create a kind of schema less table to store changes to address book records. Such table would consist of: AddressBookId, TimeStamp, FieldName, Value. This way I would store only changes to the records and I wouldn't have to keep history table and address book table in sync. Create a table to store seralized (JSON) address book records or changes to address book records. Such table would looks as follows: AddressBookId, TimeStamp, Object (varchar). Again this is schema less so I wouldn't have to keep the history table with address book table in sync. ( This is modelled after Simple Document Versioning with CouchDB )
Tags (comma-separated)
Save Edits
Cancel