Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3390648
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T03:42:57+00:00 2026-05-18T03:42:57+00:00

Can you share your thoughts how would you implement data versioning in PostgreSQL. (I’ve

  • 0

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)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T03:42:58+00:00Added an answer on May 18, 2026 at 3:42 am

    I do something like your second approach: have the table with the actual working set and a history with changes (timestamp, record_id, property_id, property_value). This includes the creation of records. A third table describes the properties (id, property_name, property_type), which helps in data conversion higher up in the application. So you can also track very easily changes of single properties.

    Instead of a timestamp you could also have an int-like, wich you increment for every change per record_id, so you have an actual version.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone share your approach for doing a 'or' query in app-engine? Let say
I can't seem to find much information on the web about the different approaches
i want to make my app publish on my wall, i can post without
I have some HIGHLY sensitive data that I need to expose to Android and
I am going to use Entity Framework and WCF in my application. The suggested
For Web Applications I use Ruby on Rails. And now it's time to see
I was just wondering what are the pros and cons of using embedded images
I've been working with web-forms and I want to switch to the MVC pattern
So I know iOS apps run in a sandbox and all, but I thought
I'm looking for a way to easily port content driven applications from one mobile

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.