What DBs does Redwood Support?

Hey Brecht, thanks for the link! You are correct, the project has you delete all the Prisma directories and code and we query the Fauna GraphQL API directly. I had a blast making the project and the whole Fauna team was incredible to work with.

2 Likes

I recently did some research into what the situation was with MongoDB and Prisma that wasn’t directly about Redwood but should still be pretty relevant to the discussion here. I asked some big picture questions and Nikolas Burke gave a really great response that’s worth sharing here.

TL:DR Prisma+Mongo is super duper hard and learn Rust


Hey Anthony :wave: thank you so much for this great writeup and for summarizing the comments from the issue :pray: We are very aware that people are eagerly waiting for MongoDB support in Prisma 2! I want to shed some light on the current situation and how we are currently thinking about a MongoDB connector by responding to your questions.

Does Prisma need anything else from MongoDB to implement a connector or is the MongoDB Rust driver good to go?

As far as I’m aware, we don’t need anything else from MongoDB on a technical level.

Is anyone at Prisma currently working on a MongoDB connector or accountable for tracking its progress?

We are not actively working on a MongoDB connector at the moment. This is also reflected on our roadmap.

Note that there are a few technical prerequisites for the MongoDB connector, such as the ability to use native database types in the Prisma schema (the good news is that this is under active development and likely to be released within the next 2-3 months). Another feature that we need to get done before we can get serious about a MongoDB connector is Prisma Migrate. Migrations for SQL and NoSQL databases mean very different things. We need to be confident about our solution for SQL databases before we can “afford” expanding to NoSQL ones.

If not what can contributors do to help Prisma out?

Unfortunately I believe there’s not much that contributors can do at this point, unless they have a lot of free time and come equipped with some very solid knowledge about Rust, JS/TS and databases altogether.

While Prisma is open source, the software we’re building is extremely complex. The onboarding processs for new developers who need to get into our codebase typically taskes several days/weeks until there’s a level of familiarity where they can independently contribute. In that sense, it seems practically impossible that somebody who’s not part of our engineering orgnization would be able to grasp the complexity of the codebase and would be able to contribute. We are aware that this is not ideal though and one of our internal engineering initiatives for the next months is to start better documenting the internals of Prisma – hopefully this will make it easier for external folks to contribute in the future!

However, I actually think that the complexity of the codebase is not the main problem in this case. The bigger one is that there a lot of unknowns and unresolved “product questions”. The Prisma schema as well as the Prisma Client API are currently optimized for relational databases. MongoDB brings a new database paradigm and we’ll need to figure out how this can play nicely together with our existing tools.

So, what can you do to help?

Talk to our product team! Share your thoughts about the MongoDB connector with the product team directly or keep commenting in the GitHub issue. Your input will be the foundation for what we’re building, so if you’re eagerly waiting for the MongoDB connector, th best thing you can do right now is help us figure out what it actually should look like and how it should work.

As I said, we are very aware that people want MongoDB support (so do we :smile:), but there are a few roadblocks we need to get out of the way before we can start serious development on it.

Mongo support is getting here slowly but surely. The Prisma team is accepting applications for user testing and amazingly enough Gautam Singh has, against all odds, rolled his own solution with Prisma and Keystone.

1 Like

I think of the coupling with Prisma as the blocker from going full polyglot db. It’s a flexible ORM/driver for a good subset of tried and true databases, but any robust app is polyglot and sources data from multiple aggregates. Moreover, not every team will buy-in on Prisma-- so even if you get it into a project, it’s often running on its own and needs to compromise due to external migrations coming from another codebase.

I also think that the db compatibility issue can be solved by GraphQL alone w/ aid from the framework to enhance dev experience and doesn’t require DB-development chops as long as there is a robust JS driver for the DB itself.

GraphQL’s promise is to adapt any and all data sources into 1 easily usable and dev-experience focused pattern that can be write + read optimized. The tight binding w/ Prisma in this case somewhat undoes that because of the inflexibility in DBs. Prisma is nice because it normalizes DSL for a variety of relational DBs, but the support isn’t enough and in a lot of cases, full parity probably isn’t possible. The DSL philosophy is relational and may not be immediately compatible with nosql patterns as seen by the relative slow development of the MongoDB driver (which I bet is a lot like jamming a square peg into a triangle hole).

If I could just fill out some core generalized boilerplate that allows me to rock n roll with any data source + multiple data sources, RW would be such an easy sell for any team. What that possibly looks like to me is a decoupled /services folder with resolvers that can access any data source I want and 1 gql schema folder where I create my SDLs without worrying about anything else but the schema.

Hey wait a minute… the framework is like 85% there!

Databases RedwoodJS Supports as of Early 2022

Over the last two years, the amount of ways to connect to a database with Redwood and the amount of ways to deploy and host that database have increased tremendously.

Supported by Prisma

Prisma has expanded their list of relational/SQL options and started introducing non-relational databases.

Databases with GraphQL Endpoints

For databases that Prisma doesn’t support, the Redwood GraphQL API can be used to query any database that exposes a GraphQL endpoint, whether the underlying database is SQL or NoSQL.

1 Like