DataStore

Binary Store Guide

The DataStore makes it possible to store binary files more efficiently.

Configuration

You can choose between two Binary Store options:

  1. A file system option which stores the binary files on each Sophora Server's hard disk,
  2. a database option which stores the binary files in a per-Sophora Server database

The Binary Storesexist on a per-Sophora Server basis.

Cache size

If the database option is used, binary data will be cached in the file system. The size of this cache can be configured with the property sophora.binarystore.cacheSize.

sophora.binarystore.cacheSize=1GB

If this property is not used, the size of the cache will default to 4GB. Examples for valid values are 5GB, 1MB, 3KB, 1000B or 1000 (1000 bytes). Units must be written in capital letters. Numbers with fractional parts are not valid, e.g. 1.5GB.

Configuration of the file system option

If the file system option is used, the individual files are stored on the hard disk or mounted volume separately from the Sophora repository.

sophora.binarystore=fs

By default the binary data is stored in the directory ${sophora.home}/repository/binaries.

If you want to save the binary data in a different directory, you can use the Sophora Server property sophora.binarystore.fs.baseDirectory. The configured path is relative to sophora.home.

Configuration of the database option

The database data option allows you to store the binary data in a MySQL, Derby or Oracle database. The necessary tables are created automatically if the user has the necessary permissions.

sophora.binarystore=db
# Possible values: mysql, derby or oracle
sophora.binarystore.db.databaseType=mysql
sophora.binarystore.db.url=jdbc:mysql://mysql.subshell.com:3306/binarystore
sophora.binarystore.db.user=sophora
sophora.binarystore.db.password=sophora
sophora.binarystore.db.driver=com.mysql.jdbc.Driver

Purge job

When document versions or whole documents are removed from the Sophora repository, the binary data in the Binary Store store is not affected.

An asynchronous job checks all binary data in the Binary Store. When no reference to the binary is found (not in the main Sophora repository nor in the archive repository) the binary data is removed from the Binary Store. This purge job can be controlled by the following properties:

sophora.binarystore.purgeJob.cronTriggerExpression=0 0 2 * * ?
sophora.binarystore.purgeJob.delayMs=10
sophora.binarystore.purgeJob.durationMinutes=18080

Last modified on 5/10/22

The content of this page is licensed under the CC BY 4.0 License. Code samples are licensed under the MIT License.

Icon