MongoDB vs Redis

Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

MongoDB
MongoDB

16.1K
12.6K
+ 1
3.8K
Redis
Redis

14.3K
9.4K
+ 1
3.8K
Add tool

MongoDB vs Redis: What are the differences?

Developers describe MongoDB as "The database for giant ideas". MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding. On the other hand, Redis is detailed as "An in-memory database that persists on disk". Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.

MongoDB belongs to "Databases" category of the tech stack, while Redis can be primarily classified under "In-Memory Databases".

"Document-oriented storage", "No sql" and "Ease of use" are the key factors why developers consider MongoDB; whereas "Performance", "Super fast" and "Ease of use " are the primary reasons why Redis is favored.

MongoDB and Redis are both open source tools. Redis with 37.1K GitHub stars and 14.3K forks on GitHub appears to be more popular than MongoDB with 16.2K GitHub stars and 4.08K GitHub forks.

According to the StackShare community, Redis has a broader approval, being mentioned in 3239 company stacks & 1735 developers stacks; compared to MongoDB, which is listed in 2175 company stacks and 2145 developer stacks.

What is MongoDB?

MongoDB stores data in JSON-like documents that can vary in structure, offering a dynamic, flexible schema. MongoDB was also designed for high availability and scalability, with built-in replication and auto-sharding.

What is Redis?

Redis is an open source, BSD licensed, advanced key-value store. It is often referred to as a data structure server since keys can contain strings, hashes, lists, sets and sorted sets.
Get Advice Icon

Need advice about which tool to choose?Ask the StackShare community!

Why do developers choose MongoDB?
Why do developers choose Redis?

Sign up to add, upvote and see more prosMake informed product decisions

What companies use MongoDB?
What companies use Redis?

Sign up to get full access to all the companiesMake informed product decisions

What tools integrate with MongoDB?
What tools integrate with Redis?

Sign up to get full access to all the tool integrationsMake informed product decisions

What are some alternatives to MongoDB and Redis?
Amazon DynamoDB
With it , you can offload the administrative burden of operating and scaling a highly available distributed database cluster, while paying a low price for only what you use.
Couchbase
Developed as an alternative to traditionally inflexible SQL databases, the Couchbase NoSQL database is built on an open source foundation and architected to help developers solve real-world problems and meet high scalability demands.
MySQL
The MySQL software delivers a very fast, multi-threaded, multi-user, and robust SQL (Structured Query Language) database server. MySQL Server is intended for mission-critical, heavy-load production systems as well as for embedding into mass-deployed software.
PostgreSQL
PostgreSQL is an advanced object-relational database management system that supports an extended subset of the SQL standard, including transactions, foreign keys, subqueries, triggers, user-defined types and functions.
Cassandra
Partitioning means that Cassandra can distribute your data across multiple machines in an application-transparent matter. Cassandra will automatically repartition as machines are added and removed from the cluster. Row store means that like relational databases, Cassandra organizes data by rows and columns. The Cassandra Query Language (CQL) is a close relative of SQL.
See all alternatives
Decisions about MongoDB and Redis
Yarn
Yarn
Redux
Redux
React
React
jQuery
jQuery
vuex
vuex
Vue.js
Vue.js
MongoDB
MongoDB
Redis
Redis
PostgreSQL
PostgreSQL
Sidekiq
Sidekiq
Rails
Rails
#Font-awesome
#Bulma.io

I'm building a new process management tool. I decided to build with Rails as my backend, using Sidekiq for background jobs. I chose to work with these tools because I've worked with them before and know that they're able to get the job done. They may not be the sexiest tools, but they work and are reliable, which is what I was optimizing for. For data stores, I opted for PostgreSQL and Redis. Because I'm planning on offering dashboards, I wanted a SQL database instead of something like MongoDB that might work early on, but be difficult to use as soon as I want to facilitate aggregate queries.

