Data Modeling: NOSQL vs SQL, SQL Storage Techniques

My reading notes for Code Fellows


Data Modeling: NOSQL vs SQL, SQL Storage Techniques

nosql vs sql

What type of database is the best fit for the complex query intensive environment? SQL databases are a good fit for a complex,query intensive environment.

What type of database is the best fit for hierarchical data storage? NoSQL database fits better for the hierarchical data storage as it follows the key-value pair way of storing data similar to JSON data. NoSQL database are highly preferred for large data set (i.e for big data).

Describe the differences in scalability between a SQl and NoSQL database as though you were speaking to a non-technical friend. SQL databases are vertically scalable whereas the NoSQL databases are horizontally scalable.

SQL databases are scaled by increasing the horse-power of the hardware. You can manage increasing load by increasing the CPU, RAM, SSD, etc, on a single server.

NoSQL databases are scaled by increasing the databases servers in the pool of resources to reduce the load.You can just add few more servers easily in your NoSQL database infrastructure to handle the large traffic.

sql modeling techniques

Among data tables, what is a one-to-many relationship and how do we “relate” them?

We connect lines between tables to show relationships. In some cases an entry in one table can be related to more than one entry in another. This is called a one-to-many relationship.

Prior to designing your relational database, it might be useful to ___ a ___ of the database tables and their relationships. create a diagram

Explain the difference between a primary and foreign key. Primary keys uniquely identify each row in a table. A table typically has one primary key, but can have more. When the key has more than one column, it is called a compound key.

A foreign key is a column, or set of columns, which match a primary key in another table.

More sql vs nosql

How do we treat keywords and parameters differently in SQL syntax? As a convention, keywords and parameters are written in CAPITAL LETTERS.

Define normalization within the context of schemas and data. Normalization is the process of organizing data in a database. This includes creating tables and establishing relationships between those tables according to rules designed both to protect the data and to make the database more flexible by eliminating redundancy and inconsistent dependency.

A database schema is an abstract design that represents the storage of your data in a database. It describes both the organization of data and the relationships between tables in a given database.

Explain the difference between one-to-one, one-to-many, and many-to-many relationships to a non-technical recruiter. A one-to-one relationship exists when one row in a table may be linked with only one row in another table and vice versa.

A one-to-many relationship exists when one row in table-A may be linked with many rows in table-B, but one row in table-B is linked to only one row in table-A.

A many-to-many relationship exists when a system is linked to multiple others, i.e. one author can write many books, or conversely one book can be written by many authors.