Skip to content

booskander/Redis-VS-MongoDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Prerequisities, install docker and terraform fam, we in 2024...

1. Navigate to terraform directory

run:

terraform init
terraform plan
terraform apply

2. At this point, inside your docker desktop app you should have something like

image

you can also simply run

docker ps

and get

image

3. (Optional) Change the number of replicas use this command

terraform apply -var="mongo_replicas_count=<desired-count>"
terraform apply -var="redis_replicas_count=<desired-count>

4. Testing mongoDB connectivity

mongosh --host localhost --port <desired-port>

you should now see a mongoDB shell like this:

image

5. Testing Redis connectivity

redis-cli -h localhost -p <desired-port>

you should now see a redis shell like this:

image

6. Verify that the replication set works as expected

for mongo

mongosh --host localhost --port <desired-port>
rs.status()

and you should get the following output...

image

for Redis

docker exec redis-node-1 redis-cli -a password INFO replication
image

For reference:

https://www.mongodb.com/resources/products/compatibilities/deploying-a-mongodb-cluster-with-docker

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages