mongodb-memory-server VS Docker Compose

Compare mongodb-memory-server vs Docker Compose and see what are their differences.

mongodb-memory-server

Spinning up mongod in memory for fast tests. If you run tests in parallel this lib helps to spin up dedicated mongodb servers for every test file in MacOS, *nix, Windows or CI environments (in most cases with zero-config). (by nodkz)
Our great sponsors
  • SurveyJS - Open-Source JSON Form Builder to Create Dynamic Forms Right in Your App
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
mongodb-memory-server Docker Compose
9 386
2,450 32,367
- 1.4%
9.3 9.6
7 days ago 1 day ago
TypeScript Go
MIT License Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

mongodb-memory-server

Posts with mentions or reviews of mongodb-memory-server. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-10-13.
  • How to test nestjs modules?
    10 projects | /r/Nestjs_framework | 13 Oct 2022
    In the case of MongoDB there's jest-mongodb that use mongodb-memory-server; for other DBMS, I don't know if it's possible to run an instance in memory.
  • My first project, a Dev.to clone built with MongoDB, Express, React, and Socket.io
    2 projects | /r/learnjavascript | 8 Apr 2022
    The only thing really messing is tests. At work we use https://github.com/nodkz/mongodb-memory-server
  • How to write tests for applications that use MongoDB as a storage
    3 projects | dev.to | 3 Oct 2021
    The final method tries to combine both methods, 1 and 2. It uses an external package MongoDB In-Memory Server for our MongoDB.
  • How to test mongoose models with jest and mockingoose
    1 project | dev.to | 7 Sep 2021
    The above test is clear and easy to understand, but the reality is that, while this can be applied to a lot of cases, things get very complicated when you have to start to mock things like dependencies, API calls, etc... And one very tricky case is when you have to test a function that invoke some models from an ODM like Mongoose, like doing some CRUD operations against a database. In some cases a solution could be to use an actual test database, so you don't mock anything but you use real data. The only problem with that is that is assuming that you must have a database at your disposal to run unit tests, and that's not always possible, plus you have to clean the database, and a pletora of other problems. Another solution could be to use a database that lives only in memory and only for the duration of your tests, like the excellent mongodb-memory-server package. But while this will work most of the times, if you deploy your code on any CI/CD you might encounter problems (and I did!). Also a key factor of unit testing, is that you shouldn't rely on external services run them, unlike E2E tests for example. What you should do is to mock most of the dependencies you need, as your goal is to just test the function and no deeper than that.
  • Show HN: Mongita is to MongoDB as SQLite is to SQL
    7 projects | news.ycombinator.com | 20 Apr 2021
  • Setup in-memory database for testing Node.js and Mongoose
    2 projects | dev.to | 16 Feb 2021
    I've been working on creating an application using Node.js and Mongoose where all data stored in the cloud MongoDB Atlas. My goal was to test API endpoints and write some unit tests, for that I found this package called mongodb-memory-server, which allows me to create a connection to the MongoDB server from my cache folder without a need to use cloud test database or installing mongodb client.
  • Testing with MongoDB-Memory-Server
    2 projects | dev.to | 16 Feb 2021
    In both articles, the authors refer to nodkz's mongodb-memory-server package.
  • MongoDB Animated: Adding and removing elements from arrays
    2 projects | dev.to | 19 Jan 2021
    mongodb-memory-server package by @nodkz
  • In memory mongoDB for testing
    1 project | dev.to | 13 Oct 2020
    There are a whole lot of configuration options for you to explore with this package here -> https://github.com/nodkz/mongodb-memory-server

Docker Compose

Posts with mentions or reviews of Docker Compose. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-04-26.
  • Let's write a simple microservice in Clojure
    7 projects | dev.to | 26 Apr 2024
    Using Docker Compose to run Postgres and any third-party services locally provides a streamlined and consistent development environment. Developers can define services in a docker-compose.yml file, which enables them to configure and launch an entire stack with a single command. In this case, Postgres is encapsulated within a container with predefined configurations. Docker Compose also facilitates easy scaling, updates, and isolation of services, enhancing development efficiency and reducing the setup time for new team members or transitioning between projects. It encapsulates complex configurations, such as Postgres' performance monitoring and logging settings, in a manageable, version-controlled file, simplifying and replicating the service setup across different environments.
  • Live reload em Go com docker e compile daemon
    4 projects | dev.to | 25 Apr 2024
  • Docker compose, orchestrating and automating services
    3 projects | dev.to | 21 Apr 2024
    “Compose simplifies the control of your entire application stack, making it easy to manage services, networks, and volumes in a single, comprehensible YAML configuration file. Then, with a single command, you create and start all the services from your configuration file.” - Docker documentation
  • Hosting a simple docker-compose app with Nginx and generate a SSL with certbot on digitalocean droplet
    2 projects | dev.to | 8 Apr 2024
    curl -fsSL https://get.docker.com -o get-docker.sh sudo sh get-docker.sh # Install docker compose sudo curl -L "https://github.com/docker/compose/releases/download/1.29.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose # Apply executable permissions to the binary sudo chmod +x /usr/local/bin/docker-compose # Run Project docker-compose up -d
  • One Minute: Compose
    4 projects | dev.to | 30 Mar 2024
    Docker,
  • How to Set Up a Docker Container
    3 projects | dev.to | 13 Mar 2024
    This foundation now opens the door to even more powerful concepts. You can explore more advanced concepts such as container networking, streamlining the management of complex applications with Docker Compose, and how to make your application data persistent using volumes.
  • Use same Dockerfile for Dev & Production
    1 project | dev.to | 8 Feb 2024
    In many projects that are containerized, especially in cases where development is also done locally with docker-compose, teams often have two Dockerfiles, 1 for Development, the other for Production. If you happen to have multiple environments like pre-prod, staging and so on, some teams could have different Dockerfiles for these environments.
  • How to Dockerise a NodeJS - TypeScript API || A Comprehensive Guide from Environment Setup to Deployment with a CI/CD Pipeline
    5 projects | dev.to | 18 Jan 2024
    sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
  • Deploy a MongoDB Cluster With Docker Compose
    1 project | dev.to | 7 Jan 2024
    You can also use Docker Compose to deploy the cluster, without having to write all the previous commands.
  • Build and Deploy a ReactJS App to AWS EC2 with Docker, NGINX, and Automate with GitHub Actions.
    5 projects | dev.to | 5 Jan 2024
    [ec2-user]$ sudo yum update -y [ec2-user]$ sudo yum install -y docker [ec2-user]$ sudo service docker start [ec2-user]$ sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose [ec2-user]$ sudo chmod +x /usr/local/bin/docker-compose [ec2-user]$ docker --version Docker version 20.10.23, build 7155243 [ec2-user]$ docker-compose --version Docker Compose version v2.18.1

What are some alternatives?

When comparing mongodb-memory-server and Docker Compose you can also consider the following projects:

mongodb-jest-testing - Tests with jest and mongodb

supervisor - Supervisor process control system for Unix (supervisord)

indradb - A graph database written in rust

LibreNMS-docker - LibreNMS Docker image

mongita - "Mongita is to MongoDB as SQLite is to SQL"

terraform - Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

sortedcontainers - Python Sorted Container Types: Sorted List, Sorted Dict, and Sorted Set

Portainer - Making Docker and Kubernetes management easy.

apollo-mongoose-plugin - Apollo GraphQL plugin to add MongoDB query information on the extensions node

Cloud-Init - unofficial mirror of Ubuntu's cloud-init

lungo - A MongoDB compatible embeddable database and toolkit for Go.

k3s - Lightweight Kubernetes