How do I choose a Laravel queue driver: database, Redis, or SQS?
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
| Comparison | Database | Redis | Amazon SQS |
|---|---|---|---|
| Where jobs live | A table in a database | Redis, in memory | A queue managed by AWS |
| Infrastructure needed | Uses a database you already run, no separate queue service | A Redis server, with memory planning and persistence and eviction settings | AWS configuration, an SQS queue, and IAM permissions |
| Laravel Horizon | No | Yes | No |
| Retry timing set by | retry_after in config/queue.php | retry_after in config/queue.php | Visibility timeout in AWS |
| Main limit | Queue traffic adds database load | Bounded by memory | 1 MiB messages, 15-minute delay |
| Monitoring | Application and database tools | Horizon | AWS tools such as CloudWatch |
| Best fit | Smaller, simpler workloads | Higher throughput or Horizon | AWS 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.
- 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, thenphp artisan migrate. - Redis: define a Redis connection in
config/database.phpand installpredis/predisor the phpredis extension. - Amazon SQS: install
aws/aws-sdk-phpand 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
--triesoption 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_commitwhen 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 callafterCommit()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:workprocess 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.
Related 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.
