uprm-inso4101-2024-2025-s1 / semester-project-mercado-colegial-online

semester-project-mercado-colegial-online created by GitHub Classroom
8 stars 2 forks source link

Database Design or Backend: ODM library #143

Open YampierFernandez opened 4 days ago

YampierFernandez commented 4 days ago

Objective: Research the benefits of an Object Data Modeling (ODM) library for MongoDB and suggest one that can be worked with.

Requirements: •Research the benefits of using an ODM library for the application • Investigate and compare some ODM libraries. • Suggest an ODM library that would benefit the project the most. • Provide light description and reasoning for choosing this ODM library.

Completion Criteria: • State choice of a suitable ODM library to be used for the project. • Provide a link with information on the chosen ODM library (documentation or the ODM library’s website would be best). • Write and provide a description of the chosen ODM library and some of the reasons for the choice. This should be a paragraph or two.

Time Constraint: Saturday, October 19th.

Urgency Level: 5 Difficulty: 2

DiegoVazquez1 commented 1 day ago

An ODM library basically simplifies the interactions between an application and a MongoDB database which is what we're using, by mapping objects in code to document in the database. It abstracts away and simplifies any low-level database queries, which helps devs to work with objects and methods instead of raw database commands and makes everything more readable. The ODM also provides a a validation mechanism to ensure the data being saved in good. The best ODM library for the project would be Mongoose. It works great with MongoDB, provides structure to the project and its good for large projects requiring extensive control over data validation and lifecycle management. Plus there is a lot of documentation to follow if needed.

https://www.mongodb.com/developer/products/mongodb/mongodb-orms-odms-libraries/

https://medium.com/spidernitt/orm-and-odm-a-brief-introduction-369046ec57eb#:~:text=What%20is%20ODM%3F,graph%20database%2C%20etc.).

https://stackoverflow.com/questions/18531696/why-should-we-use-mongoose-odm-instead-of-using-directly-mongodb-with-mongodb-dr

Another option can be Prisma which works with MongoDB and Node.js. "With Prisma, you define your models in the declarative, which serves as the single source of truth for your database schema and the models in your programming language." The process of querying data is a lot more natural and returns plain JS objects.

https://www.prisma.io/mongodb