Using multiple databases in one application

I am currently developing an application in node.js. I have a Postgres / PostGIS database for storing geospatial information and rendering them as SVG. So far, everything is working. On the other hand, I have a CouchDB database populated with data from a previous project.

I would like to combine this data with geospatial data from postgis via node.js, but I'm not sure how to go about the structure of my databases.

Is it good to work with two different types of databases - even paradigms - in one application? Or is it better to convert data from one database to another?

BTW: This is just a hobby project.

+6
source share
1 answer

There is nothing wrong with accessing two databases from the same application. This is a commonly used model. It is not uncommon to have a Node server to access both Mongodb and Redis, using each for its own strengths. You just need to link the data relationships in the application, not in the database.

Node is particularly suitable for applications with multiple databases, as you can access multiple resources at the same time. The async package makes it easy to query multiple databases at once and combine the results. This is what synchronous servers usually do in order, waiting for one result before sending a request for a second result. Therefore, if you take full advantage of Node's capabilities, you will have a better experience accessing multiple data sources, and then you can use many other popular web development platforms.

+7
source

Source: https://habr.com/ru/post/943806/


All Articles