Bull-Ish Your Queues With BullMQ

 Luca Del Puppo 

Luca Del Puppo

  • Senior Software Developer
  • JavaScript enthusiast
  • TypeScript lover
  • “Youtuber”
  • “Writer”

Love sport: running, hiking

Love animals

Today I want to tell you a story_

At some point_

So they went to the Platform team_

The result_

AWS SQS

But with only one queue

For some days, these were their nights_

PostgreSQL

ElastiCache

Pg-boss_

  • Node.js + PostgreSQL solution
  • Required a specific DB schema to handle the queues
  • Increase the load in the database

They already have too much load in the database,

they want to avoid increasing it

This is when BullMQ shines_

BullMQ is a Node.js library that implements a fast and robust queue system

built on top of Redis that helps in resolving many modern age micro-services architectures.

Bull is the old version

BullMQ the new one

Features_

  • Queues
  • Workers to handle the queues
  • Jobs
  • Flow

Parallelism and Concurrency_

  • Out-of-the-box
  • By default, disabled
  • Multiple instance

Plus_

  • Telemetry (OpenTelemetry)
  • UI Dashboard

Conclusion_

Pros_

  • Easy solution if you cannot have another Queue service
  • API straightforward
  • Easy to scale
  • Ready for the majority of the case
  • Very well documented

Cons_

  • Based on Redis, if you shut it down, you lose the data
  • Another library to learn

About this presentation_

About demo_

Luca Del Puppo

@puppo92

Luca Del Puppo

Puppo_92

@puppo

We are hiring

Thank you!_