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 30665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T13:29:01+00:00 2026-05-10T13:29:01+00:00

We have a requirement in project to store all the revisions(Change History) for the

  • 0

We have a requirement in project to store all the revisions(Change History) for the entities in the database. Currently we have 2 designed proposals for this:

e.g. for ‘Employee’ Entity

Design 1:

-- Holds Employee Entity 'Employees (EmployeeId, FirstName, LastName, DepartmentId, .., ..)'  -- Holds the Employee Revisions in Xml. The RevisionXML will contain -- all data of that particular EmployeeId 'EmployeeHistories (EmployeeId, DateModified, RevisionXML)' 

Design 2:

-- Holds Employee Entity 'Employees (EmployeeId, FirstName, LastName, DepartmentId, .., ..)'  -- In this approach we have basically duplicated all the fields on Employees  -- in the EmployeeHistories and storing the revision data. 'EmployeeHistories (EmployeeId, RevisionId, DateModified, FirstName,        LastName, DepartmentId, .., ..)' 

Is there any other way of doing this thing?

The problem with the ‘Design 1’ is that we have to parse XML each time when you need to access data. This will slow the process and also add some limitations like we cannot add joins on the revisions data fields.

And the problem with the ‘Design 2’ is that we have to duplicate each and every field on all entities (We have around 70-80 entities for which we want to maintain revisions).

  • 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-10T13:29:01+00:00Added an answer on May 10, 2026 at 1:29 pm
    1. Do not put it all in one table with an IsCurrent discriminator attribute. This just causes problems down the line, requires surrogate keys and all sorts of other problems.
    2. Design 2 does have problems with schema changes. If you change the Employees table you have to change the EmployeeHistories table and all the related sprocs that go with it. Potentially doubles you schema change effort.
    3. Design 1 works well and if done properly does not cost much in terms of a performance hit. You could use an xml schema and even indexes to get over possible performance problems. Your comment about parsing the xml is valid but you could easily create a view using xquery – which you can include in queries and join to. Something like this…
    CREATE VIEW EmployeeHistory AS , FirstName, , DepartmentId  SELECT EmployeeId, RevisionXML.value('(/employee/FirstName)[1]', 'varchar(50)') AS FirstName,    RevisionXML.value('(/employee/LastName)[1]', 'varchar(100)') AS LastName,    RevisionXML.value('(/employee/DepartmentId)[1]', 'integer') AS DepartmentId,  FROM EmployeeHistories  
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 74k
  • Answers 74k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer What I've learned is that there is no experimental code,… May 11, 2026 at 2:17 pm
  • added an answer You don't need any speciall interfaces for your object. In… May 11, 2026 at 2:17 pm
  • added an answer If the file contains Ruby code, change the extension to… May 11, 2026 at 2:17 pm

Related Questions

We have a requirement to increase the functionality of a grid we are using
We have a requirement to generate PDF documents using information from a PDA /
We have a requirement for people to be able to look at documents people
We have the requirement to take a form submission and save some data, then
Premise : The requirements for an upcoming project include the fact that no one
I believe several of us have already worked on a project where not only
We're writing a records management product for schools and one of the requirements is
I'm working on a web app project (in java; not that it matters) and

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.