Database and File Size

Add Database

When MongoDB is installed, by default the database is named “eno”. You can add another database into MongoDB and include it the application.conf file so that the Ambience software is able to access it.

Two areas need to be edited.

  1. The first area allows user to read and write to the database via datasets and import/export modules. In the location indicated below, replace it with your new database name.

    #Where datasets can be read from and written to via datasets and import/export modules
    
    ambience.datasets.databases = ["eno","NewDatabaseName"]
    
    ambience.import.databases = ["eno","NewDatabaseName"]
    
    ambience.export.databases = ["eno","NewDatabaseName"]
    
  2. The other area allows the user to include the new database so that Ambience can access it in MongoDB. In the elixir.data.mongodb section, add a new line, replacing the database name.

    elixir.data.mongodb {
      ...
      default {
        connectionString = "mongodb://"${mongodb}":27017"
        ...
        database {
          eno = "eno"
          NewDatabaseName = "NewDatabaseName"
        }
      }
    }
    

This section is for Ambience only and does not apply to Repertoire.

Session Timeout Duration

Ambience software has inactivity session timeout of 15 minutes. This timeout duration can be changed in the application.conf file. In the ambience.web section, edit the session-timeout = 15 minutes to the desired duration.

ambience.web {
  ...
  session-timeout = 15 minutes
  enforce-single-session = false
  ...
}

To disable the timeout, use the value never.

Session Cleaner

The software keeps the sessions for seven days by default. A session will typically expire due to inactivity of 15 minutes. The seven days will begin from the last activity. So you can still keep a session alive for a month, as long as the mouse is moved at least once every 15 minutes.

You can change the duration for the sessions to be kept in the system in the application.conf file. You can add following in the application.conf file.

ambience.session-cleaner {
  expiry: 2 days
}

The configuration above allows the software to remove sessions that are more than two days from the last activity.

Pass Large XLSX File

When the ETL reads an XLSX file that is too large, a POI error will occur due to Apache POI limit. To overcome this, add the following in the application.conf file:

elixir.poi.io-utils.max-byte-array = <value>

where is the file size:

  • Default is -1 (per-record type value is used)

  • Maximum value is 2147483647 (maximum INT32 value)

It is advisable not to set to the maximum value as it may lead to OOM error.

BinaryStore

Ambience stores binary data within MongoDB by default. This ensures that all servers in a cluster are able to see the same source material when responding to requests. However, this can make the size of the database grow, if you have many files or large files to store.

A large database requires more time and effort to backup and restore in the event of failure. Therefore, Ambience also supports storing binary data elsewhere, for example, Amazon S3, or on a shared disk.

This may be binary data from uploads, from message attachments or from use of ETL, which provides steps to read and write across all the binary stores you have configured.

Enable BinaryStore

The Ambience/Repertoire software suite supports BinaryStore.

By default, each module uses a specific collection under the Ambience database; namely UploadDownloadChunk and MessageAttachments respectively. The filesize is controlled in the application.conf file as follows:

ambience.modules.upload.max-content-length : 150m

To enable the use of BinaryStore, add the respective line in the application.conf file:

ambience.modules.upload.store = "default-large"        # For Upload module

ambience.modules.messages.attachmentsStore = "default-large"   # For Message module

ambience.modules.report-portal.binary-store = "azureBlob"      # For Report Portal module

If the line is missing or empty, then their respective module collection will be used.

The maximum filesize for BinaryStore is defined in the value maxSize in the application.conf file.

ambience.binary-store.location {
  default {
    type = "mongodb"
    database = "" # use default (typically "ambience") if empty
    collection = "BinaryStore"
    maxSize = 15MB
  }
  default-large {
    type = "mongodb-chunks"
    enable = true
    database = "" # use default (typically "ambience") if empty
    collection = "BinaryStoreChunks"
    maxSize = 500MB
  }
}

The setting for max-content-length will take precedence over maxSize. When max-content-length is empty or missing, then filesize is controlled by maxSize.

Any existing uploads and attachments in the Ambience/Repertoire specific collections, prior to the switch to BinaryStore, the system will still be able to find the previous items in their respective collections. Vice versa for switching from BinaryStore to the default Ambience/Repertoire collection.

Disk BinaryStore

By default, MongoDB is used for BinaryStore. This storage location can be changed to disk (i.e., a location in the local drive).

To do so, add the following lines into the application.conf file to configure the disk BinaryStore:

ambience.binary-store.location {
  <name> {
    type = "disk"
    path = "<pathname>"
    maxSize = 150MB
    enable = true
  }
}

The value defines the name of the store and defines the path to the desired location in the local drive.

The disk store then can be used as a store name for any configurable store. For example, the following line is added to the application.conf file to use the disk store for the Upload module.

ambience.modules.upload.store = "<name>"

Each entry has the metadata equivalent to what is stored in AWS S3, MongoDB, etc.

When using the disk binary store, it is important that all the Ambience servers in your cluster have shared read/write access to that disk, so they are able to provide a consistent response, regardless of which server receives each request. (In Repertoire, this is not a concern as there is no HA mode).