# Bull + Bull Board

> Node.js job queue with monitoring dashboard.

- Category: Message Queues & Brokers
- Difficulty: intermediate
- Components: bull, redis
- Tags: bull, nodejs, queue, jobs
- Source: https://docker.recipes/messaging/bull-board

## Overview

Bull is a Redis-based queue library for Node.js that enables background job processing with features like delayed jobs, job prioritization, rate limiting, and automatic retries. Originally created to handle asynchronous task processing in Node.js applications, Bull has become a cornerstone for building scalable microservices that need reliable job scheduling and execution. Bull Board complements this by providing a web-based monitoring dashboard that visualizes queue statistics, job status, and system performance in real-time.

This stack combines Bull's robust job processing capabilities with Redis's high-performance in-memory storage and Bull Board's intuitive monitoring interface. Redis serves as the message broker and job storage backend, ensuring jobs persist across application restarts while maintaining sub-millisecond response times. Bull Board connects to the same Redis instance to provide live insights into queue health, failed job analysis, and throughput metrics without requiring additional database setup.

Development teams building Node.js applications with background processing requirements will find this combination particularly valuable. E-commerce platforms processing order workflows, SaaS applications handling user notifications, and data processing pipelines benefit from Bull's reliability combined with Bull Board's operational visibility. The stack is especially useful for teams transitioning from simple setTimeout-based processing to enterprise-grade job management with proper monitoring and failure handling.

## Features

- Priority-based job scheduling with weighted queue processing
- Automatic job retry mechanisms with exponential backoff strategies
- Delayed job execution for scheduled tasks and time-based workflows
- Real-time job progress tracking with custom progress indicators
- Rate limiting capabilities to prevent API throttling and resource exhaustion
- Job concurrency control with configurable worker limits per queue
- Web-based dashboard showing queue statistics, failed jobs, and processing metrics
- Redis persistence ensuring job durability across application restarts

## Use cases

- E-commerce order processing workflows with payment verification and inventory updates
- Email and notification delivery systems with retry logic for failed sends
- Image and video processing pipelines for user-generated content
- Data ETL jobs for analytics and reporting dashboards
- Scheduled maintenance tasks and database cleanup operations
- Social media content moderation and automated posting systems
- Financial transaction processing with fraud detection workflows

## Prerequisites

- Docker and Docker Compose installed on the host system
- Minimum 512MB RAM for Redis data storage and job queue operations
- Port 3000 available for Bull Board dashboard access
- Basic understanding of Node.js job queue concepts and Redis data structures
- Network connectivity for Redis communication between Bull and Bull Board containers

## docker-compose.yml

```yaml
services:
  redis:
    image: redis:alpine
    container_name: bull-redis
    volumes:
      - redis_data:/data
    networks:
      - bull

  bull-board:
    image: deadly0/bull-board:latest
    container_name: bull-board
    environment:
      REDIS_HOST: redis
      REDIS_PORT: 6379
    ports:
      - "3000:3000"
    depends_on:
      - redis
    networks:
      - bull

volumes:
  redis_data:

networks:
  bull:
    driver: bridge
```

## .env

```bash
# Configure your Bull queues
```

## Usage notes

- Docs: https://docs.bullmq.io/
- Bull Board dashboard at http://localhost:3000
- Add queues in Node.js: new Queue('my-queue', { connection })
- Monitor job status, progress, failed jobs, and retries
- BullMQ (v4+) recommended over Bull for new projects
- Redis-backed - jobs persist across restarts

## Troubleshooting

- Bull Board shows empty dashboard: Ensure your Node.js application is creating queues with the same Redis connection parameters
- Jobs stuck in waiting state: Check Redis memory usage and increase maxmemory limit or enable memory eviction policies
- Connection refused errors: Verify Redis container is running and accessible on the bull network with correct hostname 'redis'
- Jobs not processing: Confirm your Node.js workers are consuming from the correct queue names and Redis host configuration
- Dashboard not updating: Restart Bull Board container to refresh Redis connection and clear any cached queue metadata
- High memory usage in Redis: Enable Redis persistence (RDB/AOF) and configure appropriate job TTL settings to prevent memory leaks

