Can i plug in two mysql and mongo DBs in same forestadmin portal

Hi, I went through how to plug in multiple sql and nosql DBs in the docs, but I need a way to plug in two separate mysql and mongo DBs in the same forestadmin portal. What is the current solution to this?


  • Package Version: 6.2.1
  • Express Version: 4.16.4
  • Sequelize Version: 5.15.2
  • Mongoose Version: 5.10.9
  • Database Version: MySQL 5.7, MongoDB 4.4
  • Project Name: xs-library

Hi @satzkrs :wave:

You could plug multiple SQL databases, but it is not possible to plug a NoSQL and a SQL database in the same project, since they don’t use the same agent (forest-express-sequelize vs forest-express-mongoose). In short, you have to create two projects.

As a workaround, you could (but it will be a long path with some difficult steps) create only one project and consider one database as the main database (let’s say the SQL one is the main). Then you could create smart collections for your secondary database: you will have to manually implement each route using mongoose natively. This is actually possible, but not that simple.

:point_right: Let me know if I can help you choosing the right path for your need! Also, feel free to add some details about what you are trying to achieve with these two databases: maybe there is some quick-win solution that we could implement for your particular need!

As we wanted it immediately, I went with a different project and enabled smart relationship using a separate connection.

We have series of micro-services spread across mysql and mongodb data stores, ideally if there’s a way we can bring all this under single project it will be greatful!

Hello @satzkrs :wave:

As @rap2h said, supporting natively multiple DB connection using different DBMS.

The solution @rap2h provided is the best way to go. If you really want to have a single project for all of your connections, you can stick to a project running for your two sql connections, and build smart collections for the mongodb database.

This will require some coding, but is definitely possible :smiley:

Let me know if it helps.


1 Like