The Rails infrastructure layer and its diversity
When we talk about the infrastructure layer of a Rails application, we mean all the tools and services that the application relies on and are not part of the business or presentation logic. Infrastructure components act as a low-level base upon which we build an application. What does this base consist of? The following list is not exhaustive but should be enough to give you an idea of what belongs to the infrastructure layer:
- Database adapters
- Third-party API clients
- Caching and storage systems (that is, Active Storage backends)
- Configuration providers (credentials, secrets, and so on)
- Background processing engines (for example, Sidekiq and GoodJob)
- Web servers (for example, Puma and Unicorn) and Rack middleware
- Logging and monitoring tools
As you can see, infrastructure spans the whole application and has different forms and factors. However, if we take a closer look at how Rails designs infrastructure...