Skip to main content

Command Palette

Search for a command to run...

[WIL] ORM vs. ODM & noSQL vs. SQL

04/30/23

Updated
[WIL] ORM vs. ODM & noSQL vs. SQL

WIL

Wrap-up Retrospective: What I learned

  • HW4 Refactoring - 3-layered architecture

  • Transaction

  • Access/Refresh Token - using Redis

  • JS Class

  • Socket

  • Node jest module for testing

The goal for the next week

  • Node jest module

  • Node Express Review


ORM & ODM

ORM stands for Object-Relational Mapping, which connects databases and object-oriented programming. With an ORM, database tables can be represented as objects and objects can be mapped to database tables. This allows developers to work with databases without writing SQL directly.

  • sequelize is an ORM used in Node.js for supporting relational databases (RDBMS) such as MySQL, PostgreSQL, and SQLite. With sequelize, database tables and columns can be defined and relationships can be established in an object-oriented way.

ODM stands for Object-Document Mapping, which is used for document-oriented databases, which store data as documents in a hierarchical structure like JSON or XML. ODM maps the documents to objects in an object-oriented programming language. ODM is for document-oriented databases.

  • mongoose is an ODM used in Node.js for easily handling MongoDB data. With mongoose, database schemas can be defined and models can be created based on those schemas.

noSQL vs SQL

  • noSQL refers to non-relational databases that can handle various forms of data effectively, especially large amounts of unstructured data. This includes database types such as key-value, document, graph, and column-family. noSQL supports BASE (Basic Availability, Soft State, Eventually Consistent) transactions, is suitable for horizontal scaling, and is good for processing massive amounts of data on distributed servers.

  • SQL refers to relational databases that structure data in tables with columns and rows. Relationships between tables are established and data is retrieved, updated, and deleted using SQL statements. SQL is effective for handling structured data, ensuring data consistency and integrity. SQL supports ACID (Atomicity, Consistency, Isolation, Durability) transactions, is suitable for vertical scaling, and is good for handling multiple transactions on a single server.