Skip to main content

Queue drivers in Laravel

Laravel offers several queue drivers for handling background jobs, which can be configured in your config/queue.php file. The primary drivers available include:
  • Synchronous (sync): 
    This driver executes jobs immediately within the current request. It's primarily used for local development and testing, as it doesn't offer true background processing.
  • Database: 
    This driver stores jobs in a database table. It's a simple and readily available option, particularly useful for smaller applications or when you want to leverage your existing database infrastructure.
  • Redis: 
    A popular and high-performance in-memory data store, Redis is frequently used as a queue driver in production environments. It offers fast job processing and is well-suited for applications with a high volume of queued jobs. Laravel Horizon is a dedicated dashboard for monitoring and managing Redis queues.
  • Amazon SQS (Simple Queue Service): 
    A fully managed message queue service offered by AWS, SQS provides a scalable and reliable solution for queuing jobs, especially for applications deployed on AWS.
  • Beanstalkd: 
    A lightweight, open-source work queue, Beanstalkd is another option for managing queues, offering a simple and efficient way to handle background tasks.
  • Null: 
    This driver discards queued jobs, which can be useful during development or testing when you want to prevent jobs from actually being processed.
You can select the appropriate driver based on your application's needs, scale, and deployment environment. For production applications, Redis or Amazon SQS are often preferred for their performance and scalability.