0:00 All right, so our first step in expanding our 0:02 existing NestJS 0:03 workflows application into microservices and showing 0:07 us how we can implement this distributed 0:11 transaction workflow saga orchestration 0:15 across multiple services in a microservices 0:19 setting. Now, to do this, we are going to be communicating 0:23 between services using asynchronous messaging. 0:26 Asynchronous messaging allows our services to communicate in a 0:30 decoupled way. We do not have to use synchronous 0:33 communication, 0:34 which will cause blocks inside of our workflow, and it's more 0:38 difficult to handle failures. Instead, using asynchronous 0:42 messaging, we communicate between services 0:45 and ensure that 0:46 no messages are ever lost, keeping our system fully 0:49 consistent. Now, for asynchronous messaging, 0:52 you can use any sort of 0:53 broker you would like. In our case, we're going to use Apache 0:57 Pulsar, which is a great 1:01 open source distributed broker 1:04 by Apache, similar to Kafka, but, but brings a 1:08 lot of improvements. 1:11 And this will allow our services to communicate to one another through this 1:14 broker, 1:15 which is going to allow us to produce messages and store them to the 1:19 broker so that they are never lost, and then we consume messages from 1:23 the same broker in other services. 1:26 So let's go ahead and get started. The first step is to b- expand our 1:29 existing Docker Compose file. Here, we're going to add a 1:33 new service for Pulsar. So we have 1:37 Postgres already in place. I'm going to go ahead and add a new 1:41 Pulsar key here, and this is going to look very similar. 1:45 We're pulling the Apache Pulsar image. 1:48 This is a command we can run to start Pulsar in development mode, 1:52 which is running in standalone. And so everything runs as 1:56 a single container in Pulsar's architecture. 1:59 Normally, it runs through multiple components and 2:03 is distributed and 2:03 fault-tolerant. But for local development, this is a better approach.
The rest of the transcript is for members.
Sign in