Vairamuthu
  • 0
Beginner

How to Migrate from MySQL to MongoDB

  • 0

In the last week I was working on a key project to migrate a BI platform from MySQL to MongoDB. We chose that database due to its support and scalability.

  1. Method #1: export from MySQL in a CSV format and then use theĀ mongoimport tool. However, this does not always work well in terms of handling dates of binary data.

    Method #2: script the transfer in your language of choice. Basically you write a program that reads everything from MySQL one element at a time and then inserts it into MongoDB.

    Method #2 is better than #1, but it is still not adequate.

    MongoDB uses collections instead of tables. MongoDB does not support joins. In every database I’ve seen, this means that your data structure in MongoDB is different from the structure in MySQL.

    Because of this, there is no “universal tool” for porting SQL to MongoDB. Your data will need to be transformed before it reaches MongoDB.

    • 0

You must login to add an answer.