How to transfer data from mongodb to mysql?

I am currently working on an analytics-like application, I have an Angularjs application that communicates with the Spring REST client application from which the user creates a token (tracking identifier) ​​and a generated script with this identifier that hosts his website to collect information about visitor actions through another Spring REST tracking application , for a tracking application . I use as mongodb to collect visitor information / visitor information for quick insertion, but for mysql rest client application with user / account information. My question is how to transfer the mongo data from the tracking application to mysql, possibly in order to be able to combine for simple and quick data analysis using any filters from the angularjs client application to manually create any workers who periodically transfer data from the last point indicate the state from mongo to mysql or any existing tools that can be installed for this transfer?

+5
source share
2 answers

There is no official library for this. But you can use the mongoexport function from mongoDB to export it in CSV format and mysqlimport to import them into MySQL.

Here are links to the MySQL Import and MongoDB Export documentation.


Another method that you can try writing in one of your favorite languages ​​and reading from MongoDB and writing to MySQL

+8
source

MySQL 5.7 has a new JSON data type, which can be very convenient.

You can create a table in MySQL to receive JSON AS IS messages, and then use SQL to query or perform post-processing to load data into a structured set of database tables.

Check this out: https://dev.mysql.com/doc/refman/5.7/en/json.html

+3
source

Source: https://habr.com/ru/post/1240847/


All Articles