Loading data from sql to mongo

100 views
Skip to first unread message

abdul kadar

unread,
Oct 1, 2012, 4:53:15 PM10/1/12
to mongod...@googlegroups.com
Hi,

I need to load data from sql to mongo. in sql i have 42 tables , so a document needs to be generated by those 42 tables, just i created a stored procedure which will deal all the tables and with the help of C# class structures i loaded those records as a batch of 5000, which is taking 7.5 hours to load complete 2 million records.

is there any better way to load the data to mongo?

i tried in another way like
1. loaded base table
2. updated with the second table using Save method which take 3.5 hours to update 2 million documents.( i need to do all other 41  tables and this is time taking process)

please help me in this regard.

Thanks

Gianfranco

unread,
Oct 2, 2012, 9:19:00 AM10/2/12
to mongod...@googlegroups.com
Are you running those stored procedures to create a non-relational model?

Mongoimport can import json and csv files.

abdul kadar

unread,
Oct 4, 2012, 12:56:04 PM10/4/12
to mongod...@googlegroups.com
yes, then i form the document structure from .net application and saving into mongo..

if 1 table data refresh happen then can i update that table information alone in mongo?is it advisable?

Thanks
Abdul Kadar

Gianfranco

unread,
Oct 5, 2012, 5:32:37 AM10/5/12
to mongod...@googlegroups.com
Mongo is a NoSQL database meaning the schema-less nature does not enforce any structure on "tables" or "collections".

Basically there is no CREATE TABLE or ALTER TABLE equivalent commands in Mongo.

If you want to add data into a field which is a string, just insert it. Delete it etc.

The only thing you'll need to change is perhaps in the application, when retrieving those records in a different schema/field names.

Perhaps if you're more familiar with SQL, this table will help you understand better how do the same things you're familiar with:
Reply all
Reply to author
Forward
0 new messages