Understanding Rails

Understanding Rails · Season 1: The trip of one click

Rails 8 in production

Episode 8 · overview · about 2 minutes · Rails 8.1 · by

How was this episode?

The series' author reads every note, and no one else sees it. When something is wrong or unclear, it gets fixed and the episode re-cut. How this series stays right.

Was it clear?

Not endorsed yet. Are you a Rails developer? What's an endorsement?

Endorse this version To endorse: create an account, confirm your email, then link GitHub.

What changed

  • Version 2, November 20, 2026: Kamal needs kamal setup before the first deploy, and the free HTTPS certificate needs the proxy's SSL setting on.

The Solid trio, Propshaft, import maps, the auth generator, Kamal.

Free to watch. If it helped, support the series.

Transcript

0:00 Rails 8 in production

Part eight. Rails 8 in production.

Rails 8 is built so one developer can take an app all the way to production, on a plain server, without renting a stack of extra services.

0:17 The Solid trio

Three new pieces make that work, and all three keep their data in the database you already have. Solid Queue runs background jobs. Solid Cache keeps cached pages and fragments. And Solid Cable carries the live updates from part seven.

Before, each of these usually meant running Redis as well. Now, that's one less thing to run.

0:40 A file per database

In production, each one gets its own SQLite file, right beside your main one.

0:47 Propshaft and import maps

The front end comes ready, too. Propshaft serves your images and stylesheets, and import maps let the browser load your JavaScript directly, with no build step.

0:58 Authentication

Signing in is one command away. The authentication generator writes users, sessions, and a password reset, as plain code you own.

1:08 Kamal

And to ship it, there's Kamal. Point it at a server, run kamal setup the first time, and kamal deploy after that. It builds your app into a container, starts it, and swaps it in with no downtime. Turn on its SSL setting, and it gets a free certificate for HTTPS.

Check your understanding

  1. A new Rails 8 app runs in production. Where does Solid Queue keep its jobs?

    • In Redis
    • In Puma's memory
    • In its own SQLite file, storage/production_queue.sqlite3
    • In a folder of JSON files under tmp
    Show answer

    In its own SQLite file, storage/production_queue.sqlite3. The new app's production database config gives the queue, the cache and cable each their own SQLite file next to the main one. Source: The new app's SQLite config/database.yml template (Rails source, v8.1.4.1).

  2. Live updates used to need Redis to pass messages between processes. What does Solid Cable use instead?

    • The app's database
    • The browser's local storage
    • A second Puma server
    • Kamal's proxy
    Show answer

    The app's database. Solid Cable replaces Redis as the pubsub server and keeps the messages in the database, for a day by default. Source: Solid Cable, Ruby on Rails 8.0 Release Notes (Rails Guides 8.1).

  3. Your app uses import maps. What has to run before the browser can load your JavaScript?

    • A webpack build
    • Node.js and Yarn, to bundle the files
    • A TypeScript compiler
    • Nothing extra: there is no build step
    Show answer

    Nothing extra: there is no build step. With import maps the browser loads the modules itself. No separate build process and no Node.js are needed. Source: Import Maps, Working with JavaScript in Rails (Rails Guides 8.1).

  4. You run kamal deploy while people are using the app. How does Kamal avoid downtime?

    • It stops the old container, then starts the new one
    • kamal-proxy moves requests from the old container to the new one once the new one is ready
    • It asks users to reload the page
    • It deploys only at night
    Show answer

    kamal-proxy moves requests from the old container to the new one once the new one is ready. Kamal starts the new version beside the old one, and kamal-proxy moves the traffic across without downtime. Source: kamal deploy (Kamal documentation).

Sources

Comments

Sign in to comment or sign up.