Our previous article in this series established that Solid Queue is an excellent choice if you need a system for processing background jobs. It minimizes external dependencies — no need for Redis! — by storing all jobs in your database. Despite that, it is incredibly performant. But just being performant is not enough for a production-ready background job system. Rails developers have come to expect a lot over the years. We don't just want to enqueue jobs to run in the background. We want to schedule jobs, run them on a recurring schedule, and we might even want to limit how many jobs can run concurrently. We want more features! Amazingly, Solid Queue provides all of those features out of the box. Let's dive deeper into Solid Queue and learn how that's possible! Scheduling Jobs with Solid Queue for Ruby on Rails First, it's time for a small recap. Solid Queue uses your database — and only your database — to store job data. Everything it does is backed by one database table or another. Scheduling jobs — that is, designating jobs to run at some specific point in the future — is no different. Any scheduled job is stored in solid_queue_scheduled_executions. This table is almost identical to the solid_queue_ready_executions table. The only difference is the addition of the scheduled_at column, which tells us when a scheduled job is supposed to be executed. Let's confirm that by looking at what happens when we schedule a job. There are no surprises there. Solid Queue adds a new row to the solid_queue_scheduled_executions table, which contains the data that we'd expect. But how do we go from such a record existing to actually running a job at the right time? We need a process that continuously polls the solid_queue_scheduled_executions table. That process is called the Dispatcher, and it is responsible for executing scheduled jobs on time. It begins when Solid Queue starts — no additional configuration is required. However, if needed you can start only the dispatcher proce...
First seen: 2025-06-23 23:09
Last seen: 2025-06-24 07:10