Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MongoDB support for Prisma 2 #1277

Open
gotenxds opened this issue Jan 6, 2020 · 59 comments
Open

MongoDB support for Prisma 2 #1277

gotenxds opened this issue Jan 6, 2020 · 59 comments

Comments

@gotenxds
Copy link

@gotenxds gotenxds commented Jan 6, 2020

Our team is considering working with Prisma, but as Prisma 1 seems to go out of scope and prisma 2 not mongo ready yet would love to know when is support expected to be released? a week? a month ? 2021 ?

@nikolasburk nikolasburk changed the title mongodb support, when MongoDB support for Prisma 2 Jan 8, 2020
@nikolasburk
Copy link
Member

@nikolasburk nikolasburk commented Jan 8, 2020

Hey @gotenxds, thanks a lot for opening this issue! While we can't commit to a concrete timeline, our current plans are to tackle MongoDB support some time this year. Right now we're focussed on making Prisma stable and resilient for relational DBs, we'll post updates on MongoDB support once the initial, production-ready releases of Prisma 2 are done.

Note that we'll keep this issue open as a tracking issue for MongoDB support (I also took the liberty of updating the title to make this a bit more clear).

@nikolasburk nikolasburk removed their assignment Jan 8, 2020
@macrozone
Copy link

@macrozone macrozone commented Feb 3, 2020

@nikolasburk as development of prisma 1 seems to have completly staled, we are now in a bad position. We want to continue to use mongodb with prisma, in particular because embedded objects make a lot of sense for the kind of content we are dealing with.

But on the other hand there are a lot of flaws and bugs with prisma1 and embedded objects. It would probably a good idea to at least take a look at these issues (and maybe even fix that on version 1), so that they won't occur on prisma2.

@nikolasburk
Copy link
Member

@nikolasburk nikolasburk commented Feb 5, 2020

Hey @macrozone, I'm really sorry that we're currently unable to fix your situation. As I mentioned, unfortunately we can't commit to a timeline but we're already collaborating with the folks from MongoDB and they're in the process of building a MongoDB Rust driver which is required as foundation for our MongoDB connector. If the current limitations of Prisma 1 are a blocker for you and you can't afford to wait until Prisma 2's MongoDB connector is ready, it might be that you have to migrate off of Prisma for now unfortunately. I assume migrating the data to a relational database is not an option for you?

@macrozone
Copy link

@macrozone macrozone commented Feb 8, 2020

Hey @macrozone, I'm really sorry that we're currently unable to fix your situation. As I mentioned, unfortunately we can't commit to a timeline but we're already collaborating with the folks from MongoDB and they're in the process of building a MongoDB Rust driver which is required as foundation for our MongoDB connector. If the current limitations of Prisma 1 are a blocker for you and you can't afford to wait until Prisma 2's MongoDB connector is ready, it might be that you have to migrate off of Prisma for now unfortunately. I assume migrating the data to a relational database is not an option for you?

yes, we are evaluating to use postgres instead of mongodb. Unfortunatly, embed types are still not implemented in prisma2: #1277 (comment)

@macrozone
Copy link

@macrozone macrozone commented Mar 4, 2020

@nikolasburk just wanted to tell you that we now using prisma2 with postgres (from google cloud) and we love it so far! (in particular with nexus) I hope you guys can keep the momentum!

@duro
Copy link

@duro duro commented Mar 31, 2020

Getting this working with Mongo would be a god send. Mongoose + TypeScript (using Typegoose) is still painful. Mongoose just has some inherent design principles that make type safe usage very tedious and manual. +1 x1000

@raulingg
Copy link

@raulingg raulingg commented Apr 2, 2020

I'm looking forward to seeing support for MongoDB, that would be a huge addition to Prisma.

@TheEarlyNerd
Copy link

@TheEarlyNerd TheEarlyNerd commented Apr 7, 2020

Can't wait to see what you guys come up with for MongoDB. NoSQL DBs are becomming more common for early companies and startups to use, so if your tooling could build on top of MongoDB there would be a massive amount of interest from new companies to use Prisma!