On the front-end I'm using Vue.js and vuex in combination with #Turbolinks. In effect, I want to render most pages on the server side without key interactions being managed by Vue.js . This is the first project I'm working on where I've explicitly decided not to include jQuery . I have found React and Redux.js more confusing to setup. I appreciate the opinionated approach from the Vue.js community and that things just work together the way that I'd expect. To manage my javascript dependencies, I'm using Yarn .

For CSS frameworks, I'm using #Bulma.io. I really appreciate it's minimal nature and that there are no hard javascript dependencies. And to add a little spice, I'm using #font-awesome.

See more
MongoDB
MongoDB

I starting using MongoDB because it was much easier to implement in production then hosted SQL, and found that a lot of the limitation you think of from a document store vs a relational database were overcome by connecting the application to a graphql API, making retrieval seamless. Mongos latest upgrades as well as Stitch and Mongo mobile make it a perfect fit especially if your application will be cross platform web and mobile.

See more
Adam Rabinovitch
Adam Rabinovitch
Global Technical Recruiting Lead & Engineering Evangelist at Beamery · | 3 upvotes · 156.8K views
atBeameryBeamery
Kafka
Kafka
Redis
Redis
Elasticsearch
Elasticsearch
MongoDB
MongoDB
RabbitMQ
RabbitMQ
Go
Go
Node.js
Node.js
Kubernetes
Kubernetes
#Microservices

Beamery runs a #microservices architecture in the backend on top of Google Cloud with Kubernetes There are a 100+ different microservice split between Node.js and Go . Data flows between the microservices over REST and gRPC and passes through Kafka RabbitMQ as a message bus. Beamery stores data in MongoDB with near-realtime replication to Elasticsearch . In addition, Beamery uses Redis for various memory-optimized tasks.

See more
Khauth György
Khauth György
CTO at SalesAutopilot Kft. · | 11 upvotes · 79K views
atSalesAutopilot Kft.SalesAutopilot Kft.
AWS CodePipeline
AWS CodePipeline
Jenkins
Jenkins
Docker
Docker
vuex
vuex
Vuetify
Vuetify
Vue.js
Vue.js
jQuery UI
jQuery UI
Redis
Redis
MongoDB
MongoDB
MySQL
MySQL
Amazon Route 53
Amazon Route 53
Amazon CloudFront
Amazon CloudFront
Amazon SNS
Amazon SNS
Amazon CloudWatch
Amazon CloudWatch
GitHub
GitHub

I'm the CTO of a marketing automation SaaS. Because of the continuously increasing load we moved to the AWSCloud. We are using more and more features of AWS: Amazon CloudWatch, Amazon SNS, Amazon CloudFront, Amazon Route 53 and so on.

Our main Database is MySQL but for the hundreds of GB document data we use MongoDB more and more. We started to use Redis for cache and other time sensitive operations.

On the front-end we use jQuery UI + Smarty but now we refactor our app to use Vue.js with Vuetify. Because our app is relatively complex we need to use vuex as well.

On the development side we use GitHub as our main repo, Docker for local and server environment and Jenkins and AWS CodePipeline for Continuous Integration.

See more
Tim Nolet
Tim Nolet
Founder, Engineer & Dishwasher at Checkly · | 8 upvotes · 57.2K views
atChecklyHQChecklyHQ
Amazon DynamoDB
Amazon DynamoDB
MongoDB
MongoDB
Node.js
Node.js
Heroku
Heroku
PostgreSQL
PostgreSQL

PostgreSQL Heroku Node.js MongoDB Amazon DynamoDB

When I started building Checkly, one of the first things on the agenda was how to actually structure our SaaS database model: think accounts, users, subscriptions etc. Weirdly, there is not a lot of information on this on the "blogopshere" (cringe...). After research and some false starts with MongoDB and Amazon DynamoDB we ended up with PostgreSQL and a schema consisting of just four tables that form the backbone of all generic "Saasy" stuff almost any B2B SaaS bumps into.

