Skip to content

Category: Backend

Implementing the Worker Pattern / Competing Consumers Pattern with MQTT shared subscriptions – MQTT Series #3

Hi and welcome to the 3rd article of the MQTT Series. In this article we’ll start looking into more advanced, yet very commonly found scenarios in IoT workloads. We’ll discuss the scalability and availability of consumers and we’ll see different ways to implement a load balanced consumption layer, namely by implementing Worker Pattern / Competing Consumers Pattern with MQTT shared subscriptions.

SEQUELIZE AND TYPESCRIPT

As many .NET developers transitioning to the world of Node, I started looking for an ORM. After some research, I found sequelize which seems widely adopted by the community.

I’m using typescript, and I quickly found the way to define the model with sequelize a bit too verbose, and especially a duplication of the typescript class.

That’s when I discovered sequelize-typescript, which provides this bridge, and leverages typescript’s typings, so mapping can be transparent if so we wish. All it takes is to extend a base Model class, and some annotations.