Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

converting database from mysql to mongoDb

is there any easy way to change the database from mysql to mongoDB ?

or better any one suggest me good tutorial do it

like image 725
user737767 Avatar asked Jun 06 '11 11:06

user737767


People also ask

Why is MongoDB better than MySQL?

Why is using MongoDB better than using MySQL? Organizations of all sizes are adopting MongoDB, especially as a cloud database, because it enables them to build applications faster, handle highly diverse data types, and manage applications more efficiently at scale.

What is the MongoDB equivalent for a MySQL table?

MongoDB is a document-based non-relational database management system. It's also called an object-based system. It was designed to supplant the MySQL structure as an easier way to work with data. On the other hand, MySQL is a table-based system (or open-source relational database).

Is MongoDB more efficient than MySQL?

MongoDB speed debate, MongoDB usually comes out as the winner. MongoDB can accept large amounts of unstructured data much faster than MySQL thanks to slave replication and master replication. Depending on the types of data that you collect, you may benefit significantly from this feature.


1 Answers

is there any easy way to change the database from mysql to mongoDB ?

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.

like image 164
Gates VP Avatar answered Oct 06 '22 20:10

Gates VP