Ambience 202x MongoDB Frequently Asked Questions

This FAQ covers common questions about MongoDB usage in Elixir Ambience 202x, including configuration, logging, session management, and troubleshooting. Use this guide to quickly find answers and recommended practices when setting up or maintaining Ambience with MongoDB.

Why does Elixir Ambience 202x require MongoDB as its underlying database?

Ambience 202x uses MongoDB to support high availability (HA) clustering. It stores the server’s current state, file repository, credentials, and common API tokens.

Refer to the Ambience Server deployment diagram here:
Ambience Server Deployment Diagram (PDF)

Can Ambience 202x suppress writing Activity and Audit logs to MongoDB and instead write them as physical log files?

Yes, this feature is available starting from Ambience 2025.2.

Refer to the guide here:
Writing Physical Activity and Audit Log Files (Ambience 2025.2+)

What MongoDB collections does Ambience 202x require, and is manual creation necessary?
Where are the MongoDB configurations in etc/application.conf?

By default, MongoDB runs on port 27017. You may use a different database name if needed, but for simplicity we recommend keeping it as ambience. Ensure that the port and database name are configured correctly:

elixir.mongo {
  connectionString = "mongodb://${mongodb}:27017"
  database = "ambience"
}

You can rename the database, add multiple servers, or encrypt connection strings with {enc} syntax:

elixir.data.mongodb {
  default {
    connectionString = "mongodb://${mongodb}:27017"
    database {
      eno = "eno"
    }
  }
}
Can MongoDB connection strings in etc/application.conf be encrypted?

Refer to the following on encrypting the MongoDB connection string: https://support.elixirtech.com/t/encrypting-using-ambience-repertoire-202x

What is the purpose of the ambience-temp collection?

The ambience-temp stores ETL output results. Each time ETL is run, the results are stored in this collection for viewing in the ETL module via the web console.

Can ETL log messages be written to Ambience Server logs?

Add the following lines to etc/application.conf to configure where the ETL log messages should be written to:

# Write to job log in ETL Designer
ambience.etl.logging.write-to-job-log: false  

# Write to physical Ambience Server logs
ambience.etl.logging.write-to-server-log: true

More details:
MongoDB Logging Configurations in Ambience 202x

Can I stop Ambience from writing logs to MongoDB collections?

Add the following to etc/application.conf to disable log messages from being written to MongoDB collections:

elixir.logging.mongo-appender {
  enabled = false
  level = "WARN"
}

Physical logs should instead be configured in etc/logback.xml.

How do I check collection sizes in MongoDB?

Run the following commands to get stats:

use ambience  
db.getCollectionNames().forEach(name => {  
    const stats = db.getCollection(name).stats();  
    print(`${name} : ${stats.size} bytes`);  
});
How can I prevent session data from piling up in MongoDB?

Add a session-cleaner expiry in application.conf:

ambience.session-cleaner {
  expiry: 1 hour
}
How do I control cleanup frequency and expiry for ambience.collection-cleaner?

Add the following in application.conf:

ambience.temp-cleaner {   
  expiry: 12 hours   
  batch-size: 100 
}

The batch-size controls how many items are deleted at once. For example, 500 sessions with a batch-size of 100 will be cleared in 5 batches, with 100 MongoDB connections opened simultaneously for each batch.

What details should I collect when diagnosing MongoDB issues?

Infrastructure

  • VM specs (CPU, RAM) for Ambience 202x servers
  • MongoDB Atlas cluster tier and configuration

Database

  • Sizes of critical collections: LogActivities, LogAudit, LogEvents, MinuteMinder, RunInfo

Configuration

  • The startup script (run-server or container)
  • The etc/application.conf file from the environment
How can I reduce lower-priority access and response logging?

This is disabled by default in etc/application.conf. Enable only if detailed logs are required:

ambience.access-log {
  enabled = false
  expire-after = 12 hours
  skip = ["style", "lib", "webfonts", "favicon.png"]
}
What is the TailableEventBus collection, and why must it be capped?

The TailableEventBus collection enables real-time event streaming and must be a capped collection to support this feature.

Refer to the full guide here: (Understanding the TailableEventBus)

For further assistance, detailed configuration guides, or troubleshooting support, please refer to the Ambience online documentation or contact the Elixir Support Team.