Search code examples
sql-server-2008nosqlravendbdatabase-performance

Speedy way to send Sql Data to RavenDB?


I created a console application which sends data from a Sql Database to RavenDB.

I have a freakish amount of data to transfer, so it's taking an incredibly long time. (1,000,000 rows takes RavenDB about 2 hours to store)

RavenDB takes longer to import the data than is collected from Sql Server by the Console application.

Is there any way to speed up the transfer or perhaps an existing tool which does this already?

        using (var session = this._store.OpenSession())
        {
            //row.Count is never more than 1024
            while (i < row.Count)
            {
                session.Store(row[i]);
                i++;
            }
            session.SaveChanges();
        }

Solution

  • Could you post the code where you insert to RavenDB, this is likely where the bottleneck lies. You should be making requests concurrently.

    Setting:

    HttpJsonRequest.ConfigureRequest += (e,x)=>((HttpWebRequest)x.Request).UnsafeAuthenticatedConnectionSharing = true; 
    

    As well as processing your insert records in a batch.

    As for insert performance you'll likely never match SQLServer as RavenDb is optimized for read vs write.