Moving from .Net/Java to Rails

Hello,

First let me thank you for your willingness to aid me in my efforts to
use Ruby (on Rails) in our company to replace existing and fureture
planned development in .Net and Java.

I have been working on an appication for a couple of years that has been
written in .Net using C#, but due to a short list of reasons we are
seriously thinking about re-writing our web application in Rails – or
at least I am.

While we are evaluating our various options another well experienced
Java developer is pushing the use of Spring and Hybernate and I am
advocating the use of Rails. Two out of the three engineers – including
myself – have experience with rails but have not built large web
applications as of yet and need some more information about how we will
approach a couple of our unique problems with Ruby.

So here is one of the big issues that we are facing and I wondered if
any experts out there could give me some advice on ways we can handle it
and other more computation intensive operations using the rails stack.

We have 2.7 million geographic destinations in our application that are
currently stored in a memory cache and are used throughout our
application heavily. This is used for finding nearby destinations,
getting destination heigharchy information, etc. We also have a ajax
auto complete feature that does a prefix match on the cached
destinations.

Any advice or information about how to handle these types of problems
would be very helpful.

Thanks so much!

As far as the problem of storing your 2.7m geographic destinations is
concerned, the first thing that occurs to me is “RAM disc”. Are you
able to create a RAM disc, load your data into it, then just read it
from there as you need it?

For the AJAX auto-complete feature, if you hunt around you’ll find an
AJAX search example that (from memory) searches for peoples’ names.
As you type in ‘sam’ (for example) in your search field, the database
gets hit with e.g. 'SELECT NAME WHERE NAME LIKE ‘s%’, then 'SELECT
NAME WHERE NAME LIKE ‘sa%’, then 'SELECT NAME WHERE NAME LIKE ‘sam%’.
Every time the content of your search field changes, it triggers a new
database search with whatever the content of the field is at that
point in time.

One example is http://snippets.dzone.com/posts/show/1691, another is
Radar – O’Reilly
(look under the ‘Using Observers’ section, another is
Ajax on Rails • The Register

I’ve built this type of ‘active search’ myself from these examples;
it’s VERY cool when you get it going, and you can get it going in a
very short period of time. When I first demo’ed it, people shifted
180 degrees from “Why should we bother with this Rails stuff?” to “Let
me at it”.

Regards

Dave M.

Am 27.02.2007 um 07:03 schrieb Paul H.:

We have 2.7 million geographic destinations in our application that
are
currently stored in a memory cache and are used throughout our
application heavily. This is used for finding nearby destinations,
getting destination heigharchy information, etc. We also have a ajax
auto complete feature that does a prefix match on the cached
destinations.

Any advice or information about how to handle these types of problems
would be very helpful.

Some pointers:

If you need a memory cache, have a look at http://www.danga.com/
memcached/
Have a look at http://dev.robotcoop.com/Libraries/ for plugins and libs.

Rails also has great caching features built-in:

Rails includes support for the script.aculo.us autocompleter–
basically, it’s two lines of code and you’re there. Of course you can
customize, too.
Demos and example code:
http://demo.script.aculo.us/ajax/autocompleter
http://demo.script.aculo.us/ajax/autocompleter_customized

Best,
Thomas

On 2/27/07, Paul H. [email protected] wrote:

at least I am.
and other more computation intensive operations using the rails stack.
Ruby really isn’t the best language for computation intensive work. Of
course you could still do the front end in rails, just hand off the
heavy lifting to a Java powered web service.

We have 2.7 million geographic destinations in our application that are
currently stored in a memory cache and are used throughout our
application heavily. This is used for finding nearby destinations,
getting destination heigharchy information, etc. We also have a ajax
auto complete feature that does a prefix match on the cached
destinations.

Rolling your own GIS system? Any reason why you can’t use e.g. PostGIS?

Isak