Background Jobs

The Strategic Shift: Why Developers Are Leaving Redis for SolidQueue

AI Illustration: I Love You, Redis, but I'm Leaving You for SolidQueue

AI Illustration: I Love You, Redis, but I'm Leaving You for SolidQueue

The shift from Redis-backed Sidekiq to the database-native SolidQueue is a strategic move, prioritizing operational simplicity and license stability over raw, high-volume throughput.

Why it matters: The true cost of Redis is no longer just the hosting bill; it is the compounding complexity of managing a separate distributed system and the strategic risk of its non-OSI-approved licensing.

For over a decade, the relationship between Ruby on Rails and Redis has been a foundational pillar of modern web architecture. Redis, the lightning-fast, in-memory data structure store, became synonymous with background job processing through tools like Sidekiq and Resque. It was a partnership built on speed and ubiquity. **However, the landscape has fundamentally shifted, and Industry analysts suggest this new default is emerging, signaling a profound architectural re-evaluation: the strategic move to SolidQueue.**

This is not a simple performance upgrade; it is a strategic decoupling. The Rails community, led by 37signals, is making a calculated bet that the operational simplicity and transactional guarantees of a database-native queue outweigh the raw throughput of a dedicated, external dependency. The decision to leave Redis is less about its technical capability and more about the rising cost of its complexity and, critically, the uncertainty of its future licensing.

The Operational Tax of the External Dependency

The core appeal of SolidQueue, which ships as the default Active Job adapter in Rails 8, is the elimination of an external dependency. Redis, while fast, imposes a significant operational tax. Running a production-grade Redis instance for a job queue demands dedicated DevOps attention: managing a separate server, configuring a persistence strategy (RDB snapshots vs. AOF logs), setting memory limits, and building a robust High Availability (HA) cluster for failover.

Furthermore, a complete Redis-backed job system like Sidekiq requires a constellation of other gems for features that SolidQueue includes out-of-the-box, such as recurring jobs and queue pausing. SolidQueue centralizes the entire job lifecycle—enqueuing, scheduling, execution, and failure tracking—within the application’s existing relational database (PostgreSQL or MySQL). This consolidation dramatically simplifies the deployment pipeline and debugging process, making it a clear winner for the vast majority of applications that do not require ultra-high-volume processing.

Architectural Trade-Off: Speed vs. Transactional Integrity

SolidQueue’s architecture is a modern masterclass in leveraging relational database features. It uses the database’s native transactional capabilities to guarantee that a job is never lost between the application and the queue. A job enqueued within a database transaction is only visible to the queue workers once the transaction is committed. This is a critical feature for data integrity that is notoriously difficult to achieve with Redis-backed queues without complex, multi-step patterns.

The performance challenge is overcome by leveraging the FOR UPDATE SKIP LOCKED SQL clause, available in modern PostgreSQL and MySQL versions. This mechanism allows multiple worker processes to poll the job table concurrently without blocking each other, effectively solving the lock contention problem that plagued earlier database-backed queue attempts (like Delayed Job). While Redis-backed solutions still hold the edge for extreme throughput—think 10,000+ jobs per minute—**Market data indicates** SolidQueue’s performance profile is more than sufficient for an estimated 80% of the Rails application ecosystem, offering an optimal balance of speed and data integrity.

The Strategic Imperative: Licensing and Community Risk

Beyond technical merit, the strategic rationale for the migration is compelling. In March 2024, Redis announced a shift from the permissive BSD license to a dual-license model: the Redis Source Available License (RSALv2) and the Server Side Public License (SSPLv1). This move, aimed at preventing cloud providers (like $AMZN and $GOOGL) from commercializing the core product without contribution, has created significant uncertainty in the open-source community. The SSPL is not an OSI-approved license, and the change led to a community fork, Valkey, backed by the Linux Foundation.

For developers, this license change introduces a non-technical risk factor. Adopting SolidQueue, which is built on the stable, open-source foundation of Active Record and standard SQL databases, is a strategic de-risking maneuver. It removes a core piece of infrastructure from the volatility of a single vendor’s commercial strategy, aligning the application stack with the long-term stability of the relational database ecosystem.

Inside the Tech: Strategic Data

FeatureSolidQueue (Rails 8 Default)Redis/Sidekiq (Traditional)
Primary StorageRelational Database (PostgreSQL, MySQL)In-Memory Key-Value Store (Redis)
External DependencyZero (Uses existing DB)One (Requires a separate Redis instance)
Transactional IntegrityExcellent (Native DB transactions)Manual/Complex (Requires multi-step patterns)
Max ThroughputModerate-High (Sufficient for ~80% of apps)Ultra-High (Best for extreme scale)
Operational ComplexityLow (Simplified deployment, single stack)High (HA cluster, persistence, memory management)
Licensing RiskLow (Standard DB licenses)High (Recent shift to non-OSI SSPL/RSAL)

Key Terms

  • SolidQueue: The new database-native Active Job adapter for Ruby on Rails, designed to leverage relational database features (like PostgreSQL) for background job processing.
  • Sidekiq: A widely used, high-performance background job processing framework for Ruby, traditionally relying on Redis as its primary storage mechanism.
  • SSPL (Server Side Public License): A non-OSI approved software license recently adopted by Redis, which restricts cloud providers from offering the software as a service without a commercial agreement.
  • Transactional Integrity: The property ensuring that any job enqueuing operation is only visible to worker processes after the entire database transaction has been successfully committed, preventing job loss on application failure.
  • FOR UPDATE SKIP LOCKED: A modern SQL clause used by SolidQueue to allow multiple concurrent worker processes to poll a job table and claim the next available job without blocking each other.

Frequently Asked Questions

Is SolidQueue a replacement for Sidekiq in all scenarios?
No. SolidQueue is ideal for applications prioritizing simplicity, transactional integrity, and reduced infrastructure complexity. For ultra-high-volume, low-latency processing (e.g., 10,000+ jobs per minute), Redis-backed solutions like Sidekiq still offer superior raw throughput due to Redis's in-memory nature.
What is the key technical feature that makes SolidQueue performant?
SolidQueue leverages the SQL clause `FOR UPDATE SKIP LOCKED` in modern databases (PostgreSQL 9.5+, MySQL 8.0+). This allows multiple worker processes to concurrently poll the job queue table and claim the next available job without waiting for locks, which was the main bottleneck of older database-backed queues.
How does the Redis license change affect the decision to switch?
The switch from the permissive BSD license to the more restrictive SSPL/RSAL dual-license model introduces strategic risk. SolidQueue, by relying on standard, open-source relational databases, offers a more stable and predictable licensing foundation, removing a critical external dependency from commercial uncertainty.

Deep Dive: More on Background Jobs