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!

--

--

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