Nest JS — Managing multiple connection solved— Master, Slave easily | Working solution | 2022 solution

Shivam Gupta
Mar 2, 2022

In NEST JS You can setup read/write replication using TypeORM.

app.module.ts

Now when u perform any write operation using repository it will use master config and read will use random slave config

Example —

This will use one of slave connection

For more information You can refer to this documentation — https://orkhan.gitbook.io/typeorm/docs/multiple-connections

Thanks for reading my post , if you like please follow and clap!

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Shivam Gupta
Shivam Gupta

Written by Shivam Gupta

Full Stack Engineer (Web/App) working on different JS Technologies & frameworks— Angular, Node, Typescript, Ionic, Firebase, AWS, ElK...Love to write cool stuff

No responses yet

Write a response