This document summarizes Nikita Grishin's proposed versioning system for Graspeo. It discusses taking snapshots of items on each modification, with modifications to spaces generating new versions of the space and parents. Each file modification would create a new file version. Removing an item would only affect the space, keeping prior versions. Recovering old versions involves cloning them to the top of the version tree. It describes implementing origin IDs and version numbers to track item history and recover prior versions from the database.
5. Motivation
Every document management system
has the versioning.
Various resources from various locations
need to be tracked back
The collaborators system implies the
recovery system
7. • Mercurial, SVN/CVS!
• On document change, only modifications are saved
• Easy to track modifications
• Difficult to recover old versions
• Git
• On file change, new version of file is created
• Easy to recover old versions
• Difficult to track modifications
8. • Mercurial, SVN/CVS!
• On document change, only modifications are saved
• Easy to track modifications
• Difficult to recover old versions
• Git
• On file change, new version of file is created
• Pointer to the last version
• Easy to recover old versions
• Difficult to track modifications
Only for text documents.
Works very bad with media content.
10. • Snapshots: new version of document for each
modification
• Recovering the older version: creates a copy of the
asked version on the top of the last version
11. • Snapshots: new version of document for each
modification
• Recovering the older version: creates a copy of the
asked version on the top of the last version
• Some old versions can be removed by Google in
case of lack of space
12. • Snapshots: new version of document for each
modification
• Recovering the older version: creates a copy of the
asked version on the top of the last version
• Some old versions can be removed by Google in
case of lack of space
• Only users that can edit the document can see its
modification history
14. • Hard drive snapshots.
• Keeps:
• Hourly backups for last 24 hours
Apple TimeMachine
15. • Hard drive snapshots.
• Keeps:
• Hourly backups for last 24 hours
• Daily backups for the past month
Apple TimeMachine
16. • Hard drive snapshots.
• Keeps:
• Hourly backups for last 24 hours
• Daily backups for the past month
• Weekly backups until your backup drive is full.
Apple TimeMachine
17. • Hard drive snapshots.
• Keeps:
• Hourly backups for last 24 hours
• Daily backups for the past month
• Weekly backups until your backup drive is full.
• When your backup drive is full, TimeMachine
removes old backups to free space.
Apple TimeMachine
20. Graspeo versioning system solution
• Snapshots: new version of item for
each modification
• Any modification in Space
generates a new version of Space
and of all its parents
Versioning
21. Graspeo versioning system solution
• Snapshots: new version of item for
each modification
• Any modification in Space
generates a new version of Space
and of all its parents
• Each file modification creates a new
version of that file
Versioning
22. Graspeo versioning system solution
• Snapshots: new version of item for
each modification
• Any modification in Space
generates a new version of Space
and of all its parents
• Each file modification creates a new
version of that file
• File or Space removing affects only
space. The file itself stays in the
database
Versioning
23. Graspeo versioning system solution
• Snapshots: new version of item for
each modification
• Any modification in Space
generates a new version of Space
and of all its parents
• Each file modification creates a new
version of that file
• File or Space removing affects only
space. The file itself stays in the
database
• Recover the old version remains to
clone it and put on the top of versions
tree
Versioning
24.
25. How does it work?
• Each item has two new fields: originId and version
26. How does it work?
• Each item has two new fields: originId and version
• OriginId: id of the first version of item. It is used to track the
item modifications during the time. Is the same for all versions of
the item
27. How does it work?
• Each item has two new fields: originId and version
• OriginId: id of the first version of item. It is used to track the
item modifications during the time. Is the same for all versions of
the item
• Version: Value indicating the version number of the item.
28. How does it work?
• Each item has two new fields: originId and version
• OriginId: id of the first version of item. It is used to track the
item modifications during the time. Is the same for all versions of
the item
• Version: Value indicating the version number of the item.
• Path value represents now the logical path: it is constructed of
originId values (not id).
29. How does it work?
• Each item has two new fields: originId and version
• OriginId: id of the first version of item. It is used to track the
item modifications during the time. Is the same for all versions of
the item
• Version: Value indicating the version number of the item.
• Path value represents now the logical path: it is constructed of
originId values (not id).
• So now a query on path will return all children of all versions of
the item.
30. How does it work?
• New version of item contains the same data that the previous
version, except id and version fields:
• id field is completely new and unique
• version field is incremented by 1
31. How does it work?
• New version of item contains the same data that the previous
version, except id and version fields:
• id field is completely new and unique
• version field is incremented by 1
• Parents are updated recursively:
• New version of parent is created
• Subitems array of parent’s new version document is updated in
order to remove an id of previous version child
32. How does it work?
• GridFS is implemented in order to store all files versions.
• Every version of each file is stored in GridFS with its unique id
• Resource document has a field gfsId that references to the file
in GridFS
33. How does it work?
• GridFS is implemented in order to store all files versions.
• Every version of each file is stored in GridFS with its unique id
• Resource document has a field gfsId that references to the file
in GridFS
• On the file system, only the last version of file is present.
• When file’s version is updated, old version is removed from file
system storage and is replaced by the new version from GridFS
• Motivation: BitTorrent Sync, performance
36. Future Plans
• Implement versioning while removing items (end of this week)
• Create API for versions recovery (end of April)
37. Future Plans
• Implement versioning while removing items (end of this week)
• Create API for versions recovery (end of April)
• Create a front-end for versioning
38. Future Plans
• Implement versioning while removing items (end of this week)
• Create API for versions recovery (end of April)
• Create a front-end for versioning
• Implement versioning while using BTSync