How to link several databases to ForestAdmin

Hey guys hope y’all doing great :slight_smile:

I wanted to know if there is a possibility to plug several databases to Forest?
Thank you very much!

Best,

Hello @caid

That would depend on your stack

  • If you are using either rails, express-mongoose, this is not supported (other than using smart collections)
  • If you are using forest-express-sequelize for your current agent, using tables from multiple databases is supported by the ORM, so it is somehow supported by forest admin.
    • this comes with limitations: you need to use smart relationships to create relations between tables that are not in the same DB which are very work intensive
    • Doc is here: Add new databases - Developer guide
  • If you are starting a new project, being able to mix datasources is one of the reasons why that pushed us to work on a full rewrite of how agents are designed.
    • This is currently in beta (not all features are covered, but will be soon enough)
    • Charts/Relationships between databases are natively supported and can be defined with one-liners
    • You can even mix and match different types of databases (SQL/Mongo only for now)
    • Doc is here: Forest Admin - [Beta] Developer guide

Can you tell us more about your use-case so that we assist you with finding the better solution?

Hey @romaing ,

Thank you for your fast reply, really appreciate it!
We are on Nodejs, we have 3 apis with 3 databases and they’re all “connected” (same id references).

Best,

Are you using forest admin now with forest-express-sequelize?

Or is this a new integration?

That will be a new integration.
Yes, it’s with forest-express-sequelize.

Best,

Hi @caid,

For a new integration involving many databases, the Romain third point is the way to go.
You will have good support since it’s the future we are building at Forest.

Regards

Hey @Sliman_Medini ,

Thank you for your reply! Got it!

best,