@andyWynyard
Copy link

@andyWynyard andyWynyard commented Apr 8, 2020

I have a new project we are kicking off at work and I was really hoping I could build a POC for Prismic 2 for it over easter. Unfortunately, we are kinda tightly bound with MongoDB, and it would be a difficult sell to the higher-ups to go a different direction. I really hope you guys can get this one nailed down.

@jellz
Copy link

@jellz jellz commented Apr 10, 2020

Really looking forward to Mongo support, hope it comes really soon, will definitely be using this with Mongo in the future.

@patrick-samy
Copy link

@patrick-samy patrick-samy commented Apr 17, 2020

Out of curiosity, would it be possible and sensible to implement our own database connector for MongoDB or BigTable for example? Or would it just be easier to implement a wrapper at the API level in resolvers?

@saghm
Copy link

@saghm saghm commented Apr 23, 2020

Hello! I'm one of the developers of the MongoDB Rust driver, so I just wanted to pop in and give an update about the status of the driver. We just recently completed our rewrite of the driver internals to be async, and we're now finishing up the last few features we need to be able to release our first beta of the driver, which should have everything that's needed for adding MongoDB support to Prisma.

Thanks for your patience while waiting for us to finish up our work on the driver; we hope to have something ready soon!

@saghm
Copy link

@saghm saghm commented May 5, 2020

Hello again! Just following up to let every know we released the first beta for the MongoDB Rust driver, v0.10.0, just moments ago, so async support is fully available for the driver.

@harisvsulaiman
Copy link

@harisvsulaiman harisvsulaiman commented May 6, 2020

@saghm That is Wonderfull news! Looking forward to using it.

@Mi3liX9
Copy link

@Mi3liX9 Mi3liX9 commented May 6, 2020

I'm so excited to use Prisma 2 with Mongodb 😍👍

@lcswillems
Copy link

@lcswillems lcswillems commented May 6, 2020

@saghm How to use it? Does it come directly with Prisma?

@sorenbs
Copy link
Member

@sorenbs sorenbs commented May 6, 2020

Hey @lcswillems and everybody else waiting for MongoDB Support in Prisma.

@saghm is on the engineering team at Mongo who did an excellent job at implementing a MongoDB driver for the Rust programming language, which is used in the Prisma Query Engine. Based on this work, we are now working on creating a MongoDB connector for Prisma. I can't give you a timeline for MongoDB support, but we definitely appreciate the excitement in the community as evidenced by reactions in this thread.

I want to thank the MongoDB team for their excellent collaboration, and I look forward to sharing the result of this work with the wider Prisma community soon.

@andyWynyard
Copy link

@andyWynyard andyWynyard commented May 6, 2020

Hey @lcswillems and everybody else waiting for MongoDB Support in Prisma.

@saghm is on the engineering team at Mongo who did an excellent job at implementing a MongoDB driver for the Rust programming language, which is used in the Prisma Query Engine. Based on this work, we are now working on creating a MongoDB connector for Prisma. I can't give you a timeline for MongoDB support, but we definitely appreciate the excitement in the community as evidenced by reactions in this thread.

I want to thank the MongoDB team for their excellent collaboration, and I look forward to sharing the result of this work with the wider Prisma community soon.

Reactions, hell yes, and they are all positive. Super can't wait for this. Will be doing a POC for our company (currently too many API's and crap all over the place) and we are all in on MongoDB.

This is going to be fun 👍

@var
Copy link

@var var commented May 8, 2020

Hey @lcswillems and everybody else waiting for MongoDB Support in Prisma.

@saghm is on the engineering team at Mongo who did an excellent job at implementing a MongoDB driver for the Rust programming language, which is used in the Prisma Query Engine. Based on this work, we are now working on creating a MongoDB connector for Prisma. I can't give you a timeline for MongoDB support, but we definitely appreciate the excitement in the community as evidenced by reactions in this thread.

I want to thank the MongoDB team for their excellent collaboration, and I look forward to sharing the result of this work with the wider Prisma community soon.

