views:

343

answers:

5

Is it architecturally sound to use Rails and Oracle? My concern is that Oracle would be too "heavy and hi-end" for Rails. Any thoughts? Thanks.

+1  A: 

Why too heavy? Oracle it's just a database that can be simple to heavy depending on your use. Today Oracle have a lot of editions to accomodate any use, for instance the little one Oracle XE.

If your are happy with Oracle, use it. Don't worry.

FerranB
+1  A: 

The problem that you may suffer when using Oracle as Database is you can't find many hosting companies offering oracle as choice for your database on web.

also oracle like a giant DB, if you don't need the specific features in it, why use it?

Mohammed Nasman
Getting an Enterprise, Partitioning, Data Mining, OLAP etc license isn't actually compulsory with Oracle ... they're options. Use XE or SE and you have a very price competitive platform.
David Aldridge
Ditto, mon frère
+7  A: 

The database needs of Rails more or less boil down to tables, indices and CRUD.

Anything that provides those ought to be able to serve as the back-end to a Rails app, and Oracle certainly does those parts somewhere among the bloat vast range of features it provides. If you can use ActiveRecord migrations then you shouldn't need to worry too much about platform-specific aspects anyway.

The oracle-adapter for ActiveRecord (which needs to be downloaded separately and placed in activerecord\lib\active_record\connection_adapters, btw) makes use of Oracle-specific elements where appropriate, the main one I can think of being the use of sequences for id generation.

The Oracle query optimiser is very smart, probably rather better for complex multi-table queries than, say, MySQL.

If you're looking at Oracle as a back-end for an externally-hosted site, then I'd be sceptical on cost grounds, as well as the reservation already stated about availability. But I suspect that the question relates more to what's already available in-house, in which case I'd say it's about as "good" a solution as you can get.

I'm developing intranet applications on Rails/Oracle, using OracleXE locally for development, deploying to some "big iron" machine (it's someone else's job to care for it, I don't even know what OS it's running) for production.

EDIT: It's worth looking at the activerecord-oracle_enhanced-adapter (it's a gem) as a replacement for the built-in oracle adapter, if only for the improved handling of date/datetime values (Oracle only has one column type for both: DATE). It's probably saved me from a breakdown...

Mike Woodhouse
Thanks, Mike, very helpful.
Valentin Vasiliev
Not sure how a server gets bloated... Interfaces like MSWord is so full of crap it's hard to find useful things to use. But servers, you don't have to type DBMS_AQADM.CREATE_QUEUE_TABLE. The package exists, use it or don't... but that's not bloat.
A: 

I'm currently using Oracle with some Rails applications. There are both standard ActiveRecord and JDBC-ActiveRecord adapters (I'm hosting some apps with JRuby) and for the most part, things work great.

I would suggest using the enhanced ActiveRecord Oracle adapter though.

http://rubyforge.org/projects/oracle-enhanced/

But if you're not locked into Oracle, go with Postgres or MySQL.

mwilliams
Why? Why recommend the switch? I recommend he stays. So there. At least offer a few bullets why. Unsubstantiated recommendations have little use. I'm an Oracle guy but I'm open to learning.
Oracle is expensive. Yes, there's the free XE edition but for what it's worth, a quick Postgres or MySQL install is going to get you better mileage. I've had better luck with the ActiveRecord drivers for Postgres and MySQL than Oracle. Oracle also lacks the community. Keep it to Corporation IMO.
mwilliams
A: 

Another thing to consider regarding Oracle and Rails: none of the full text searching plug-ins for Rails support Oracle at this time. Indeed, pretty much only MySQL and PostgreSQL are well-supported by the various full-text options.

This is not to say you won't be able to do full-text searching if you use Oracle, just that you will not be able to use any of the existing plug-ins that make doing so simple.

Alderete
Ah, Thanks Alderete. Now I know one reason a Rails developer may want to switch.