简体   繁体   中英

How to use one relational(postGreSql) and one non-relational(MongoDb) database in single node.js application

I have to work on one Node Js project where I have to use two database in single application, One database is MongoDb and the other one is postgreSql. Till now I have only used only one dababase in one project. I just want to know that "Is it possible to use two different database as mentioned above in one Node Js project". If yes can you please provide me essential configs and plugin required to setup the project ?

yeah... NoSQL & another RDBMS together...because

NoSQL: fast and simple, but has little to none structure to enforce constraints on data.

RDBMS: satisfies all ACID properties, keeping your data safe and clean. But performance goes down rapidly as traffic and data set size grow.

for doing so ..

you can use an ODM (Object Document Mapper) like mongoose to deal with mongoDB

& an ORM (Object Relational Mapper) like sequalize to deal with mysql , postgre

As provided in the docs.. you got to install both

npm i -s mongoose sequelize

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM