0
votes

What I've learned:
1. activerecord-sqlserver-adapter can be used to connect a RoR app to an SQL Server by simply changing the database.yml file. Much respect to Ken Collins (http://www.engineyard.com/blog/2011/modern-sql-server-rails/)
2. Nick Hill has showed us how to host a RoR app in a Windows Azure web role (http://blogs.msdn.com/b/mcsuksoldev/archive/2010/02/26/9969876.aspx)
3. Wely Lau, in "How to establishing virtual network connection between cloud and on-premise with Windows Azure Connect (Part 2–Preparing the application)", has showed us how to setup a virtual network connection between a Windows Azure web role and an on-premise SQL server with Windows Azure Connect. Specifically, Wely establishes the on-premise SqlDataSource in step 2 and 3 of her article. I would post a link, but i'm such a newb to stackoverflow, that i'm only allowed to post 2 links :(

Anyway, what I'm trying to figure out:
4. How to connect a RoR app, hosted in a Windows Azure web role, to an on-premise SQL Server using a virtual network connection with Windows Azure Connect (i don't think it's as simple as changing the database.yml file to point to the on-premise database unfortunately)

I feel like the ingredients are there, but can't figure out how to cook the meal so to speak. For some context, my app users are grouped into teams and it's necessary that teams be able to specify exactly where their databases reside (e.g. either in the cloud or on one of their own servers) - hence the RoR/Azure thing, otherwise, Heroku would be my host.

An alternative I've been considering is to distribute a separate copy of the app for those teams who wish to use their own databases and host it themselves, in which case, i'm all set. However, I fear that could become messy quickly as I think about future updates and developer happiness.

Appreciate your thoughts.

3

3 Answers

0
votes

Once you've got Connect set up (mostly consists of installing the agent on your database server), it should indeed be as simple as changing database.yml. Why do you think it's harder than that?

0
votes

Your main problem will be network latency (ie. long timeouts) and connection failures on the on-premise side, not setting up Azure Connect. You should at least consider using a SQL Azure database that syncs with your on-premise db. This will also be cheaper in terms of bandwidth.

0
votes

The Latest v3 SQL Server Adapter now supports Azure http://groups.google.com/group/rails-sqlserver-adapter/browse_thread/thread/50dc2108c4fda584?hl=en

You must use the latest DBLIB/TinyTDS connection mode which also means you must use the latest FreeTDS compiled with OpenSSL. All the details are here.

https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-Azure https://github.com/rails-sqlserver/activerecord-sqlserver-adapter/wiki/Using-TinyTDS