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

NoSQL databases (particularly MongoDB) #715

Open
luislobo opened this issue May 1, 2023 · 5 comments
Open

NoSQL databases (particularly MongoDB) #715

luislobo opened this issue May 1, 2023 · 5 comments

Comments

@luislobo
Copy link

luislobo commented May 1, 2023

Is this package supposed to be the base to build NoSQL implementations?

MongoDB has basic primitives that match most SQL use cases (although heavy use of aggregations might be needed in some "advanced" cases).

Should there be a separate yiisoft/object-db? I can see it having a close mapping to what an ActiveRecord is....

@samdark
Copy link
Member

samdark commented May 1, 2023

I'm still not sure if it is a good idea to do that. It was like this in Yii2 but whole AR was modelled based on MySQL so majority of MongoDB features were not used.

@luislobo
Copy link
Author

luislobo commented May 1, 2023

Yeah. Nowadays, MongoDB supports transactions (https://www.mongodb.com/docs/manual/core/transactions/) , multiple CRUD alternatives (insertOne/Many, updateOne/Many, deleteOne/Many, etc https://www.mongodb.com/docs/manual/crud/), only thing is doing "JOIN" operations: you need to do aggregations with $lookup (far more complicated that what I'd love, and $lookup usage depends on the MongoDB version, being the latest the most flexible one).

BUT, a person with enough motivation could make it happen :)

@xepozz
Copy link
Contributor

xepozz commented May 1, 2023

BUT, a person with enough motivation could make it happen :)

Isn't it you? ;)

@luislobo
Copy link
Author

luislobo commented May 1, 2023

I could, but I haven't used Yii in production for years (worked in Node.js for the last 9). I do have a lot of experience with MongoDB.

I'd need guidance on how to start building it for Yii 3... if I had a base project.

@xepozz
Copy link
Contributor

xepozz commented May 1, 2023

We have https://github.com/yiisoft/demo, so you can use it as a temporary project.

If you have questions/problems you may ask them directly in telegram chat, instead of creating issues for each one.

https://t.me/yii3en

But general question is do we really need to combine two different database approaches into the one?
It's nice to have similar api to work with any databases, but in addition it brings lots problems/overrides/incompatibles. Isn't it?

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

No branches or pull requests

3 participants