Skip to content

Latest commit

 

History

History
86 lines (61 loc) · 4.26 KB

File metadata and controls

86 lines (61 loc) · 4.26 KB

Video thumbnail

A progressive Node.js framework for building efficient and scalable server-side applications.

NPM Version Package License NPM Downloads CircleCI Coverage Discord Backers on Open Collective Sponsors on Open Collective Support us

Description

Run long-running tasks with NestJS with the techniques demonstrated here

  • System design primer project demonstrates how to design a backend project in a way that can scale gracefully
  • When it comes to long-running tasks and tasks that consume too much computing power, it is interesting to handle them asynchronously in a so-called, worker.
  • So an optimal approach is, to move the heavy/long-running task to a worker, and communicate with them asynchronously via queues, like Kafka, SQS or RabbitMQ.
  • For this project, I'm using RabbitMQ as the Queue message broker, but the choice is up to you and what you feel most comfortable using

Flow description

The following flow explains how everything works

Video thumbnail

Installation

$ yarn install

Running the app

  • PS For running both apps correctly, make sure that the docker engine is running on your machine.
# start docker-compose file

$ docker-compose up

# development with watch mode
## web app
$ yarn start:dev
## worker app
$ yarn start:dev worker-backend-app

Test

# unit tests
$ yarn run test

# e2e tests
$ yarn run test:e2e

# test coverage
$ yarn run test:cov

Support

Nest is an MIT-licensed open-source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.

Stay in touch

License

Nest is MIT licensed.