Is there any way we could contribute? Love to help!

@dannysofftie
Copy link

@dannysofftie dannysofftie commented May 11, 2020

Am really looking forward to see prisma2 support MongoDB. Can't wait to migrate from prisma1

@rodrigooler
Copy link

@rodrigooler rodrigooler commented May 20, 2020

Any news about the mongo driver?

@gustawdaniel
Copy link

@gustawdaniel gustawdaniel commented Jun 7, 2020

I would help too if I can.

@duro
Copy link

@duro duro commented Jun 10, 2020

I will echo @javaniecampbell. Having Prisma support Mongo aggregation pipeline in at least some fashion (either as a raw query type function, or with some kind of generic to be able to describe the expected output) as well as have support for geo queries, would be a huge win. There are many other "ORMs" that claim to have cross SQL/Mongo support often leave these features out, which drives people back to Mongoose, which is a pain to use in this new TypeScript heavy world we now live in.

@harisvsulaiman
Copy link

@harisvsulaiman harisvsulaiman commented Jun 10, 2020

@duro That is exactly, how I feel. We have a lot aggregation pipelines in our application and expect it to grow more.

@adelin-b
Copy link

@adelin-b adelin-b commented Jun 12, 2020

Getting this working with Mongo would be a god send. Mongoose + TypeScript (using Typegoose) is still painful. Mongoose just has some inherent design principles that make type safe usage very tedious and manual. +1 x1000

@duro How do you make prisma 2 + typescript typesafe ? From #1396 #227 code schema definition is not here yet.

@duro
Copy link

@duro duro commented Jun 12, 2020

