

Clojure and Rails - the Secret Sauce Behind FlightCaster (YC S09) - zemariamm
http://www.infoq.com/articles/flightcaster-clojure-rails

======
patio11
I think a lot of people could benefit from Rails as, essentially, a
presentation layer for a larger system. I sort of sleepwalked into it in my
own project: my Rails site is just the presentation layer for long-running
Prawn-based PDF export jobs.

That could just as easily be the sort of batch processing Big Freaking Java
Enterprise stuff we do at the day job -- we'd spend 1/10th the time on writing
screens and action classes and still be able to use that ridiculously
overpriced report generation library we're married to.

Wait a second... that needs to get brought up on Monday at work.

~~~
acangiano
A spectacular combo is JRuby on Rails for the "front-end" and Scala for the
heavy lifting.

~~~
tulsidas
interacting only through db?

~~~
smhinsey
If I were going to do this I would integrate input from user actions as
messages using a serialization like Thrift or ProtocolBuffers and likely an
AMQP transport. This allows you to hook into the system in a number of places
with whatever language makes the most sense. Getting data to the presentation
layer is going to be really dependent on what type of data you're dealing with
so it's hard to give a pat answer to that, but in the most basic of cases, you
can continue to use a messaging based approach and combine it with a
distributed hashtable/cache system.

This approach allows you to hide the data models of both parts of the system
from one another so you don't end up back in the hell of integrating via the
database, which is what I suspect you were driving at with your question. You
obviously can't avoid having to share some information between systems, but in
this model you can share message and service contracts rather than database
schema.

~~~
phildawes
That's smells a bit of architecture astronaut to me if you don't mind me
saying. Sharing information between systems is a tradeoff (vs arch
complexity), not something to be avoided at all costs.

~~~
smhinsey
It certainly is not appropriate in every circumstance, but it can make a lot
of sense for larger applications where you might have different people or even
teams responsible for different parts of the application.

------
mrduncan
Here is a previous discussion on FlightCaster's architecture in case anyone
missed it: <http://news.ycombinator.com/item?id=772808>

------
peregrine
My question is why wouldn't someone want to use something like Compojure so
they can use Clojure exclusively?

~~~
zach
And lose all the Rails infrastructure, plugins and functionality? After all,
Rails is actually a collection of technologies and perfectly usable as a
presentation layer alone. And hey, once we've put Lisp on the JVM, why not
Clojure on Rails?

