# Using MongoDB Atlas
In a critical operational context, it can be safer to rely on MongoDB Atlas (opens new window) than on your own instance of MongoDB.
To use MongoDB Atlas with Kargo, there are few things to do:
Create your cluster on MongoDB Atlas
Enables the connection from Kargo to your cluster. On AWS the best practice is to enable a peering connection between your Kargo VPC and your cluster VPC. See the documentation (opens new window) for the detailed procedure.
Configure the services in Kargo to use MongoDB Atlas.
The tricky thing is that you will need to configure the services with the appropriate connection string. Indeed, the connection string provided by MongoDB Atlas is dependent from the MongoDB driver you use and for now Krawler based jobs are using the version 3 of the MongoDB driver while KDK based applications are using the version 2.
- declare the following variables, with the connections strings provided by MongoDB Atlas:
To get the connection strings, click on the
CONNECT button attached to your cluster. Then select
Connect your application and a window will display the connection strings for the different version of the driver.
Do not forget to quote the variables.
- update the DB URL variables for the services, for instance:
... KANO_DB_URL=$MONGO_ATLAS_URL_V2 ... VIGICRUES_DB_URL=$MONGO_ATLAS_URL_V3 ... WEACAST_DB_URL=$MONGO_ATLAS_URL_V2 WEACAST_LOADERS_DB_URL=$MONGO_ATLAS_URL_V3 ...