laravel / ideas

Issues board used for Laravel internals discussions.
938 stars 28 forks source link

[Laravel 6.0][Proposal] Add noSQL data store support #1387

Open paras-malhotra opened 5 years ago

paras-malhotra commented 5 years ago

I know that this has been struck down before in #288 but that was 2016! 2 years hence, there has been a significant increase in popularity and demand of noSQL databases.

Why NoSQL Unstructured or schema-less data has grown tremendously with use cases becoming tremendously common (product catalogs, user profiling, user generated content, mobile apps/games with high volume data, IOT, analytics, etc.). NoSQL is not an "enterprise" feature anymore, it's a must have for web/mobile development!

But there's a MongoDB package already right? Yes there is, but I don't think we should take the Eloquent ORM approach for noSQL data stores. ORM standards were never meant for noSQL data stores. Eloquent was never meant for noSQL! Although the package is great, it doesn't do justice to noSQL. I think we need to go to the drawing board and figure this out without force-fitting Eloquent. There are some ODM (non-ORM) standards specifically for noSQL out there.

Ok, so why not develop a new package? Why add it to the core framework? NoSQL data stores are pretty common (as explained above). Web development in 2019/2020 would increasingly use noSQL. These are not uncommon cases (product catalogs, user generated content, analytics, etc.)! A framework should support common use cases. Also, if it's part of the framework, we could get much more contributors to this key feature and we need to pick the brains of the Laravel "big guns" for this! I think it's a paradigm shift needed in the next major release, period.

Hey it's not even supported out of the box in Rails! I hear that a lot. I think Laravel now is more popular than Rails, with better features and a much better ecosystem. Laravel should lead the way, Rails should follow. Question we should be thinking is - is this a must have / common use case for web / mobile apps today?

I would be happy to contribute to this if we do include in the framework.

PS: DB Rankings 2018 and DB rankings 2017. Guess which DB's cropping up (now at 25%).

sisve commented 5 years ago

Would it make sense to develop it as a separate package, and merge it into the framework once it reaches stability? I believe this approach would make it easier for many developers to work on the feature without having commit permissions to the framework repository.

paras-malhotra commented 5 years ago

@sisve yes I think that would make sense but I believe if we're developing this as a separate package (even to start off), this should be an official Laravel package (like Scout or Horizon). Otherwise it would not get the traction or contribution necessary to get this right.

deleugpn commented 5 years ago

I would be interested in a Laravel friendly noSQL library even to help me learn how to do amazing things with it.

mfn commented 5 years ago

I feel such kind of proposal really has no movement unless a working and proven package is presented.

I don't believe one day landing a huge PR introducing a new NoSQL will ever be accepted by anyone.

There are so many questions to answer and they don't start off with technical stuff. What abstraction? What NoSQL databases are targeted? Etc.

I mean in my book both MongoDB and ElasticSearch are NoSQL databases but they've fundamental differences on the technical part as well as their goals what kind of problems they solve.

The SQL dialect difference are already a headache but an abstraction work surprisingly works well for 95% (just a big number, TBH) but I would think hat this would be much lower for NoSQL?

paras-malhotra commented 5 years ago

@mfn completely agree. That's why I think it should be a Laravel official package. The package would need to be opinionated (as Laravel is).

elfeffe commented 4 years ago

MongoDB is almost 100% supported with the actual plugin, this should be easy to make it 100% compatible. I think NoSQL is too generic, and support all NoSQL as a MySql replacement is impossible. But this is not impossible to support MongoDB and it's features are great for a lot of projects.