[ANN] Introducing SwitchTower: Distributed deployment for Rails

David Heinemeier Hansson [mailto:david.heinemeier@gmail.com] :

#SwitchTower is a utility for executing commands in parallel on
#multiple machines. It lets you (among many other things) deploy
#distributed applications with a single command.

···

#
#When your application is young you may be deploying it to a single
#machine, which runs the web server, app server, and database all
#together. In this situation, deploying manually is not unbearably
#painful. But as your application grows you may find yourself needing
#to deploy your application to two web servers, four app servers, and
#two database servers, atomically. This is where SwitchTower steps in
#as a pain-killer.
...

i'm a nuby on rails/ruby/web and i've played w your magical rails framework. It is really amazing. My q is: Assumming i just have the sample rails running on one host, and i want it to raise to 3 tiers on 3 hosts (web, app, db), would switchtower take care of the division by just pointing what host to put the web to, the app to, and the db to? The reason i am asking is that i do _not_ know anything about the application layer part (since i just see the rails app as just one coherent stand alone application) and i want to see what is the application layer side, the web side, and the db side.

sorry for the dumb newbie question.

thanks for rails and kind regards -botp

The difference between the "web" and "application" layers are this: the "web" layer is simply the web server (without anything rails-specific) and the "application" layer is (for instance) the set of FCGI listeners. Using lighttpd (or getting clever with apache/haproxy) you can have multiple stand-alone FCGI listeners running on one machine, with the web server running on another machine and sending the requests to the listeners.

You can use the spawn-fcgi utility (it comes with lighttpd, but it isn't lighttpd-specific) to launch new FastCGI listeners. To make things simple, you can use the spinner and spawner utilities that come with Rails (and which wrap the spawn-fcgi utility). Check out the SwitchTower manual for info on how to use these.

As for configuring lighttpd and apache to communicate with independently spawned fastcgi listeners, you'll need to check out the docs for those.

It definitely isn't as simple configuring a setup like this as it is to just let the web server manage the listeners, but it scales much further. That said--don't try scaling before you need it. Keep things as simple as possible, for as long as possible, and you'll save yourself a lot of grief in the long run.

- Jamis

···

On Oct 21, 2005, at 6:53 PM, Peña, Botp wrote:

David Heinemeier Hansson [mailto:david.heinemeier@gmail.com] :

#SwitchTower is a utility for executing commands in parallel on
#multiple machines. It lets you (among many other things) deploy
#distributed applications with a single command.
#
#When your application is young you may be deploying it to a single
#machine, which runs the web server, app server, and database all
#together. In this situation, deploying manually is not unbearably
#painful. But as your application grows you may find yourself needing
#to deploy your application to two web servers, four app servers, and
#two database servers, atomically. This is where SwitchTower steps in
#as a pain-killer.
...

i'm a nuby on rails/ruby/web and i've played w your magical rails framework. It is really amazing. My q is: Assumming i just have the sample rails running on one host, and i want it to raise to 3 tiers on 3 hosts (web, app, db), would switchtower take care of the division by just pointing what host to put the web to, the app to, and the db to? The reason i am asking is that i do _not_ know anything about the application layer part (since i just see the rails app as just one coherent stand alone application) and i want to see what is the application layer side, the web side, and the db side.