Sharing database

Hello,

We have been using and loving Netlify for years.

We were looking to migrate our database away from another provider, and I was really excited about the idea of further integrating with Netlify’s ecosystem.

When beginning to provision it, I realize it didn’t seem compatible with our needs:

  1. We have a client-facing application (React) with a set of APIs.
  2. We have a back-office application (HTML/jQuery) with its own set of APIs
  3. Both APIs speak to the same database.

In the past, I’ve had a development/staging DB, and a production DB. In Netlify’s env vars, I’d simply set that in production, they speak with the production DB, and in all other envs (deploy previews, local dev, etc.) it speaks with the dev/staging DB.

With your database, however, I see two ways in which my project architecture can’t take advantage of your database.

  1. There’s no way to use the netlify package to communicate to a database in a different project. I have to use a raw/generic psql driver.
  2. I can’t have branch deploys from one project create temporary databases/branch db’s based on another project’s db.

I considered moving the projects into a monorepo so they could all share the same project, but because our client-facing application is published under 5+ white label brands on their own URLs, it makes it difficult to imagine how I should structure the Netlify projects to work with this.

  1. Is there a way/recommended implementation for how to share a DB between netlify projects?
  2. Any way to manually specify/invoke branching in that case?