Reading 03: Data Modeling & NoSQL Database - susannalakey-401-advanced-javascript/seattle-javascript-401d34 GitHub Wiki

Javascript Data Modeling

  • Data Modeling is the process of taking a real world idea and encoding it into Javascript's built in data types.

Modeling Behaviors

  • CRUD
    • Create: Add record to a data store
    • Read: Retrieve a record from a data store
    • Update: Update a record within a data store
    • Delete: Remove a record from a data store
  • Normalization & Validation
    • Sanity checking data to ensure it conforms to modeling rules prior to doing any operations with it

NoSQL Databases

  • Traditional databases like Postgres are "Relational", in that they store data in rows and columns and link related records
  • NoSQL database is based on document storage. Instead of all of the information being stored in many tables, it is all in one record that you can retrieve quickly. They are typically keyed by an ID.

ORMs (Mongoose)

  • ORM: Object Relation Mapping
    • Rules for Document databases. Mongoose is a Node library that makes it easy to interface with a Mongo database.
    • Mongoose provides 2 essential things:
      1. Schema - the rules to structure your data
      2. CRUD methods to work easier with the data