Where to start for developing a service REST API?

Hi,

I’m toying with the idea of a private project which exposes a HTTP REST
API. It will not start out with any HTML/UI stuff at first and will be
strictly json (because a desktop client already exists), although a HTML
UI /may/ be developer later to ease things.

Now I don’t know if it’s a good idea to start off with Rails for such a
thing (honestly, I really want to keep things small) but if not Rails,
I’m actually lost as in that case what alternatives are generally
available.

In the end I indent it to run it over my Apache which already provides
my HTTPS and authentication infrastructure; but I don’t mind if it
doesn’t run within Apache and I just need to proxy the request to some
custom Ruby server.

Some starting points would be very helpful.

thanks,

  • Markus

Markus F. wrote:

Now I don’t know if it’s a good idea to start off with Rails for such a
thing (honestly, I really want to keep things small) but if not Rails,
I’m actually lost as in that case what alternatives are generally
available.

Look at Sinatra. You’ll be amazed what you can build with three lines of
code :slight_smile: The framework itself is basically one source file and easy to
understand in its entirety.

In the end I indent it to run it over my Apache which already provides
my HTTPS and authentication infrastructure; but I don’t mind if it
doesn’t run within Apache and I just need to proxy the request to some
custom Ruby server.

Look at Phusion Passenger, which will let you run any Rack-based app
(including Rails and Sinatra apps) within Apache, automatically taking
care of starting and stopping app processes as required.

It starts processes by first making a template process and then forking
it whenever a new child is required. If you combine it with Ruby
Enterprise Edition (Ruby with copy-on-write-friendly garbage collector)
then you’ll also get a lot more memory sharing between these processes.

Hi Brian,

On 10.09.2010 09:29, Brian C. wrote:

Look at Sinatra. You’ll be amazed what you can build with three lines of
code :slight_smile: The framework itself is basically one source file and easy to
understand in its entirety.

You’re right, I’m definitely amazed. It’s incredible how easy things can
work.

Look at Phusion Passenger, which will let you run any Rack-based app
(including Rails and Sinatra apps) within Apache, automatically taking
care of starting and stopping app processes as required.

It starts processes by first making a template process and then forking
it whenever a new child is required. If you combine it with Ruby
Enterprise Edition (Ruby with copy-on-write-friendly garbage collector)
then you’ll also get a lot more memory sharing between these processes.

Thanks for the future pointers, I’ll see how far I can really get with
the Sinatra app, this looks really very well suited.

thanks,

  • Markus

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs