Version Store

cancel
Showing results for 
Search instead for 
Did you mean: 

Version Store

resplin
Intermediate
0 0 3,427

Obsolete Pages{{Obsolete}}

The official documentation is at: http://docs.alfresco.com



VersioningDesign Document3.0
NOTE: This functionality is available since Alfresco 3.0.


Project Overview


The design of the underlying Alfresco DM version store has not changed since the original releases of Alfresco ECM.  The store is also known as the 'lightWeightVersionStore'.  The primary goal for this project is to refactor the storage mechanism and implement a 'lighter' version store !  This should increase performance and reduce disk usage (both in terms of DB metadata and lucene index size, if indexing is configured).  A secondary goal is to also provide a migration path for existing version metadata.  There are no immediate plans to change the version store API as part of this refactor.


Version API


The current API remains unchanged. In summary, the API methods include:


  • createVersion
  • getVersionHistory
  • getCurrentVersion
  • deleteVersion
  • deleteVersionHistory
  • deleteVersion (since 3.1)
  • restore
  • revert
  • getVersionStoreReference
  • registerVersionLabelPolicy

Version Model / Store


Previous model


This model is used in Alfresco 1.x, 2.x (and also Labs 3a).

Refer to version_model.xml

The previous model caused a large increase in the number of nodes/properties, when creating each 'version' node and associated model structure.  For example, each versioned property was exploded into a separate 'ver:versionedProperty' node.

The 'workspace://lightWeightVersionStore' uses the version1 store implementation.


New model


This model is used in Alfresco 3.x (since Labs 3b).

Refer to version2_model.xml

The new model creates a version copy of the existing the node.  The node's properties and child associations are versioned as standard properties and child associations within the version store (they are no longer exploded out into a separate meta model).  Note: the auditable properties (creator, created, modifier, modified) are treated as a special case.

The 'workspace://version2Store' uses the version2 store implementation.


Performance and Sizing


The primary goal for this phase is to refactor the storage mechanism to decrease version store size (DB size and lucene index size, if configured) and increase version store performance.


Lucene indexing


Lucene indexing is not configured by default for the version store(s) (for releases 2.1.6, 2.2.2, 3.1.1, 3.2.0 and higher). For example:





    <bean id='indexerAndSearcherFactory' class='org.alfresco.repo.service.StoreRedirectorProxyFactory'>
        <property name='proxyInterface'>
            <value>org.alfresco.repo.search.impl.lucene.LuceneIndexerAndSearcher</value>
        </property>
        <property name='defaultBinding'>
            <ref bean='admLuceneIndexerAndSearcherFactory'></ref>
        </property>
        <property name='redirectedProtocolBindings'>
            <map>
                <entry key='workspace'>
                    <ref bean='admLuceneIndexerAndSearcherFactory'></ref>
                </entry>
                <entry key='avm'>
                    <ref bean='avmLuceneIndexerAndSearcherFactory'></ref>
                </entry>
            </map>
        </property>
  <property name='redirectedStoreBindings'>
            <map>
                <entry key='workspace://lightWeightVersionStore'>
                    <ref bean='admLuceneUnIndexedIndexerAndSearcherFactory'></ref>
                </entry>
                <entry key='workspace://version2Store'>
                    <ref bean='admLuceneUnIndexedIndexerAndSearcherFactory'></ref>
                </entry>
            </map>
        </property>
    </bean>

Unit Tests


Examples of unit tests that exercise the VersionService include:


  • org.alfresco.repo.version.VersionTestSuite
  • org.alfresco.repo.coci.CheckOutCheckInServiceImplTest
  • org.alfresco.repo.model.ModelTestSuite (>= 3.3) or org.alfresco.repo.model.ml.MultilingualTestSuite (