Re: RoundhousE for RavenDB

94 views
Skip to first unread message

j.barrett strausser

unread,
Dec 7, 2012, 12:09:25 PM12/7/12
to chucknorri...@googlegroups.com
I disagree, that this should be added to RoundhousE.

I run RavenDB in production and the semantics just differ too much for them to share an api.  To really effectively emulate the DDL and DML capability you would have to replicate the Raven.Client capability otherwise how would you say things like


var docs  =               from doc in session.Query<TYPE>()
                                   where predicate
                                   select doc;


That's obviously easily accomplished in SQL. Not sure how you do that in your tool? Are you prepared to support the different bundles? Replications? Versioning?

Would the tool support Restores? How would it accomplish that? Using the smuggle api or copy files? Are the maintainers willing to learn about ESENT?


SQL is SQL and NoSQL obviously isn't. Will Roundhouse then be expected to support MongoDB or any other JSON Database? Why can't we just let the tool one job well?


Not hating. Just don't think it works in RoundhousE.


-barrett


On Fri, Dec 7, 2012 at 4:54 AM, Jochen Jonckheere <jochen.j...@jxk.be> wrote:
Hi,

This week a colleague and I have forked RoundhousE and added the ability to migrate or 'kick' a RavenDB instance.

Why an external migration tool?
After experimenting with RavenDB and doing migrations in the Application_Start of the web application. Users started complaining that the application took a lot of time before it showed the first screen. The complaint always came from the user how was the first to open the application in the morning. The cause was our migration code, it shouldn't run at every start of the application but only on every new update of the application.

Why RoundhousE?
We have been using RoundhousE in our company for a few years now, both for SQL Server and Oracle. It is part of our software distribution and executed with every update.
In the past I've been contributing to RoundhousE, so I know the codebase a little.

How do sql scripts translate to RavenDB?
To do migrations with RoundhousE you need pass it multiple folders that have scripts in them. The content of those script files is read and passed to the database for execution. Those sql scripts contain actions we all know, like INSERT, DELETE, SELECT. If you translate those to RavenDB's http api, you get PUT/POST, DELETE, GET. Another part of sql script is the table you would like to use for your insert, select or delete, in RavenDB this is the document url.
The conclusion is that RavenDB has a script language just like sql and it is called the HTTP API (http://ravendb.net/docs/http-api?version=2).

How does the execution of scripts work?
The scripts we are executing look like those you can find in the RavenDB documentation (http://ravendb.net/docs/http-api?version=2):
curl -X PUT http://localhost:8080/docs/bobs_address -d "{ FirstName: 'Bob', LastName: 'Smith', Address: '5 Elm St' }"
We only remove curl -X, because it isn't curl that will execute the scripts, but RoundhousE.
RoundhousE will interpret the script and does a http PUT, GET, POST, PATCH or DELETE to the document url with the content of  the -d parameter as data. Even headers are supported with the -H parameter, just like curl.
An advantage is that the scripts can be run with curl, the same way the sql scripts we use with RoundhousE can be run with sqlcmd.

What about the RoundhousE tables?
These have been transformed to RoundhousE documents. There is a single Version document, and for each run of a script there is ScriptsRun and/or ScriptsRunError document.

What are the parameters I should pass to RoundhousE to use this?
There aren't any additional parameters. The databasetype should be set to ravendb or raven. The connectionstring is the one you use in your RavenDB application and must be in the form of Url=http://localhost:8080;Database=MyTenant.
RoundhousE supports 2 connectionstrings, normal and admin. I suggest you pass a database to the normal connectionstring and omit the database part for the admin connectionstring. Scripts that are run as admin are then executed against the system database. This is useful for the creation of a new tenant/database.

How is the document url in the script used?
A script like this:
PUT http://localhost:8080/docs/bobs_address -d "{ FirstName: 'Bob', LastName: 'Smith', Address: '5 Elm St' }"
Contains a document url with a server part, http://localhost:8080. This part is replaced by an url build from the connectionstring. If the connectionstring is the following Url=http://dropkick:81;Database=Chuck, the data will be put to http://dropkick:81/databases/Chuck/docs/bobs_address

Whats next?
Well the RoundhousE adjustments are still a branch of a fork of RoundhousE. It's there so that everybody can use it, but it would be nice if it got merged with the RoundhousE master. Not everything has been implemented, only the stuff we need for now are. Feel free to fork and fix bugs and add features.

Where is the code?

Regards,

Jochen

PS: This message has been cross-posted on the RavenDB group

--
You received this message because you are subscribed to the Google Groups "chucknorris" group.
To view this discussion on the web visit https://groups.google.com/d/msg/chucknorrisframework/-/xrQsPq-L1tAJ.
To post to this group, send email to chucknorri...@googlegroups.com.
To unsubscribe from this group, send email to chucknorrisframe...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/chucknorrisframework?hl=en.

Rob Reynolds

unread,
Dec 7, 2012, 12:42:08 PM12/7/12
to chucknorri...@googlegroups.com
This is really interesting! I can't wait to take a look at it.
____
Rob
"Be passionate in all you do"

http://devlicio.us/blogs/rob_reynolds
http://ferventcoder.com
http://twitter.com/ferventcoder

Rob Reynolds

unread,
Dec 7, 2012, 12:54:13 PM12/7/12
to chucknorri...@googlegroups.com
Restores are an interesting discussion. How do you handle a restore in Oracle? PostgreSQL? RoundhousE doesn't provide facilities for restoring in these environments for differing reasons.

A discussion over a year ago at Pablo's Fiesta, we talked about exactly this. As NoSQL becomes more prominent, should RH support it and if so, how would it go about supporting it.  We didn't come to a conclusion hard one way or another. 

I am interested in seeing how this works. And we welcome discussion on both sides of the argument.  Let's move that discussion to another thread though. I'll kick it off.

Rob Reynolds

unread,
Jul 14, 2014, 3:32:14 PM7/14/14
to chucknorri...@googlegroups.com
Bringing up an older discussion, have you thought about adding this as an extension dll for Roundhouse to add that database type? 

And then fixing the couple of places in RH where the extension DLLs are broken?
--
Reply all
Reply to author
Forward
0 new messages