Obviously there are far more differences than this, but for an extremely high overview:
For use-cases:
- Redis is often used as a caching layer or shared whiteboard for distributed computation.
- MongoDB is often used as a swap-out replacement for traditional SQL databases.
Technically:
- Redis is an in-memory db with disk persistence (the whole db needs to fit in RAM).
- MongoDB is a disk-backed db which only needs enough RAM for the indexes.
There is some overlap, but it is extremely common to use both. Here's why:
- MongoDB can store more data cheaper.
- Redis is faster for the entire dataset.
- MongoDB's culture is "store it all, figure out access patterns later"
- Redis's culture is "carefully consider how you'll access data, then store"
- Both have open source tools that depend on them, many of which are used together.
Redis can be used as a replacement for a traditional datastore, but it's most often used with another normal "long" data store, like Mongo, Postgresql, MySQL, etc.