Where to start for developing a service REST API?

M

Markus Fischer

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
 
B

Brian Candler

Markus said:
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 :) 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.
 
M

Markus Fischer

Hi Brian,

Look at Sinatra. You'll be amazed what you can build with three lines of
code :) 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top