Data Modeling & NoSQL Databases


Data Modeling & NoSQL Databases

1. Why would a developer choose to make data models?

Data models are the building plans which help build a conceptual model and set the relationship between data items. Data models help a developer understand how a database will be built, and so that it is done in a way that makes sense.

2. What purpose do CRUD operations serve?

  • Create: Creates a new record within a data model / database.
  • Read: Reads records from a data model / database.
  • Update: Updates records in a data model / database.
  • Delete: Deletes a record from a data model / database.

3. What kind of database is Postgres? What kind of database is MongoDB?

  • Postgres is an object-relational SQL database
  • MongoDB is an document-oriented NoSQL database used for high volume data storage.

4. What is Mongoose and why do we need it?

Mongoose provides a straight-forward, schema-based solution to model your application data. It includes built-in type casting, validation, query building, business logic hooks and more, out of the box.

Take my foodiejournal.com as example, it has blogers, recipes and ingradians. each recipes saved on this website would belongs to a unique bloger, and the recipe contains many different ingradians.

Vocabulary

Term Defination
database An organized collection of data. Used to store information that can be updated and retrieved.
data model A data model is a conceptual representation of data objects, the associations between different data objects and the rules. Data modeling is the process of creating a data model for the data to be stored in a database.
CRUD Create, Read, Update, and Delete.
schema A way to define what goes into a relational database. All records in a table will have to follow the schema.
sanitize to remove any illegal characters from the data
Structured Query Language (SQL) A powerful longuage that allows you to write database queries. It consists of tables and rows. It works with relational databases, and it has strict requirements for what can go in the table defined in a schema.
Non SQL (NoSQL) A non relational database that stores and accesses data using key-values pairs
Mongoose Mongoose provides a straight-forward, schema-based solution to model your application data.
record A record is a database entry that may contain one or more values. Groups of records are store din a table, which defines what types of data each record may contain.
document Essentially the rows in a table. They are written in something like json format. They do not need to use the same schema, and different documents can have different fields.
Object Relation Mapping (ORM) Object-relational mapping is a mechanism that makes it possible to address, access, and manipulate objects without having to consider how those objects relate to their data sources.