Skip to content

Expert Answers to Your Magento, Shopify & Shopware Questions

Vendor-neutral, engineer-written explanations. Clear definitions first, then practical steps with real examples — no fluff.

Stagebit builds and maintains stores on Magento, Adobe Commerce, Shopify, Shopware, and Laravel, and this library holds the questions our own engineers get asked most often on each platform.

How do I choose a Laravel queue driver: database, Redis, or SQS?

SB
Written by Stagebit Engineering Team
Updated December 2026 7 min read Verified by engineers

Choose a Laravel queue driver by three things: your job volume, how much queue infrastructure your team wants to run, and the cost of a lost or repeated job. In short, use the database driver until job volume or Laravel Horizon gives you a reason to adopt Redis, or until you would rather have AWS run the queue. The Laravel queue documentation describes one queue API across all three, so most dispatch code stays the same. Migrating still takes planning: jobs already queued stay on the old backend, and you must prepare the new infrastructure and workers.

Quick answer

The database driver is the default in new Laravel applications and suits smaller, simpler workloads with no extra service. Redis keeps jobs in memory, suits higher throughput, and is the only backend Laravel Horizon manages. SQS is a managed AWS queue with a 1 MiB message limit and a 15-minute maximum delay, for teams that prefer not to run a queue server.

Database vs Redis vs SQS for Laravel queues at a glance

ComparisonDatabaseRedisAmazon SQS
Where jobs liveA table in a databaseRedis, in memoryA queue managed by AWS
Infrastructure neededUses a database you already run, no separate queue serviceA Redis server, with memory planning and persistence and eviction settingsAWS configuration, an SQS queue, and IAM permissions
Laravel HorizonNoYesNo
Retry timing set byretry_after in config/queue.phpretry_after in config/queue.phpVisibility timeout in AWS
Main limitQueue traffic adds database loadBounded by memory1 MiB messages, 15-minute delay
MonitoringApplication and database toolsHorizonAWS tools such as CloudWatch
Best fitSmaller, simpler workloadsHigher throughput or HorizonAWS running the queue for you

When should I use the database as my Laravel queue driver?

The database driver stores jobs in a table, usually named jobs, and is the default queue connection in new Laravel applications. The table typically comes with the default migrations. Laravel can also use a separately configured database connection for queues. The driver needs no extra service, so it suits smaller apps.

The trade-off is database load. Queue reads and writes add to your database workload. Slow queries on the jobs table and rising database CPU are signs to move. That is a judgment call, since Laravel documents no throughput threshold.

When should I use Redis as my Laravel queue driver?

Redis keeps jobs in memory, so workers pick them up quickly. The block_for option lets a worker wait for a job instead of polling. Laravel Horizon, the queue dashboard and worker balancer, works only with Redis queues.

Redis can also write jobs to disk, in two ways described in the Redis persistence documentation. RDB takes snapshots at set intervals, so a crash can lose the latest minutes of jobs. AOF logs every write and replays the log on restart. With its default setting, which syncs to disk every second, you can lose about one second of writes. You can combine both. Laravel requires neither, so choose based on how costly a lost job is.

Plan memory as well. When Redis reaches its memory limit, the eviction policy decides what happens. Policies that evict keys, such as allkeys-lru, can remove queue data. With noeviction, Redis keeps existing keys and returns errors for new writes, so dispatching jobs can fail until memory frees up. For queued jobs, that is often preferable to losing them silently, but it means you need to watch memory use. Default policies differ between hosts, so check yours.

When should I use Amazon SQS as my Laravel queue driver?

SQS is a managed queue, so you patch and scale no queue server. AWS bills per request with no minimum fee. The SQS message quotas set a 1 MiB message limit and a 15-minute maximum delay. Laravel 13 also documents an overflow option that stores larger payloads in a cache store and sends a pointer through SQS.

Two timeouts matter on SQS. The visibility timeout is how long a received message stays hidden from other consumers. The default is 30 seconds, and you manage it in AWS. The Laravel worker timeout, set with --timeout, is how long a worker may run one job. The worker timeout default is 60 seconds.

