Coder Social home page Coder Social logo

ORM roadmap about strapi HOT 15 CLOSED

strapi avatar strapi commented on May 1, 2024
ORM roadmap

from strapi.

Comments (15)

devinivy avatar devinivy commented on May 1, 2024

I'm also just generally curious why strapi has chosen to switch ORMs.

from strapi.

crunchtime-ali avatar crunchtime-ali commented on May 1, 2024

@devinivy
As @loicsaintroch said on the Slack #framework channel:

Hey @channel! As you all know we currently use the Waterline ORM. Unfortunately, there is no more maintainers taking care of it, both the core and the adapters... So, we definitely need to change the ORM since most of the issues we encounteer on Strapi are due to Waterline. We really need to know: which DBs do you use? What ORM do you like and why?

Please join the Strapi Slack instance for such questions at http://slack.strapi.io/

from strapi.

loicsaintroch avatar loicsaintroch commented on May 1, 2024

Hey!

Sorry for the lack of communication those last few days— we were just enjoying holidays. Time to get back to work!

First of all, Strapi needs a production-ready ORM which is not the case of Waterline mainly because adapters are too unstable and not well maintained to make a stable product like we need. We can’t give an all-in-one stack with some bugs coming from a dependency. If you take a look at our issues almost all of them are due to Waterline.

Also, every NoSQL database has its own use and specific features. For example, an admin panel can’t really interact the same way with a MySQL database than with a Neo4j database. We can’t take advantage of every NoSQL database specialties. NoSQL is good but for specific use. This is not our case.

Strapi uses more and more relations as long as you follow the conventional structure. That’s why a SQL ORM is more appropriate. The main Node.js SQL ORMs are Sequelize and Bookshelf. The both of them have pros and cons. We still don’t know which one to use. I personally prefer Bookshelf for its approach using the Knex query builder but Sequelize seems more stable— need feedback here.

We thought about being ORM agnostic which is technically great. Unfortunately this is not our philosophy since we want an all-in-one stack— we can call it a Data Management Framework. If we support several ORMs we won’t be able to have a marketplace since every item won’t have the same structure. However, you’ll still be able to use your own ORM on your side but the Studio won’t work with it. We’ll only support the official ORM used by the Strapi framework.

To finally answer your question: we won’t officially support MongoDB as a database but you’ll still be able to use it on your own. The user management and the Studio won’t be compatible with it since it’s developed to only work with the official supported ORM.

I hope I answered your question but I let the issue open since we really want/need feedback on this.

Thank you for your question @akoudal.

from strapi.

alkiko avatar alkiko commented on May 1, 2024

Thanks for the detailed answer - it definitely answered my question.

Bad news for me, as the studio API generator and user management is brilliant.
I'll definitely keep this project on the radar, and get back if I do a sql project.

Cheers,
Allan

from strapi.

loicsaintroch avatar loicsaintroch commented on May 1, 2024

We give some thoughts about the ORM roadmap and put it some work.

I have a very early prototype of Strapi working both with Waterline and Bookshelf without changing the models at all. So we definitely can make this work with Mongoose or whatever on the framework. However, we'll need to make it right on the Studio regarding the UX on the settings page.

I don't want to rush anything here but if it works correctly with Bookshelf and Waterline I don't see why we won't make a Mongoose hook and support it on the Studio since we don't need to change the model definitions.

As I said, don't take my word as a final decision but more as a possibility.

from strapi.

TylerGarlick avatar TylerGarlick commented on May 1, 2024

I kind of like the approach of waterline honestly. I rarely use a SQL database these days with my apis, and I would rather see a data storage agnostic approach with squelize or orm "x" as the default. As long as I'm not pinned to a particular implementation, I think it would be most beneficial.

I'd be happy to help if you'd like to collaborate with your ideas.

from strapi.

devinivy avatar devinivy commented on May 1, 2024

There's another adapter based ORM named Firenze which looks nice, but does not support associations in the way Waterline does. It's a young project, and not heavily "featured".

from strapi.

TylerGarlick avatar TylerGarlick commented on May 1, 2024

What's the beef with waterline?

from strapi.

TylerGarlick avatar TylerGarlick commented on May 1, 2024

I've used this one before it was quite pleasant. http://www.camintejs.com/en

from strapi.

loicsaintroch avatar loicsaintroch commented on May 1, 2024

We'll use Bookshelf with Knex as the default ORM but you'll be able pull it out since it won't be part of the Strapi core. This way, you can move to another ORM like Waterline. Here are the repos (empty for now):

from strapi.

TylerGarlick avatar TylerGarlick commented on May 1, 2024

Is the plan to then support these orm's via a plugin interface?

from strapi.

loicsaintroch avatar loicsaintroch commented on May 1, 2024

We'll support several ORMs via the hook system. The Strapi core will require mandatory ORMs from the models thanks to orm key in each model.

from strapi.

TylerGarlick avatar TylerGarlick commented on May 1, 2024

Seems reasonable to me...

from strapi.

loicsaintroch avatar loicsaintroch commented on May 1, 2024

We decided to support several ORMs aiming to allow you to use other DBs such as MongoDB, ArangoDB, RethinkDB, Redis, etc. if you have specific needs.

from strapi.

alkiko avatar alkiko commented on May 1, 2024

Awesome

from strapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.