In a nutshell:cPostgreSQL Heroku Node.js MongoDB Amazon DynamoDB

When I started building Checkly, one of the first things on the agenda was how to actually structure our SaaS database model: think accounts, users, subscriptions etc. Weirdly, there is not a lot of information on this on the "blogopshere" (cringe...). After research and some false starts with MongoDB and Amazon DynamoDB we ended up with PostgreSQL and a schema consisting of just four tables that form the backbone of all generic "Saasy" stuff almost any B2B SaaS bumps into.

In a nutshell:

  • We use Postgres on Heroku.
  • We use a "one database, on schema" approach for partitioning customer data.
  • We use an accounts, memberships and users table to create a many-to-many relation between users and accounts.
  • We completely decouple prices, payments and the exact ingredients for a customer's plan.

All the details including a database schema diagram are in the linked blog post.

See more
Łukasz Korecki
Łukasz Korecki
CTO & Co-founder at EnjoyHQ · | 12 upvotes · 29.9K views
atEnjoyHQEnjoyHQ
PostgreSQL
PostgreSQL
MongoDB
MongoDB
RethinkDB
RethinkDB

We initially chose RethinkDB because of the schema-less document store features, and better durability resilience/story than MongoDB In the end, it didn't work out quite as we expected: there's plenty of scalability issues, it's near impossible to run analytical workloads and small community makes working with Rethink a challenge. We're in process of migrating all our workloads to PostgreSQL and hopefully, we will be able to decommission our RethinkDB deployment soon.

See more
Django
Django
Redis
Redis

I use Redis because, based on the case studies I have reviewed, it appears to be the most performant cache database for my Django projects. The ease of configuration and deployment is also a big plus.

Using both higher level view caching as well as low-level QuerySet caching with Redis has allowed me to improve HTTP request times by an order of magnitude.

See more
Mauro Bennici
Mauro Bennici
CTO at You Are My GUide · | 7 upvotes · 8.6K views
atYou Are My GUideYou Are My GUide
MongoDB
MongoDB
TimescaleDB
TimescaleDB
PostgreSQL
PostgreSQL

PostgreSQL plus TimescaleDB allow us to concentrate the business effort on how to analyze valuable data instead of manage them on IT side. We are now able to ingest thousand of social shares "managed" data without compromise the scalability of the system or the time query. TimescaleDB is transparent to PostgreSQL , so we continue to use the same SQL syntax without any changes. At the same time, because we need to manage few document objects we dismissed the MongoDB cluster.

See more
ES6
ES6
JavaScript
JavaScript
Socket.IO
Socket.IO
Redis
Redis
MongoDB
MongoDB
HTML5
HTML5
FeathersJS
FeathersJS
Redux
Redux
React
React

I have always been interested in building a real-time multiplayer game engine that could be massively scalable, and recently I decided to start working on a MMO version of the classic "snake" game. I wanted the entire #Stack to be based on ES6 JavaScript so for the #Backend I chose to use FeathersJS with MongoDB for game/user data storage, Redis for distributed mutex and pub/sub, and Socket.IO for real-time communication. For the #Frontend I used React with Redux.js, the FeathersJS client as well as HTML5 canvas to render the view.

See more
Redis
Redis
Elasticsearch
Elasticsearch
MongoDB
MongoDB

Originally, we had a single MongoDB replica set that we stored everything on. As we scaled, we realized two things:

  • A single Mongo replica set wasn’t going to cut it for our many quickly growing collections
  • Analytics and rich searching don’t scale well in Mongo.

To solve for the first item, we now run multiple large scale Mongo deployments with a mix of replica sets and sharded replica sets (depends on the application activity for the given database). In solving for the second item, we now run multiple large Elasticsearch deployments to provide the majority of our rich searching functionality.

We also heavily use Redis across the entire platform for things like distributed locking, caching, and backing part of our job queuing layer. This has led to our most recent (and ongoing!) scaling challenge.