Keep the worker timeout shorter than the visibility timeout, with a margin of several seconds. If the message becomes visible again before the job finishes, another worker can receive it, and the job runs twice. With both defaults, the worker timeout is the longer one, so raise the visibility timeout or lower --timeout. SQS has no retry_after in Laravel, so the visibility timeout does that job.

Standard SQS queues deliver at least once, so a message can arrive twice. FIFO queues add ordering through message groups. Jobs in the same group run one at a time, in order, while different groups can run at the same time. In Laravel you set the group with onGroup, for example one group per customer. If you send to a FIFO queue without a group, Laravel uses the queue name, so the whole queue runs in sequence.

FIFO deduplication drops repeat sends that share a deduplication ID within a five-minute window. In Laravel, define a deduplicationId method on the job to supply that ID. FIFO deduplication does not make your business logic run exactly once. A message can still be received again if the visibility timeout expires, and a resend after five minutes goes undetected. Write jobs to be idempotent, meaning safe to run twice, so a repeat never creates a second payment or order.

Which Laravel queue driver should I use for an online store?

Take a small online store that sends order confirmation emails and a few stock updates a day. The database driver covers that with no extra service. As orders grow and several workers handle notifications, inventory syncs, and search indexing, Redis with Horizon gives faster pickup and a dashboard. If the same team would rather not run a queue server, SQS hands that job to AWS.

Decision flowchart for choosing a Laravel queue driver: SQS FIFO, Redis, Amazon SQS, or the database driver
A simplified starting point, not a rule. Check the limits and settings above for your own workload.
  • Ordering per customer, with parallel work across customers: SQS FIFO with message groups.
  • You want Laravel Horizon: Redis.
  • You want AWS to run the queue for you: SQS.
  • More throughput than your database handles comfortably: Redis.
  • Smaller or simpler workload: database.

How do I configure a Laravel queue driver?

Your dispatch code mostly stays the same whichever driver you pick. Set the default connection with QUEUE_CONNECTION in your .env file:

# Database
QUEUE_CONNECTION=database

# Redis
QUEUE_CONNECTION=redis

# Amazon SQS
QUEUE_CONNECTION=sqs

Each driver then needs its own setup:

  • Database: confirm the jobs table exists. If not, run php artisan make:queue-table, then php artisan migrate.
  • Redis: define a Redis connection in config/database.php and install predis/predis or the phpredis extension.
  • Amazon SQS: install aws/aws-sdk-php and set your AWS credentials, region, and queue details.

Start a worker with php artisan queue:work. In production, keep workers alive with a process manager such as Supervisor. Run php artisan queue:restart on each deploy so workers load new code.

What can break when I switch queue drivers?

  • Jobs already on the old backend stay there. Keep a worker on the old connection until it empties, and start workers for the new one.
  • When no other limit is set, Laravel attempts a job once. The --tries option sets a worker-wide limit, and a job’s own tries setting overrides it. Set tries and backoff for jobs that call unreliable services.
  • On database and Redis, retry_after (90 seconds by default) is how long a running job is kept before it is released for retry. Keep the worker timeout at least several seconds shorter, or the job can run twice.
  • On SQS, apply the same rule to the visibility timeout, as explained above.
  • Set after_commit when a job reads records created inside an open database transaction. Without it, a worker can pick up the job before the transaction commits. You can also call afterCommit() on a single dispatch.
  • Only a Redis Cluster needs a key hash tag in each queue name.
  • Horizon manages only Redis. If you configure Laravel’s failover driver to fall back from Redis to the database, run a separate queue:work process for the database.
  • Watch queue length, job wait time, and the failed jobs table, so backlogs show up early.

Which driver should I start with?

The best queue driver for Laravel is the simplest one your workload allows. Move when queue length, wait time, or database load tells you to. Base the choice on measured workload and operating cost rather than on which option sounds most advanced. If you want help planning a move on a live application, see Stagebit’s Laravel development services.

Was this answer helpful?

Your feedback helps us improve our answers.

Still need help?

Questions about choosing a Laravel queue driver?

If you're weighing database, Redis, or SQS for your Laravel app, we're happy to walk through what you're seeing and what your options are.

Talk to Laravel Experts