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

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!

--

--

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
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