chapter 4 Flashcards
(6 cards)
What is ORM in the backend?
ORM means Object-Relational Mapping. It helps to work with SQL databases by converting tables into objects in your code.
What is ODM in the backend?
ODM means Object-Document Mapping. It helps to work with NoSQL databases (like MongoDB) by converting documents into objects in your code.
What is the main difference between ORM and ODM?
ORM is for SQL databases (tables, rows, columns).
ODM is for NoSQL databases (documents, collections).
Give examples of ORM libraries.
Sequelize (Node.js), SQLAlchemy (Python), Hibernate (Java).
Give examples of ODM libraries.
Mongoose (Node.js), MongoEngine (Python).
Why use ORM or ODM?
To avoid writing raw SQL/NoSQL queries. You can work with objects directly in your code, which saves time and reduces errors.