Choosing a Laravel Queue Driver: Sync, Database, Redis, or SQS
Learn how to pick the right Laravel queue driver—sync, database, Redis, or SQS—based on throughput, reliability, infrastructure, and cost, with a concrete Redis‑based example and validation steps.
16 Oct 2025, 08:39 UTC

Decision and constraints
When a Laravel application needs to run background work, picking the wrong queue driver can cause request latency, lost jobs, or unnecessary operational overhead. The useful takeaway is to match the driver to your workload’s throughput, failure tolerance, existing infrastructure, and cost limits.
Typical constraints
- Throughput: how many jobs per second you need to process.
- Failure tolerance: durability vs. occasional loss.
- Infrastructure simplicity: willingness to run extra services.
- Cost: free vs. pay‑per‑use.
Comparison of supported drivers
| Driver | Setup Complexity | Persistence | Throughput | Cost | Typical Use‑Case |
|---|---|---|---|---|---|
| Sync | None | In‑process | Low | Free | Testing, tiny jobs |
| Database | Low (migrations) | DB table | Medium | Free | Simple apps with an existing DB |
| Redis | Moderate (Redis instance) | Redis | High | Free/OpEx | Real‑time workloads needing delays/priorities |
| Amazon SQS | Moderate (AWS setup) | Managed | Very High | Pay‑per‑request | Decoupled, scalable cloud applications |
Trade‑offs
Sync runs jobs instantly inside the HTTP request, giving zero queue latency but blocking the request thread—unsuitable for any non‑trivial workload in production.
Database adds almost no extra service; jobs are stored in a table you already back up. The downside is added DB load and moderate latency due to polling.
Redis provides the fastest polling and rich features (delays, priorities, retry cycles) but requires a separate Redis cluster that you must monitor, patch, and size.
SQS removes infrastructure management entirely, scales automatically, and integrates with other AWS services. The trade‑offs are network round‑trip latency and ongoing usage costs based on requests and data transferred.
Concrete implementation
Below is a step‑by‑step example for selecting the Redis driver, which is a common choice when you need high throughput and already operate a Redis cache.
- Set the driver: edit
.envand ensureQUEUE_CONNECTION=redis. No further configuration is needed if you already haveREDIS_HOST,REDIS_PASSWORD, andREDIS_PORTdefined. - Create a job class: run
php artisan make:job ProcessPodcast. This createsapp/Jobs/ProcessPodcast.php. Implement thehandlemethod with your business logic. - Dispatch the job: from a controller, route, or command, call
Theuse App\Jobs\ProcessPodcast; ProcessPodcast::dispatch($podcast)->onQueue('processing');onQueuemethod lets you isolate workloads; replace'processing'with any queue name you prefer. - Start the worker: on a server with CLI access (typically the same user that runs your web server), execute
This command polls the Redis list for thephp artisan queue:work --queue=processing --tries=3processingqueue, attempts each job up to three times, and logs outcomes.
Validation and practical checks
To confirm that the driver is active and jobs are being processed:
- Run
php artisan queue:work(without specifying a queue) and watch the output. You should see lines like[2026-10-11 19:38:14] Connected to Redisor[2026-10-11 19:38:15] Listening on the queue: default. - Insert a test job via
Route::get('/test-job', function () { ProcessPodcast::dispatch(new stdClass)->onQueue('testing'); return 'dispatched'; });then request that route. - Check the storage:
- For Redis:
redis-cli LLEN queues:testingshould show a count of 1 before processing and 0 after the worker finishes. - For the database driver (if you switch): query
SELECT COUNT(*) FROM jobs WHERE queue = 'testing';.
- For Redis:
- Inspect the worker log (default
storage/logs/laravel.log) for a line indicating the job was processed, e.g.,[2026-10-11 19:39:02] Processing: App\Jobs\ProcessPodcastand a subsequentProcessed: App\Jobs\ProcessPodcast.
Limitations and when to reconsider
- Sync should never be used in production for anything beyond trivial demonstration code; it will increase response times and risk time‑outs.
- Database can cause the
jobstable to grow if failed jobs are not pruned. Schedule a periodic cleanup, e.g.,php artisan queue:prune --hours=24. - Redis adds an operational burden: you must monitor memory usage, set up persistence (AOF/RDB), and plan for failover. If you lack Redis expertise, the database driver may be safer.
- SQS introduces latency (typically tens to hundreds of milliseconds) and ongoing cost. Estimate your request volume with the AWS pricing calculator before committing.
By working through the decision table, understanding the trade‑offs, and following the implementation steps above, you can select a queue driver that aligns with your application’s performance needs, reliability requirements, and operational constraints.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.