See more
Robert Zuber
Robert Zuber
CTO at CircleCI · | 22 upvotes · 87.2K views
atCircleCICircleCI
Amazon S3
Amazon S3
GitHub
GitHub
Redis
Redis
PostgreSQL
PostgreSQL
MongoDB
MongoDB

We use MongoDB as our primary #datastore. Mongo's approach to replica sets enables some fantastic patterns for operations like maintenance, backups, and #ETL.

As we pull #microservices from our #monolith, we are taking the opportunity to build them with their own datastores using PostgreSQL. We also use Redis to cache data we’d never store permanently, and to rate-limit our requests to partners’ APIs (like GitHub).

When we’re dealing with large blobs of immutable data (logs, artifacts, and test results), we store them in Amazon S3. We handle any side-effects of S3’s eventual consistency model within our own code. This ensures that we deal with user requests correctly while writes are in process.

See more
Martin Johannesson
Martin Johannesson
Senior Software Developer at IT Minds · | 10 upvotes · 12.1K views
atIT MindsIT Minds
AMP
AMP
PWA
PWA
React
React
MongoDB
MongoDB
Next.js
Next.js
GraphQL
GraphQL
Apollo
Apollo
PostgreSQL
PostgreSQL
TypeORM
TypeORM
Node.js
Node.js
TypeScript
TypeScript
#Serverless
#Backend
#B2B

At IT Minds we create customized internal or #B2B web and mobile apps. I have a go to stack that I pitch to our customers consisting of 3 core areas. 1) A data core #backend . 2) A micro #serverless #backend. 3) A user client #frontend.

For the Data Core I create a backend using TypeScript Node.js and with TypeORM connecting to a PostgreSQL Exposing an action based api with Apollo GraphQL

For the micro serverless backend, which purpose is verification for authentication, autorization, logins and the likes. It is created with Next.js api pages. Using MongoDB to store essential information, caching etc.

Finally the frontend is built with React using Next.js , TypeScript and @Apollo. We create the frontend as a PWA and have a AMP landing page by default.

See more
MongoDB
MongoDB
MySQL
MySQL
.NET Core
.NET Core
C#
C#

Hi! I needed to choose a full stack of tools for a web drop shipping site without the payment process for a family startup proyect. It will feed from several web services (JSON), I'm looking forward a 4,200 articles tops. For web use only and for a few clients at the beginning.

I'm considering C# with .NET Core 3.0 as is the one language I'm starting to learn. For the Database I haven´t made my mind yet, but could be MySQL or MongoDB any advice is welcome as I'm getting back to programming after year away from this awesome world. Thanks

See more
Husein Fakhir
Husein Fakhir
Redis
Redis
MongoDB
MongoDB
Node.js
Node.js
React Native
React Native
React
React
TypeScript
TypeScript
Linux
Linux

I'm currenty working on a broadcasting platform which uses Janus for RTC connections. For the Front-End, I'm using React for the Browser and React Native for mobile. My signaling server is built with Node.js with a MongoDB for persistent storage and Redis for memory storage all deployed on a Linux machine. Of course, I'm using TypeScript.

See more
Nicolas Apx
Nicolas Apx
CEO - FullStack Javascript at Apx Development Limited · | 14 upvotes · 11.2K views
atAPX DevelopmentAPX Development
PostgreSQL
PostgreSQL
MongoDB
MongoDB
Node.js
Node.js
Python
Python

I am planning on building a micro-service eCommerce back-end to be easy to reuse in any project as we need. I would like to use both Python and Node.js and MongoDB & PostgreSQL , in your opinion which one would best suited for the following services:

  • Users-service
  • Products-service
  • Auth-service
  • Inventory-service
  • Order-service
  • Payment-service
  • Sku-service
  • And more not yet defined....

Thanks

Nicolas

See more
Interest over time
Reviews of MongoDB and Redis
Review ofRedisRedis

