Compliant Kubernetes Service documentation has moved

Please note: You are not reading Kubernetes documentation. If you're looking for Compliant Kubernetes Service documentation, it has moved. Read more here.

IMPORTANT: Due to a change in licensing, Datica cannot create new MongoDB services. 

HA MongoDB services on The Platform use Replica Sets to provide automated failover in the event of a MongoDB node failure. The Platform handles the replica set configuration within your environment, and expose a single connection URI in an environment variable, DATABASE_URL.

Note: The variable may not always be named DATABASE_URL if the environment also contains more than one database service. There will always also be another variable named after the service, such as MONGO01_URL or DB01_URL.

The environment variable’s value follows the format defined by MongoDB. An example connection string:


In the above example, the primary MongoDb node is at and the secondary node is at myDB will be the default database to connect to. The replica set to connect to is named myReplSet.

You will need to write your application using a client that supports replica sets - official driver list here.

To test your application locally using a replica set, we recommend that you follow the instructions in this blog post. This will give you a local testing environment that is configured very similarly to your HA MongoDB on The Platform.

See also