Importing sql dump file mongo db

603 views
Skip to first unread message

mani kandan

unread,
Apr 10, 2015, 2:55:29 AM4/10/15
to mongod...@googlegroups.com
Can i import the .sql file into mongo db.?.?

Stephen Steneker

unread,
Apr 10, 2015, 4:49:23 AM4/10/15
to mongod...@googlegroups.com
On Friday, 10 April 2015 16:55:29 UTC+10, mani kandan wrote:
Can i import the .sql file into mongo db.?.?

Hi Mani,

I'm not aware of any tools to directly import SQL into MongoDB, but in general that's not the best idea as you will very likely want to adjust the data model to take advantage of MongoDB's strengths. A direct copy of a relational database model (particularly one that is highly normalised) will have in-built assumptions such as requiring joins for common queries. MongoDB does not support server-side joins, and will likely support different data types from your SQL database (most common types are 1:1, but some field types may require data conversion).

For more information on data models in MongoDB I'd suggest starting with the MongoDB manual:
 http://docs.mongodb.org/manual/data-modeling/

As far as SQL files go .. there are some general notions of "standard" SQL, but most vendors have their own extensions. I expect the easiest way to extract data from a SQL file would be importing it into the relevant original database and either writing a script to do the required data transformation to your MongoDB data model or using an ETL tool to achieve this.

Regards,
Stephen 
Reply all
Reply to author
Forward
0 new messages