Data import and export in RethinkDB
RethinkDB provides the facility to dump existing data either coming from traditional databases such as MySQL and MSSQL in a suitable format, that is, CSV
or JSON
, or freshly generated JSON documents.
In Chapter 3, Data Exploration Using RethinkDB, we used the import
utility to dump a JSON file consisting of 1,000 documents directly into a table. In this section, we are going to refresh the import
utility.
Here is the command:
rethinkdb import -f <file path> --table <Database name>.<table name>
You can also specify the port options and other configuration; for more information, please visit Chapter 3, Data Exploration Using RethinkDB.
Let's look at a few use cases where we can really make use of the import
utility.
Importing data from MySQL to RethinkDB
MySQL is no doubt one of the most popular and widely used SQL database engines, and is used by giants such as Facebook and Google. If you want to switch your stack from MySQL to RethinkDB, you...