views:

70

answers:

3

In my application people will upload resumes and they can update the resumes I am storing. The resumes use a file stream in a database. That is working fine. But now I want to track versions of the uploaded resumes to find the latest and previous resume.

What is the best way to do this?

+4  A: 

What I would do if I were you, would be to add a versionNumber column to the table, and when the "Update" their resume, I would just write a new entry to the database. You should then have a column called ResumeActive or something similar as a Bit field. just mark the most recent resume as the active and mark all the others as inactive.

Should they wish to rollback their resume to a previous version, just mark that as active and mark all the others as inactive. I hope this helps and that I understood your question correctly.

FailBoy
I think it would be simpler to have the MAX(versionNumber) be the active one. If they want to roll back to Version 8 from Version 10, then Version 11 is just a copy of Version 8.
A: 

You could also use a storage engine that is aware of document versions and this be able to not only track versions but also quickly switch between them and view differences. If you're using windows for your solution you could investigate Sharepoint ($) or Sharepoint Portal Services (free)

Conrad
A: 

Use a normal or binary diff, and on each change, store the result of the diff in the database, with the version number. So if a user wants to revert back, apply all the diffs upto that version. This will take up lesser space than storing each version of the whole file.

trex279