We have covered different aspects of MongoDB in the previous chapters, hopefully enough to make you feel confident of building your own web applications on top of it. In this chapter, we are going to discuss an interesting concept: using MongoDB and a relational database system together. We are going to examine a fictional project that is built around a relational database, and identify use cases for which MongoDB is a better fit. The practical examples in this chapter will demonstrate how we can use MongoDB along with a relational database for data archiving, storing aggregation results, caching JOIN queries, and so on. Lastly, we will discuss some of the challenges of working with such a hybrid data model. We will be using MySQL as the RDBMS in the examples, but the concepts should apply to any other relational database.
In this chapter, we shall:
Learn about the use cases where we can use MongoDB with a relational database system
Learn how...