rahmanfadhil / cotton

SQL Database Toolkit for Deno
https://rahmanfadhil.github.io/cotton
MIT License
140 stars 25 forks source link

MongoDB support? #14

Closed Skillz4Killz closed 2 years ago

Skillz4Killz commented 4 years ago

Any plans on expanding to MongoDB support?

rahmanfadhil commented 4 years ago

At this point, I don't have any strong enough reason to support MongoDB. It doesn't make this library "better". Switching back and forth between SQL and NoSQL isn't a good idea (if you're building a web service), you have to decide on day one.

SQL and NoSQL have a very different approach to do things. For instance, it's better to embed a document into a document rather than using a foreign key that references another document in a different collection.

Also, the reason why people use NoSQL is that they don't want to have a strict schema. So, if you want to get the most out of NoSQL, just use an ODM.

However, I will keep this issue open, feel free to leave your thoughts here, and be respectful to others! 😁

Skillz4Killz commented 4 years ago

@rahmanfadhil I agree it won't make it better but it would help expand the user pool of this lib to users who like MongoDB. As an example, TypeORM supports MongoDB(not that this means yours is required to support it.)

In my opinion, NoSQL isn't really about avoiding schemas. Mongoose has proven that a majority of MongoDB users do not have issues with schemas. The reason people use NoSQL(in my opinion) is easy to get started and running. MongoDB also provides 2 types of relationships: reference and embedded.

My use case: I wanted to add an ORM built into my library that end users could easily get up and running to build their bots with a complete database implementation working. I have seen that some of my users use MongoDB(including me) for this and it would be nice if the ORM I implement provided MongoDB.