So when we implemented the self hosted version of ...
# give-feedback
m
So when we implemented the self hosted version of Growthbook there was no information about implementing our own database solution and we just now sadly lost the data in our mongo db instance after our server ran out of RAM and we restarted it. Are there some docs regarding how to connect it to a separate database or any guidelines regarding how it should be implemented? ๐Ÿ™‚
c
It will connect to any MongoDB (I've been using AWS DocumentDB). You just need to set the environment variable
MONGODB_URI
with the MongoDB settings
This page indicates:
Copy code
CAUTION
The use of the mongo image within the docker-compose.yml is meant to quickly get a dev or staging environment up and running. For production you may want to use a more scalable and stable solution (ie. AWS DocumentDB, Google Cloud MongoDB Atlas, Azure Cosmos DB for Mongo, etc.)...
m
@cuddly-finland-73937 That text was not there a couple of months ago which you can see if you use something like https://archive.org/web/ ๐Ÿ™‚
c
๐Ÿ™‚ ok
f
Sorry about that
Using hosted Mongo/DocumentDB is safest, but you can also self-host mongo, but you should specify a volume (if youโ€™re using docker) so that you donโ€™t loose data if you do docker down.
m
Yeah weโ€™ve learned our lesson now so will be careful about it in the future ๐Ÿ˜„ Luckily the project is just in a beta phase so not too much issues ^^ Also likely gonna keep a separate hosted JSON as a backup for if we have any future issues ๐Ÿ‘
m
Is this the recommended tutorial for setting up the mongodb volume? How do we then connect the growthbook instance to it? ๐Ÿ˜„
c
you just need to set the environment variable
MONGODB_URI
with the MongoDB settings
m
Yeah I think we got it working now, thanks ๐Ÿ˜„