Split Apache OAK stores

Split Apache OAK stores


One of big projects drawbacks is a size of Apache OAK which is growing very fast due to big amount of assets , binary files, background processes which are care about repository data consistency, updates and so on. Of cause we can use compaction every week but there is exists another approach – split segment and blob store out of Tar files (which is an OOTB store implementation). One of the available option is to split NodeStore and BlobStore. More about BlobStore you can read here – click.

It’s time to split your Apache OAK repository stores (NodeStore and BlobStore) if:

  1. Apache OAK size growing unexpectedly very fast  due to big amount of assets
  2. you decided to improve your local repository speed and decrease memory consumption
  3. other (if you know what you are doing)

Steps for split

As an example we will use AEM 6.1 instance which is installed on Windows folder c:\dev\aem. Lets consider steps how to split repository with separate FileDataStore as BlobStore implementation :

  1. Stop Adobe AEM instance.
  2. Create backup of OAK repository and compact it.
  3. Create separate folders for:
    1. SegmentStore – crx-quickstart\repository_new
    2. BlobStore (somewhere on you environment but for perfomance this storage should be fast as possible)- C:\dev\aem\blobstore
  4. clone repository on new location with crx2oak tool, it’s more desirable to download it directly from “Adobe repo” rather then from aem installation folder “crx-quickstart\opt\helpers\crx2oak”:
    java -jar crx2oak-1.4.6-standalone.jar --copy-binaries --src-datastore=crx-quickstart/repository/segmentstore --datastore=c:\\dev\\aem\\author\\blobstore crx-quickstart/repository crx-quickstart/repository_new -mmap
  5. If there is no output errors we should check that crx-quickstart\repository_new contains new Tar files and if indeed:
    1. create new folder crx-quickstart\install
    2. delete crx-quickstart\repository
    3. rename crx-quickstart\repository_new to crx-quickstart\repository
  6. Create configuration files for new store (options are described here – click):
    1. create crx-quickstart\install\org.apache.jackrabbit.oak.plugins.segment.SegmentNodeStoreService.cfg with below content:
    2. create quickstart\install\org.apache.jackrabbit.oak.plugins.blob.datastore.FileDataStore.cfg with below content:
  7. Run the instance and check that

    has checked “Custom BlobStore” checkbox