Hi guys:
I've got experience in several Java Enterprise projects, but I'm newbie
in ruby. I'm designing and coding the first bricks of a backend and I need
some advice.
The system is just a backend. Receives calls (mostly POST) with JSON
messages and returns JSON messages. The system use a MongoDB database. All
the calls are synchronous. Each call must consume a few seconds; these are
very fast calls because there's no much bussines rules, just store an
retrieve.
I've started using webrick (plain, without rack) but I read that has
slow performance and it's no good for production. I read about thin, its
performance, and I started to migrate the code.
I have doubts about configuration. The system will be running in virtual
machines on a cloud provider. I read about thin is not a multithread
server. If I got a virtual machine with, for example, 4 virtual CPUs and
8GB of RAM (and the database is running in other virtual machine), how many
thin servers could run in this machine?
Could you provide me a sample code for that?
In my experience using java, for processing fast calls is better got
several smaller virtual machines instead a few powerful virtual machines.
Do you think this can be the same using a ruby+thin implementation?
Do you think is necessary install and configure a web server like Nginx?
It's just a rest API without any static content.
Thanks in advance.