# Remote Data - Best Approach?

**URL:** <https://www.ruby-forum.com/t/remote-data-best-approach/174176>\
**Category:** Rails\
**Created:** [August 21, 2009, 7:33pm UTC](https://www.ruby-forum.com/t/remote-data-best-approach/174176 "2009-08-21T19:33:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@sams](https://www.ruby-forum.com/u/sams)\
**Post date:** [August 21, 2009, 7:33pm UTC](https://www.ruby-forum.com/t/remote-data-best-approach/174176/1 "2009-08-21T19:33:11Z")

</div>

Hi,

I’m new to Ruby on Rails. I must admit, the Ruby language is quite  
straightforward for me, but the Rails thing has me a bit confused. Here  
is my problem, I can’t quite figure out what the best approach would be.

I have data in various tables on a server X running Windows, IIS and MS  
SQL Server which I control and which is not accessible to the public.  
Separately, I have Ruby on Rails setup on a linux webhosting service  
elsewhere.  
I need to make a web interface (secure with HTTPS and Login) on the  
linux webserver which in turn accesses and manipulates the data on the  
Windows machine.

From what I read about Ruby on Rails, it is difficult to interface with  
existing systems, as there are rigid rules on the way the database  
should be built (for example the required ID field in every table). I  
get the impression that Rails are mostly suited for standalone webserver  
applications. That is my impression, but I’m pretty sure I’m wrong. So  
before giving up on Rails I decided to join this forum and ask for some  
advice. My other option is to build my web interface in PHP. But I like  
the idea of high level rapid development and am willing to learn Ruby  
and Rails.

Idealy in Rails I would use standard HTTP POST (or xmlhttprequest) on  
the backend to send requests from the webserver to the windows machine.  
I would like my windows machine to be considered as a datasource but  
using HTTP instead of SQL directly to manipulate the remote data (IIS on  
the windows box would do the actual SQL bits).

Or is there a better strategy?

Thanks for your help!!!

Sam

---

<div class="post-metadata">

**Author:** ![sams](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e79b87/32.png) [@sams](https://www.ruby-forum.com/u/sams)\
**Post date:** [August 21, 2009, 8:34pm UTC](https://www.ruby-forum.com/t/remote-data-best-approach/174176/2 "2009-08-21T20:34:12Z")

</div>

On Aug 21, 2009, at 10:33 AM, Sam Souvlaki wrote:

> with  
> and Rails.
> 
> Idealy in Rails I would use standard HTTP POST (or xmlhttprequest) on  
> the backend to send requests from the webserver to the windows  
> machine.  
> I would like my windows machine to be considered as a datasource but  
> using HTTP instead of SQL directly to manipulate the remote data  
> (IIS on  
> the windows box would do the actual SQL bits).
> 
> Or is there a better strategy?

Sounds reasonable to me. Do some research into ‘REST’ and ‘restful  
interfaces’ and ‘Active Resource’. You don’t have to use REST… you  
can use SOAP or XML-RPC or work up your own. But there’s some nice  
stuff in Rails for making a model that normally talks directly to a  
database talk to a RESTful server without your code needing to know  
anything…

-philip
