https://www.growthbook.io/ logo
#give-feedback
Title
# give-feedback
m

miniature-agency-3305

10/04/2023, 2:51 PM
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

cuddly-finland-73937

10/04/2023, 4:36 PM
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

miniature-agency-3305

10/04/2023, 4:44 PM
@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

cuddly-finland-73937

10/04/2023, 4:54 PM
๐Ÿ™‚ ok
f

fresh-football-47124

10/05/2023, 7:48 AM
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

miniature-agency-3305

10/05/2023, 7:51 AM
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

miniature-agency-3305

10/06/2023, 7:10 AM
Is this the recommended tutorial for setting up the mongodb volume? How do we then connect the growthbook instance to it? ๐Ÿ˜„
c

cuddly-finland-73937

10/06/2023, 1:06 PM
you just need to set the environment variable
MONGODB_URI
with the MongoDB settings
m

miniature-agency-3305

10/06/2023, 1:39 PM
Yeah I think we got it working now, thanks ๐Ÿ˜„
18 Views