advanced-js-reading-notes

Data Modeling

SQL vs NoSQL

SQL (Structured Query Language) is a programming language that is used to manage data in relational databases. Relational databases use relations, which are typically called tables, to store data and then match that data by using common characteristics within the data set. SQL databases examples include MySQL, Oracle, PostgreSQL, and Microsoft SQL Server. NoSQL database is document-based, refers to high-performance, non-relational databases that utilize a wide variety of data models. These databases are highly recognized for their ease of use, scalable performance, strong resilience, and wide availability. NoSQL database examples include MongoDB, BigTable, RavenDB Cassandra, HBase, Neo4j, and CouchDB.

MySQL vs MongoDB

MySQL is an open-source relational database that stores data in ‘tables’ and uses structured query language (SQL) for database access. In MySQL, we pre-define our database schema based on our requirements and set up rules to govern the relationships between fields in our tables. Mon­goDB, on the other hand, is a non-relational database that stores data as ‘documents’ in a binary representation called BSON (Binary JSON). Fields can vary from document to document; there is no need to declare the structure of documents to the system — documents are self-describing. In short, A non-relational database does not incorporate the table model. Instead, data can be stored in a single document file whereas the relational database table organizes structured data fields into defined columns.

read more from this link


sql modeling techniques

Data Modeling – Table Elements :

method to model a relational database table, contain Table Name, Primary Keys, Table Columns, Foreign Key.

Data Modeling – Table Relationships :

connect lines between tables to show relationships. there two relationships like one-to-one and many-to-one.


sequelize api

Sequelize is a promise-based Node.js ORM tool for Postgres, MySQL, MariaDB, SQLite, Microsoft SQL Server, Amazon Redshift, Snowflake’s Data Cloud, DB2, and IBM i. It features solid transaction support, relations, eager and lazy loading, read replication and more.

Sequelize follows Semantic Versioning and the official Node.js LTS schedule. Version 7 of Sequelize officially supports the Node.js versions ^12.22.0, ^14.17,0, ^16.0.0. Other versions might be working as well.


Review, Research, and Discussion

Better program design and higher code quality.

Detailed project documentation.

TDD reduces the time required for project development.

Term Definition
functional programming is a way of thinking about software construction by creating pure functions. It avoid concepts of shared state, mutable data observed in Object Oriented Programming. Functional langauges empazies on expressions and declarations rather than execution of statements
object-oriented programming (OOP) is a style of programming characterized by the identification of classes of objects closely linked with the methods (functions) with which they are associated. It also includes ideas of inheritance of attributes and methods
class is a blueprint for creating objects.
super keyword is used to access and call functions on an object’s parent.
this the this keyword refers to an object.