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

  • SEARCH
  • Home
  • 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 128769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:41:17+00:00 2026-05-11T05:41:17+00:00

I have a requirement to build ‘versioning’ into an application and was wondering how

  • 0

I have a requirement to build ‘versioning’ into an application and was wondering how best to approach it.

I have this general pattern:

Model A has many B’s

Where on update the attributes of A need to be versioned and its associated objects (B’s) also need to be versioned. So the application will display the current version of A, but it must also be possible to view previous versions of A and its associated objects.

I would like to use a document store however this is only a portion of the application and having a doc store and a relation database would introduce more complexity.

I have considered using a star schema, but before I progress I was wondering if there is a design pattern floating around tackling this problem?

This question is slanted towards resolving the issue of storing the versions of an associated object in a relational database. Where there is an inherent need to be able to effectively query the data (ie serializing object won’t suffice).

Update: What I was thinking/have implemented but want to see if the is ‘a better way’

,---------. 1      * ,--------. | Model A |----------| Model B| `---------'          `--------' |PK       |          | a_id   | |b_version|          |version | |version  |          `--------' `---------' 

Where I would be duplicating model A and all the associated B’s and incrementing the version attribute. Then doing a select to join the B’s via b_version and b.version. Just wondering if this can be done better.

  • 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. 2026-05-11T05:41:18+00:00Added an answer on May 11, 2026 at 5:41 am

    I don’t think there is no specific GoF design pattern per se for versioning because there exists many implementations of it.

    The most simple implementation of versioning is a linked list of objects. Where each node in the list is a new revision of whatever the versionable object is. To save space you also implement some kind of a diff that shows what the difference is between the revisions. That way you can store diffs in the database, but also the final version of the versionable object since the version control system should be able to derive the versions in between.

    The database schema could principally look something like this (you can see this pattern in most wiki systems):

    +--------------------+ 1     * +-----------------------------+ | VersionableObject  |---------| Diff                        | +--------------------+         +-----------------------------+ | lastStateContent   |         | difference                  | | originalAuthor     |         | revision                    | | #dates and whatnot |         | # userId, dates and whatnot |       +--------------------+         +-----------------------------+ 

    If you want to go hardcore with branching and stuff you might want to consider have a look at DAG which is what modern distributed version control systems use.

    Now if we talk about your example a whole slew of objects that needs to be saved in configurations. I.e. we have to pick out the revisions of objects that we want for the model. It means we have a many to many relationship (which is solved with an intermediary table), sort of like this:

    +---+ 1   * +---------------+ 1   * +-----------------+ *   1 +-------+ | B |-------| Diff          |-------| ModelSelection  |-------| Model | +---+       +---------------+       +-----------------+       +-------+             | revisionNo    |       | {PK} configId   |             | {FK} configId |       | {FK} modelId    |             +---------------+       +-----------------+ 

    I hope this helps.

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

Sidebar

Related Questions

I have a requirement to build an application that a company can use to
My Application can perform 5 business functions. I now have a requirement to build
I am using Asp.net/C# to build an application , i have a requirement wherein
I have a requirement to build a slightly unusual data model, but I'm having
I have a requirement for my MAVEN build to pick a single jar from
I am planning to build compiler for Requirement Specification Language. I have come up
I have requirement to disable copy/paste/cut operations on a textbox. For this purpose I
I have requirement as following like showing ABPeoplePickerNavigationController in tabbar based application. I researched
I have a requirement to build a Business Rule Engine. I use the SQL
I have a requirement for a Tree grid or Tree list control. This is

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.