@adelin-b First off, I am not using Prisma 2 with Mongo (since it's not supported yet, hence this thread). I have went with Postgres for my latest project, as it was more important to me that I have Prisma in the app, than getting to use Mongo. While Prisma may not have "Code First" Schema APIs (which those two issues you mentioned are adressing), it does have Schema First, which allows me to define the schema, and then run prisma generate to generate out an client that has all crud operations around the models perfectly typed according to the schema. It's lightyears better than trying to use Mongoose with TypeScript + Typegoose.

@thebradbain
Copy link

@thebradbain thebradbain commented Jun 23, 2020

Just jumping in to echo @duro and @nickreynke that having access to the aggregations pipeline through Prisma would be great (no need to get super fancy with it, even just a straightforward and barebones way to perform an aggregation with raw mongodb aggregation syntax would be miles ahead of existing solutions).

Also another feature that would be great to have is multi-tenancy/clustering support.

Mongoose didn't originally build with multi-tenancy in mind, so even though they technically support it now, it's not very pretty (having to explicitly switch the connection and then reload in the models after switching, since all mongoose schemas are scoped to a single connection). Something like:

// prisma schema file

datasource mongdob {
  url      = env("DEFAULT_DB_URL") // or CLUSTER_URL?
  provider = "mongodb"
}
// main.js

const client1 = new PrismaClient()
const client2 = new PrismaClient('DIFFERENT_DB_URL')

const [ db1, db2 ] = await Promise.all([ client1.connect(), client2.connect() ])

... 

EDIT: I notice this is actually already WIP according to #1487, specifically this comment

@ShahrozTanveer
Copy link

@ShahrozTanveer ShahrozTanveer commented Jun 25, 2020

Any news about MongoDB support for Prisma 2?

@Errorname
Copy link
Contributor

@Errorname Errorname commented Jun 26, 2020

@thebradbain, I made a tool for multi-tenancy in Prisma, it may be useful for your needs: https://github.com/Errorname/prisma-multi-tenant

@mtedone
Copy link

@mtedone mtedone commented Jul 1, 2020

Waiting impatiently for MongoDB support in prisma 2. Go go go guys! Deliver awesomeness

@LexSwed
Copy link

@LexSwed LexSwed commented Jul 2, 2020

Same here! Waiting for this 😍

@gp187
Copy link

@gp187 gp187 commented Jul 4, 2020

Same same!

@sourabhbagrecha
Copy link

@sourabhbagrecha sourabhbagrecha commented Jul 7, 2020

Big fan of @mongodb and now Prisma too, can't wait for Prisma to release MongoDB support.

@kierangilliam
Copy link

@kierangilliam kierangilliam commented Jul 16, 2020

Any updates on MongoDB support?

@suhailibnnisar
Copy link

@suhailibnnisar suhailibnnisar commented Jul 17, 2020

so you guys also subscribed to this issue but don't post any comment =D

@aertmann
Copy link

@aertmann aertmann commented Jul 21, 2020

Support for MongoDB in Prisma 2 would be much appreciated!

@dimaip
Copy link

@dimaip dimaip commented Jul 21, 2020

Please prioritize MongoDB support for Prisma 2!
We are stuck with discontinued Prisma 1 because of that, and there are many crucial things not working there as they should!

@abhischekt
Copy link

@abhischekt abhischekt commented Jul 22, 2020

We really like prisma for our application and are awaiting support for MongoDB in Prisma 2 so we can migrate to it! Being able to easily write custom aggregations would be something really useful for us

Thank you for all your hard work 🙏

@ChristophDietrich
Copy link

@ChristophDietrich ChristophDietrich commented Aug 2, 2020

Looking also for the Prisma 2 is supporting MongoDB, because otherwise I can't migrate from Prisma 1 to Prisma 2.

Also the subscription service should be available as seen in Prisma 1.

Looking forward to your delivery for MongoDB support 🍻🍻👍👍

@suhailgupta03
Copy link

@suhailgupta03 suhailgupta03 commented Aug 4, 2020

Any proposed date?

@nikolasveneti
Copy link

@nikolasveneti nikolasveneti commented Aug 7, 2020

Also looking forward to Prisma x MongoDB, great job so far 🙌

@suhailgupta03
Copy link

@suhailgupta03 suhailgupta03 commented Aug 8, 2020

MongoDB's support for Prisma 1 has not been very encouraging. There are a couple of issues I have found, particularly crashing of Prisma when dealing with a big Mongo document (~25MB). The memory usage and RAM usage also goes too high with Prisma 1 + Mongo when going for parallel updates, inserts, queries. Here is one of the issue I have opened with Prisma 1 prisma/prisma1#5105

@alemor10
Copy link

@alemor10 alemor10 commented Aug 8, 2020

I AM SAD I NEED PRISMA MONGO

@muratbeser
Copy link

@muratbeser muratbeser commented Aug 31, 2020

Hi, What we can do to help about adding NoSQL support, I'm not using MongoDB but I do use rethinkdb

@stephanlevi
Copy link

@stephanlevi stephanlevi commented Sep 6, 2020

Any news when PRISMA 2 will support MONGODB ?

@yjarid
Copy link

@yjarid yjarid commented Sep 6, 2020

any timeline please ?

@softmarshmallow
Copy link

@softmarshmallow softmarshmallow commented Sep 6, 2020

stop asking about timeline and +1. do the actual contribution if you are that much in too it.

@gimli01
Copy link

@gimli01 gimli01 commented Sep 10, 2020

^
seriously guys a lot of us are using this for free. if it's really that important to you you'd make time to contribute like he said.

keep up the good work guys!

@PinkaminaDianePie
Copy link

@PinkaminaDianePie PinkaminaDianePie commented Sep 14, 2020

I believe there could be a lot of contributions if this tool would be written in JS, but since it's Rust instead, not that many devs would be eager to learn a totally different language just for a single contribution. So don't be surprised that people use "+1" or comments on this issue instead.

@ajcwebdev
Copy link

@ajcwebdev ajcwebdev commented Sep 18, 2020

This issue has been open for a while now and received quite a lot of discussion so I wrote a quick rundown for anyone jumping into this for the first time. At the end I asked a few big picture questions and Nikolas Burk gave a great response so I wanted to make sure all this made it back into the issue as well for those who have been tracking it.

What's the status of mongoDB and prisma2?

Nikolas Burk's response

My response to Nikolas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.