Developing a proof-of-concept application with MongoDB and MySQL
Till now, we have learned about Polyglot Persistence and why RethinkDB is best suited for it. It's time to get to work and prove that this kind of system can be implemented with RethinkDB. In this section, we are going to develop an application that will use three databases, RethinkDB, MySQL, and MongoDB, where RethinkDB will act as an entry database.
We will develop an application where you can perform the CRUD operation in RethinkDB and all changed data will be synchronized automatically to MySQL and MongoDB.
Consider the following diagram:
As you can see in the preceding diagram, the server will first perform the data manipulation in RethinkDB and by using the changefeed we will notify and update MongoDB and MySQL.
Before moving ahead to the code part, let's do some quick data modeling for all three databases. We are going to store personal data related to the users. Here is the simple data model schema for RethinkDB:
{ ...