DEV Community

Egeo Minotti
Egeo Minotti

Posted on

Migrate from BullMQ to flashQ in 5 Minutes

flashQ is BullMQ-compatible. Migration is mostly find-and-replace.

Why?

  • No Redis — single binary
  • 1.9M jobs/sec vs ~50K
  • <1ms latency vs 5-10ms

1. Start flashQ

docker run -d -p 6789:6789 flashq/flashq
Enter fullscreen mode Exit fullscreen mode

2. Swap packages

npm uninstall bullmq ioredis
npm install flashq
Enter fullscreen mode Exit fullscreen mode

3. Update imports

// Before
import { Queue, Worker } from 'bullmq';

// After
import { Queue, Worker } from 'flashq';
Enter fullscreen mode Exit fullscreen mode

4. Change port

// 6379 → 6789
connection: { host: 'localhost', port: 6789 }
Enter fullscreen mode Exit fullscreen mode

Done. The rest works unchanged: add(), addBulk(), updateProgress(), events.


API Differences

BullMQ flashQ
QueueEvents class Events on Queue directly
FlowProducer with children depends_on: [jobId] option
repeat: { cron } queue.addCron()
Worker limiter queue.setRateLimit()

Links

Top comments (0)