Replication from Sql Server to RavenDB?

188 views
Skip to first unread message

DanPlaskon

unread,
Sep 22, 2014, 11:18:34 AM9/22/14
to rav...@googlegroups.com
I know that RavenDB has the in-built capability to replicate FROM RavenDB TO SQL Server  using SQL Replication (as outlined here: http://ayende.com/blog/168482/what-is-new-in-ravendb-3-0-sql-replication) - but I'm curious...does a solution exist for doing the opposite?

Kijana Woodard

unread,
Sep 22, 2014, 11:46:28 AM9/22/14
to rav...@googlegroups.com
Usually I just write a small console app that polls SQL Server and pushes data in using BulkInsert.

AFAIK, there aren't [reliable] hooks to get change notifications out of SQL Server.

Even still, you probably don't want sql server polling code sitting in your raven db. The FROM case works because raven knows what changed inside itself. In the other case, it'd have to be trying to guess if there are updates in sql server.

From experience, that code changes more often than you'd want to tinker with your database.

On Mon, Sep 22, 2014 at 10:18 AM, DanPlaskon <dpla...@gmail.com> wrote:
I know that RavenDB has the in-built capability to replicate FROM RavenDB TO SQL Server  using SQL Replication (as outlined here: http://ayende.com/blog/168482/what-is-new-in-ravendb-3-0-sql-replication) - but I'm curious...does a solution exist for doing the opposite?

--
You received this message because you are subscribed to the Google Groups "RavenDB - 2nd generation document database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ravendb+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Oren Eini (Ayende Rahien)

unread,
Sep 23, 2014, 5:01:55 AM9/23/14
to ravendb
Note that you'll need to shape the data differently in both databases.
In RavenDB we can do that using the scripts to transform from a document model to relational model. There isn't anything on the other side that we can do to help there.

Hibernating Rhinos Ltd  

Oren Eini l CEO Mobile: + 972-52-548-6969

Office: +972-4-622-7811 l Fax: +972-153-4-622-7811

 

DanPlaskon

unread,
Sep 23, 2014, 7:38:55 AM9/23/14
to rav...@googlegroups.com
Oren and Kijana,

That makes perfect sense - thanks!

For a bit of background, I'm looking at using RavenDB as a search server overtop of a brownfield application backed by SQL Server - has anyone heard of anyone doing something along these lines before?

Oren Eini (Ayende Rahien)

unread,
Sep 23, 2014, 7:47:19 AM9/23/14
to ravendb

I'm going to be doing a conference talk about this specific topic in the Twin Cities Code Camp in a couple of weeks

DanPlaskon

unread,
Sep 23, 2014, 7:49:07 AM9/23/14
to rav...@googlegroups.com
Nice! Is it too much to hope that it'll be recorded? ;)

Itamar Syn-Hershko

unread,
Sep 23, 2014, 7:49:23 AM9/23/14
to rav...@googlegroups.com
RavenDB isn't really a good fit as a search server, you better be looking at Elasticsearch or Solr

--

Itamar Syn-Hershko
http://code972.com | @synhershko
Freelance Developer & Consultant

Kijana Woodard

unread,
Sep 23, 2014, 1:48:06 PM9/23/14
to rav...@googlegroups.com
I did exactly that recently for a client. 

I wrote a console app as described above to move a couple million rows into ~50k documents and performed basic search. The console app would keep the raven db in sync by polling sql server. Only took a couple days to get rolled out with most of that integrating with the very brown brownfield application. :-D
Reply all
Reply to author
Forward
0 new messages