bullmq vs bull vs agenda vs bee-queue vs kue
Job and Queue Management
bullmqbullagendabee-queuekueSimilar Packages:
Job and Queue Management

Job and queue management libraries in Node.js provide tools for handling background tasks, scheduling jobs, and managing queues of tasks to be processed asynchronously. These libraries help improve application performance by offloading time-consuming tasks from the main event loop, allowing for better resource utilization and responsiveness. They often include features like job prioritization, retries, scheduling, and monitoring, making them suitable for a wide range of applications, from simple task processing to complex workflows. bull and bullmq are popular libraries that offer robust queue management with Redis integration, while agenda focuses on job scheduling with a MongoDB backend. bee-queue is a lightweight and simple queue library, and kue provides a feature-rich solution with a web interface for monitoring jobs.

Npm Package Weekly Downloads Trend
3 Years
Github Stars Ranking
Stat Detail
Package
Downloads
Stars
Size
Issues
Publish
License
bullmq2,139,1488,0052.27 MB3054 days agoMIT
bull1,119,92216,183309 kB148a year agoMIT
agenda136,7119,585353 kB356-MIT
bee-queue36,4813,994106 kB362 years agoMIT
kue18,8859,458-2889 years agoMIT
Feature Comparison: bullmq vs bull vs agenda vs bee-queue vs kue

Storage Backend

  • bullmq:

    bullmq also uses Redis but is designed with a more modern architecture, offering better performance and scalability. It supports advanced features like rate limiting, job events, and a more flexible data model, making it ideal for large-scale applications.

  • bull:

    bull uses Redis for job storage, providing durability and persistence. It supports features like job retries, delayed jobs, and prioritization, making it suitable for production-grade applications that require reliable job processing.

  • agenda:

    agenda uses MongoDB as its storage backend, which allows for persistent job storage, making it suitable for long-running applications where job data needs to be retained across restarts.

  • bee-queue:

    bee-queue uses Redis as its storage backend, but it is designed to be lightweight and does not persist job data to disk, making it more suitable for ephemeral job processing where durability is not a primary concern.

  • kue:

    kue uses Redis for job storage and provides a web interface for monitoring jobs. It supports job prioritization, retries, and failure handling, making it suitable for applications that require a visual representation of job processing.

Job Scheduling

  • bullmq:

    bullmq supports delayed jobs and job scheduling, with a more flexible and efficient design compared to bull. It allows for better handling of scheduled jobs and provides more control over job execution.

  • bull:

    bull supports delayed jobs and job prioritization, but it does not have built-in support for recurring jobs. However, it can be extended to handle scheduled jobs with additional logic.

  • agenda:

    agenda supports job scheduling with features like recurring jobs, delayed jobs, and one-time jobs. It provides a flexible API for defining job schedules and supports time zone handling.

  • bee-queue:

    bee-queue does not natively support job scheduling or recurring jobs. It focuses on simple job queuing and processing, making it lightweight but limited in scheduling capabilities.

  • kue:

    kue supports job scheduling with delayed jobs and prioritization. It allows for more complex job management, including retries and failure handling, making it suitable for applications that require more control over job execution.

Monitoring and UI

  • bullmq:

    bullmq offers an improved UI for monitoring job queues, with better visualization and control over jobs. It is designed to be more modular and extensible, allowing for custom integrations and monitoring solutions.

  • bull:

    bull provides a built-in UI for monitoring job queues, including job status, retries, and failures. It is user-friendly and helps developers and operators monitor job processing in real-time.

  • agenda:

    agenda does not provide a built-in UI for monitoring jobs. However, it integrates well with third-party tools and can be extended to provide monitoring features.

  • bee-queue:

    bee-queue does not have a built-in UI, but it is designed to be simple and lightweight, allowing developers to build custom monitoring tools if needed.

  • kue:

    kue provides a feature-rich web interface for monitoring jobs, including job status, retries, and failures. It is one of the standout features of kue, making it easy to manage and visualize job processing.

