0

Why is it commonplace to use the next architecture?

Client (e.g: browser) --> Nginx --> Puma --> Rails App

I think that we can go without using Puma at all since it's also an HTTP server as Nginx with less capabilities.

Having Puma in the middle, is having a second HTTP server, and we already have Nginx that handles HTTP requests.

The only thing that Nginx would lack instead is a Rack interface to communicate with Rails, but that just a matter of implementing an Rack adapter for it.

So instead we can have this and eliminate redundancy:

Client (e.g: browser) --> Nginx --> Rails App

Basically what am I missing here? Puma knows how to handle various Rails processes? If so, then Nginx can create several worker_processes also.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Leonardo
  • 63
  • 8
  • You may be underestimating the complexity of "just a matter of implementing a Rack adapter" (see phusion passenger for example) – Frederick Cheung Sep 16 '16 at 15:09
  • I couldn't even underestimate it, because to begin with, I was not even able to discern their roles so I was not sure what roles each component fulfilled. Now I do and it makes sense (refer to my "edit" part of my question) for more info – Leonardo Sep 16 '16 at 15:31

0 Answers0