# Where to start for developing a service REST API?

**URL:** <https://www.ruby-forum.com/t/where-to-start-for-developing-a-service-rest-api/194768>\
**Category:** Ruby\
**Created:** [September 10, 2010, 8:05am UTC](https://www.ruby-forum.com/t/where-to-start-for-developing-a-service-rest-api/194768 "2010-09-10T08:05:33Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Markus\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@Markus\_F](https://www.ruby-forum.com/u/Markus_F)\
**Post date:** [September 10, 2010, 8:05am UTC](https://www.ruby-forum.com/t/where-to-start-for-developing-a-service-rest-api/194768/1 "2010-09-10T08:05:33Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Markus\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@Markus\_F](https://www.ruby-forum.com/u/Markus_F)\
**Post date:** [September 10, 2010, 9:29am UTC](https://www.ruby-forum.com/t/where-to-start-for-developing-a-service-rest-api/194768/2 "2010-09-10T09:29:22Z")

</div>

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 🙂 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.

---

<div class="post-metadata">

**Author:** ![Markus\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c4cdca/32.png) [@Markus\_F](https://www.ruby-forum.com/u/Markus_F)\
**Post date:** [September 10, 2010, 5:02pm UTC](https://www.ruby-forum.com/t/where-to-start-for-developing-a-service-rest-api/194768/3 "2010-09-10T17:02:24Z")

</div>

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 🙂 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