Performance and Scalability

  • bullmq:

    bullmq is designed for better performance and scalability compared to bull, with a more efficient data model and support for advanced features like rate limiting and job events. It is ideal for large-scale applications that require high throughput and resource efficiency.

  • bull:

    bull is highly performant and scalable, capable of handling a large number of jobs with Redis as the backend. It supports horizontal scaling by adding more worker instances, making it suitable for production environments.

  • agenda:

    agenda is suitable for moderate workloads and can scale horizontally by adding more instances. However, its performance is heavily dependent on the MongoDB setup and indexing.

  • bee-queue:

    bee-queue is designed for high performance with low memory usage, making it suitable for processing a large number of jobs quickly. However, it may not scale well for very large or complex job workflows.

  • kue:

    kue is performant for moderate workloads but may encounter scalability issues with very high job volumes. It is suitable for applications that require reliable job processing but may need optimization for large-scale use.

Ease of Use: Code Examples

  • bullmq:

    Job queue with bullmq

    const { Queue } = require('bullmq');
    const queue = new Queue('my-queue');
    
    // Process jobs
    queue.process(async (job) => {
      console.log(`Processing job ${job.id}: ${job.data}`);
    });
    
    // Add a job
    queue.add('my-job', { message: 'Hello, BullMQ!' });
    
  • bull:

    Job queue with bull

    const Queue = require('bull');
    const myQueue = new Queue('my-queue');
    
    // Process jobs
    myQueue.process(async (job) => {
      console.log(`Processing job ${job.id}: ${job.data}`);
    });
    
    // Add a job
    myQueue.add({ message: 'Hello, Bull!' });
    
  • agenda:

    Simple job scheduling with agenda

    const Agenda = require('agenda');
    const mongoConnectionString = 'mongodb://localhost:27017/agenda';
    const agenda = new Agenda({ db: { address: mongoConnectionString } });
    
    // Define a job
    agenda.define('send email', async (job) => {
      console.log('Sending email...');
    });
    
    // Schedule a job
    agenda.schedule('in 1 minute', 'send email');
    
    // Start the agenda
    agenda.start();
    
  • bee-queue:

    Simple job queue with bee-queue

    const Queue = require('bee-queue');
    const queue = new Queue('my-queue');
    
    // Process jobs
    queue.process(async (job) => {
      console.log(`Processing job ${job.id}: ${job.data}`);
    });
    
    // Add a job
    queue.add({ message: 'Hello, world!' });
    
  • kue:

    Job queue with kue

    const kue = require('kue');
    const queue = kue.createQueue();
    
    // Process jobs
    queue.process('email', (job, done) => {
      console.log(`Processing job ${job.id}: ${job.data}`);
      done();
    });
    
    // Add a job
    const job = queue.create('email', { to: 'example@example.com' }).save();
    
How to Choose: bullmq vs bull vs agenda vs bee-queue vs kue
  • bullmq:

    Choose bullmq if you need a modern, modular, and more efficient version of bull with improved performance and a redesigned API. It is ideal for applications that require advanced queueing features and better resource management, especially for large-scale systems.

  • bull:

    Choose bull if you need a feature-rich queue system with Redis support, offering advanced features like job retries, prioritization, delayed jobs, and a built-in UI for monitoring. It is suitable for applications that require robust queue management and scalability.

  • agenda:

    Choose agenda if you need a job scheduler that integrates with MongoDB and supports recurring jobs, delayed jobs, and job prioritization. It is ideal for applications that require flexible scheduling and persistence of job data.

  • bee-queue:

    Choose bee-queue if you need a simple and lightweight queue system with a focus on performance and low memory usage. It is suitable for applications that require fast job processing with minimal overhead and does not need advanced features like job prioritization or retries.

  • kue:

    Choose kue if you need a job queue library with a built-in web interface for monitoring jobs, along with support for job prioritization, retries, and failure handling. It is suitable for applications that require a visual representation of job processing and easy management of jobs.

