When you're just writing Controllers and Models day to day, you don't really think about what's running underneath Rails.
But the moment you try to add an "always-connected" feature like real-time chat or notifications to a Rails app , suddenly people start saying things like "Unicorn doesn't play well with that" or "Action Cable handles it fine."
In this post, I'll lay out the machinery under Rails that you need to make sense of those conversations, using a restaurant as the analogy.
1. Rack: the standard order ticket format
Rack is the common agreement that connects Ruby web servers and web apps .
Any object that has call(env) and returns [status, headers, body] is a Rack app
class HelloApp def call ( env ) [ 200 , { 'content-type' => 'text/plain' } , [ 'Hello' ] ] end end
Enter fullscreen mode
Exit fullscreen mode
In restaurant terms, it's the order ticket format .β¦