Redis is a good caching tool for a cluster, but our application had performance issues while using Aws Elasticache Redis since some page had 3000 cache hits per a page load and Redis just couldn't quickly process them all in once + latency and object deseialization time - page load took 8-9 seconds. We create a custom hybrid caching based on Redis and EhCache which worked great for our goals. Check it out on github, it's called HybriCache - https://github.com/batir-akhmerov/hybricache.

How developers use MongoDB and Redis
Avatar of Cloudcraft
Cloudcraft uses RedisRedis

Redis is used for storing all ephemeral (that's data you don't necessarily want to store permanently) user data, such as mapping of session IDs (stored in cookies) to current session variables at Cloudcraft.co. The many datastructures supported by Redis also makes it an excellent caching and realtime statistics layer. It doesn't hurt that the author, Antirez, is the nicest guy ever! These days, I would be really hard pressed to find any situation where I would pick something like Memcached over Redis.

Avatar of Trello
Trello uses RedisRedis

Trello uses Redis for ephemeral data that needs to be shared between server processes but not persisted to disk. Things like the activity level of a session or a temporary OpenID key are stored in Redis, and the application is built to recover gracefully if any of these (or all of them) are lost. We run with allkeys-lru enabled and about five times as much space as its actual working set needs, so Redis automatically discards data that hasn’t been accessed lately, and reconstructs it when necessary.

Avatar of Tarun Singh
Tarun Singh uses MongoDBMongoDB

Used MongoDB as primary database. It holds trip data of NYC taxis for the year 2013. It is a huge dataset and it's primary feature is geo coordinates with pickup and drop off locations. Also used MongoDB's map reduce to process this large dataset for aggregation. This aggregated result was then used to show visualizations.

Avatar of Trello
Trello uses MongoDBMongoDB

MongoDB fills our more traditional database needs. We knew we wanted Trello to be blisteringly fast. One of the coolest and most performance-obsessed teams we know is our next-door neighbor and sister company StackExchange. Talking to their dev lead David at lunch one day, I learned that even though they use SQL Server for data storage, they actually primarily store a lot of their data in a denormalized format for performance, and normalize only when they need to.

Avatar of Stack Exchange
Stack Exchange uses RedisRedis

The UI has message inbox that is sent a message when you get a new badge, receive a message, significant event, etc. Done using WebSockets and is powered by redis. Redis has 2 slaves, SQL has 2 replicas, tag engine has 3 nodes, elastic has 3 nodes - any other service has high availability as well (and exists in both data centers).

Avatar of Foursquare
Foursquare uses MongoDBMongoDB

Nearly all of our backend storage is on MongoDB. This has also worked out pretty well. It's enabled us to scale up faster/easier than if we had rolled our own solution on top of PostgreSQL (which we were using previously). There have been a few roadbumps along the way, but the team at 10gen has been a big help with thing.

Avatar of Brandon Adams
Brandon Adams uses RedisRedis

Redis makes certain operations very easy. When I need a high-availability store, I typically look elsewhere, but for rapid development with the ability to land on your feet in prod, Redis is great. The available data types make it easy to build non-trivial indexes that would require complex queries in postgres.

Avatar of Kent Steiner
Kent Steiner uses RedisRedis

I use Redis for cacheing, data storage, mining and augmentation, proprietary distributed event system for disparate apps and services to talk to each other, and more. Redis has some very useful native data types for tracking, slicing and dicing information.

Avatar of AngeloR
AngeloR uses MongoDBMongoDB

We are testing out MongoDB at the moment. Currently we are only using a small EC2 setup for a delayed job queue backed by agenda. If it works out well we might look to see where it could become a primary document storage engine for us.

Avatar of Matt Welke
Matt Welke uses MongoDBMongoDB

Used for proofs of concept and personal projects with a document data model, especially with need for strong geographic queries. Often not chosen in long term apps due to chance data model can end up relational as needs develop.

How much does MongoDB cost?
How much does Redis cost?
Pricing unavailable