README for bullmq



The fastest, most reliable, Redis-based distributed queue for Node.
Carefully written for rock solid stability and atomicity.

Read the documentation

Follow @manast for *important* Bull/BullMQ/BullMQ-Pro news and updates!

🛠 Tutorials

You can find tutorials and news in this blog: https://blog.taskforce.sh/

News 🚀

🌐 Language agnostic BullMQ

Do you need to work with BullMQ on platforms other than Node.js? If so, check out the BullMQ Proxy

Official FrontEnd

Taskforce.sh, Inc

Supercharge your queues with a professional front end:

  • Get a complete overview of all your queues.
  • Inspect jobs, search, retry, or promote delayed jobs.
  • Metrics and statistics.
  • and many more features.

Sign up at Taskforce.sh

🚀 Sponsors 🚀

Dragonfly Dragonfly is a new Redis™ drop-in replacement that is fully compatible with BullMQ and brings some important advantages over Redis™ such as massive better performance by utilizing all CPU cores available and faster and more memory efficient data structures. Read more here on how to use it with BullMQ.

Used by

Some notable organizations using BullMQ:

Microsoft Vendure Datawrapper Nest Langfuse
Curri Novu NoCodeDB Infisical

The gist

Install:

$ yarn add bullmq

Add jobs to the queue:

import { Queue } from 'bullmq';

const queue = new Queue('Paint');

queue.add('cars', { color: 'blue' });

Process the jobs in your workers:

import { Worker } from 'bullmq';

const worker = new Worker('Paint', async job => {
  if (job.name === 'cars') {
    await paintCar(job.data.color);
  }
});

Listen to jobs for completion:

import { QueueEvents } from 'bullmq';

const queueEvents = new QueueEvents('Paint');

queueEvents.on('completed', ({ jobId }) => {
  console.log('done painting');
});

queueEvents.on(
  'failed',
  ({ jobId, failedReason }: { jobId: string; failedReason: string }) => {
    console.error('error painting', failedReason);
  },
);

Adds jobs with parent-child relationship:

import { FlowProducer } from 'bullmq';

const flow = new FlowProducer();

const originalTree = await flow.add({
  name: 'root-job',
  queueName: 'topQueueName',
  data: {},
  children: [
    {
      name: 'child-job',
      data: { idx: 0, foo: 'bar' },
      queueName: 'childrenQueueName',
      children: [
        {
          name: 'grandchild-job',
          data: { idx: 1, foo: 'bah' },
          queueName: 'grandChildrenQueueName'
        },
        {
          name: 'grandchild-job',
          data: { idx: 2, foo: 'baz' },
          queueName: 'grandChildrenQueueName'
        },
      ],
    },
    {
      name: 'child-job',
      data: { idx: 3, foo: 'foo' },
      queueName: 'childrenQueueName'
    },
  ],
});

This is just scratching the surface, check all the features and more in the official documentation

Feature Comparison

Since there are a few job queue solutions, here is a table comparing them:

FeatureBullMQ-ProBullMQBullKueBeeAgenda
Backendredisredisredisredisredismongo
Observables
Group Rate Limit
Group Support
Batches Support
Parent/Child Dependencies
Deduplication (Debouncing)
Deduplication (Throttling)
Priorities
Concurrency
Delayed jobs
Global events
Rate Limiter
Pause/Resume
Sandboxed worker
Repeatable jobs
Atomic ops
Persistence
UI
Optimized forJobs / MessagesJobs / MessagesJobs / MessagesJobsMessagesJobs

Contributing

Fork the repo, make some changes, submit a pull-request! Here is the contributing doc that has more details.

Thanks

Thanks for all the contributors that made this library possible, also a special mention to Leon van Kammen that kindly donated his npm bullmq repo.