Skip to content

Replace Sidekiq with Solid Queue for Active Job#100

Closed
JuanVqz wants to merge 1 commit into
mainfrom
feature/swap-sidekiq-for-solid-queue
Closed

Replace Sidekiq with Solid Queue for Active Job#100
JuanVqz wants to merge 1 commit into
mainfrom
feature/swap-sidekiq-for-solid-queue

Conversation

@JuanVqz

@JuanVqz JuanVqz commented Jun 25, 2026

Copy link
Copy Markdown
Member

Summary

Switch Active Job from Sidekiq to Solid Queue, dropping the Redis dependency in favor of the Postgres-backed Solid Queue. Solid Queue already runs in-process in production via SOLID_QUEUE_IN_PUMA: true, so this makes it the actual adapter instead of running alongside an unused Sidekiq wiring.

Why

  • The app declared both sidekiq/sidekiq-scheduler and solid_queue. The Active Job adapter was :sidekiq, yet deploy.yml does not provision Redis (commented out) while it does set SOLID_QUEUE_IN_PUMA: true. This consolidates on one backend.
  • Removes Redis as an infrastructure requirement (Solid Queue uses the existing Postgres).
  • Makes the open Sidekiq major-bump PRs (Bump sidekiq from 7.3.9 to 8.1.6 #84 sidekiq 8, Bump sidekiq-scheduler from 5.0.6 to 6.0.2 #87 sidekiq-scheduler 6) obsolete.

Changes

  • config/application.rb: queue_adapter -> :solid_queue; add config.solid_queue.connects_to = { database: { writing: :queue } } (was missing entirely and is required for Solid Queue to use the queue database).
  • config/recurring.yml: port the three cron schedules (daily puzzle, weekly leaderboard, inventory check) from sidekiq-scheduler.
  • config/database.yml: add a queue database for development and test (production already defined one).
  • Remove sidekiq + sidekiq-scheduler gems, config/initializers/sidekiq.rb, config/sidekiq.yml.
  • Procfile: worker now runs bin/jobs.

Verification (local)

  • Jobs enqueue into solid_queue_jobs with no Redis running.
  • Recurring cron schedules parse as valid.
  • Full test suite: 33 runs, 101 assertions, 0 failures, 0 errors.

Pending / for Operations

  • Confirm production deploy provisions the queue Postgres database (ruby_or_rails_production_queue) and runs db:prepare.
  • Decide whether to keep SOLID_QUEUE_IN_PUMA (single-server) or split a dedicated worker as traffic grows (already noted in deploy.yml).
  • Remove any Redis accessory / REDIS_URL references from the deploy environment.

Draft until Operations confirms the production database/worker setup.

Switch the Active Job adapter from :sidekiq to :solid_queue, removing the
Redis dependency in favor of the Postgres-backed Solid Queue (already run
in-process via SOLID_QUEUE_IN_PUMA in production).

- config/application.rb: queue_adapter -> :solid_queue, add solid_queue
  connects_to the :queue database (was missing; required for the adapter).
- config/recurring.yml: port the 3 cron schedules from sidekiq-scheduler.
- config/database.yml: add a queue database for development and test
  (production already had one).
- Remove sidekiq + sidekiq-scheduler gems, config/initializers/sidekiq.rb,
  config/sidekiq.yml.
- Procfile: worker now runs bin/jobs.

Jobs are plain ActiveJob with no Sidekiq-specific code, so the swap needs
no job changes. Verified locally: jobs enqueue into solid_queue_jobs with
no Redis, recurring crons parse, full test suite passes (33 runs, 0 failures).
@JuanVqz JuanVqz closed this Jun 25, 2026
@JuanVqz JuanVqz deleted the feature/swap-sidekiq-for-solid-queue branch June 25, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant