What is New in RavenDB 3.0: SQL Replication
Join the DZone community and get the full member experience.
Join For Free
sql replication has been a part of ravendb for quite some time, showing up for the first time in the 1.0 build as the index replication bundle. this turned out to be a very useful feature, and in 3.0 we had a dedicated developer for this for several weeks, banging it into new and interesting shapes.
we started out with a proper design for how you want to use it. and i’m just going to take you through the process for a bit, then talk about the backend changes.
we start by defining a named connection string (note that you can actually test this immediately):
and then we define the actual replication behavior:
note that we have the tools control in the top? clicking it and selecting simulate will give you:
so you can actually see the commands that we are going to execute to replicate a specific document. that is going to save a lot of head scratching about “why isn’t this replicating properly”.
you can even run this simulation against your source db, to check for errors such as constraint violations, etc.
the sql replication bundle now support forcing query recompilation, which avoid bad query plans caching in sql server:
and for the prudent dba, we have done a lot to give you additional information. in particular, you can look at the metrics and see what is going on.
and:
in this case, i actually don’t have a relational database on this machine to test this, but i’m sure that you can figure it out.
the nice thing about it, we’ll report separate metrics per table, so your dba can see if a particular table is causing a slow down.
overall, we streamlined everything and tried to give you as much information upfront as possible, as well as tracking the entire process. you’ll find it much easier to work with and troubleshoot if needed.
this actually ties very well with our next topic, the operations changes in ravendb to make it easier to manager. but that will be in the a future post.
Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments