Mid-level Track Roadmap

Solid Queue: database-backed

This course looks at how Solid Queue, Solid Cache and Solid Cable connect to the database in a Rails app. Each one declares its own connects_to, so every process holds four connection pools: primary, queue, cache and cable. Development and test point those pools at four separate Postgres databases. Production puts primary, queue and cable in one database and gives the cache its own. The lessons also cover the connection cost of that shape, how db:prepare finds each schema file, and why each environment differs.

What you'll learn

  • ✓How connects_to gives each Solid gem its own connection pool
  • ✓Why development and test use four separate Postgres databases
  • ✓Why production shares one database for primary, queue and cable but splits out the cache
  • ✓What extra pools against one Postgres server cost in connections
  • ✓How db:prepare loads each role's schema file and what migrations_paths is for
  • ✓Why pool count and database count are independent questions
Free preview · Lesson 1 2 min read

connects_to and four real connection pools

The mid-level course "Solid Queue: job architecture" looked at eleven tables: solid_queue_jobs, its claims, its concurrency rows. None of them is reached through ApplicationRecord. They sit behind SolidQueue::Record, a different base class on a different connection. This lesson looks at that…

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...