Get startedGet started for free

Welcome!

1. Welcome!

Hello, and welcome to the course! This is Miriam Antona. I am a software engineer, and I will be teaching you the main concepts of NoSQL databases.

2. Topics covered

We will start chapter one by describing the differences between NoSQL and relational databases. After that, we will discover key-value databases. In chapter two, we will learn about document databases. We will study column family databases in chapter three. And in the last chapter, chapter four, we will explore graph databases.

3. About the course

This is a conceptual course, so no coding is required. Throughout the course, we will follow Datazy, a fictional social network where data scientists can share their knowledge and ask questions about data science. We will see how this company implements each kind of NoSQL database for its different needs.

4. NoSQL vs relational databases

Let's start with comparing traditional relational databases with NoSQL databases. Relational databases use tables with rows and columns. A database schema needs to be defined before inserting the data. Changing the database schema later might prove complicated because, on some occasions, we will need to create migration scripts or change the application code. Queries may be slow when joining multiple tables. Relational databases scale vertically, which means they scale by adding more power, for example, CPU or RAM. This is more expensive. They guarantee Atomicity, Consistency, Isolation, and Durability in transactions, also known as ACID transactions. They are typically closed source. NoSQL, originally referred to "non-SQL" or "non-relational", is also interpreted as "Not Only SQL". These non-relational databases, don't use tables with rows and columns. They allow the data to be stored without having to define a schema, with the possibility of changing the structure of the data over time. Queries can be faster because there is no need to join multiple tables. NoSQL databases scale horizontally, which means they scale by adding more machines. This is cheaper than scaling vertically. They sometimes don't support ACID transactions. Most of them are open source.

5. NoSQL vs relational databases

It is important to highlight that NoSQL and relational databases are complementary and can coexist with each other. We can have an application using different kinds of databases depending on the needs.

6. Types of NoSQL databases

The four major types of NoSQL databases are key-value databases, document databases, column family databases, and graph databases. Let's start with the first one.

7. Key-value databases

Key-value databases are the simplest NoSQL databases. They support getting and setting values with an associated key.

8. Key

Here are some examples of keys. A key can be any binary sequence, like text, numbers, etc. Keys must be unique. Keys can also be generated by algorithms. It is not a good option to have long keys because they will use more memory.

9. Value

A value is always associated with a key. A value can be retrieved, set, or deleted by its key. Values can be numbers, strings, JSON objects, images, etc. Most key-value databases restrict the size of the values.

10. Value

These are some examples of key-value pairs.

11. Datazy example

As we will see, a typical use case where key-value databases fit well is in storing the preferences that users have when visiting web pages. Datazy, our fictional company, wants to store this information. Datazy decided to store user preferences into one object to retrieve this information with a fast single get operation. In this example, we can see the key-value pairs for two users. Colon symbols (:) are frequently used as a convention when naming keys. We can see how they separate the word user, the number, and the word preferences.The keys are unique, as every user will have a different number. The language, the color, and the timezone are stored as values.

12. Popular key-value databases

Here are some popular key-value databases.

13. Let's practice!

Let's practice!

Create Your Free Account

or

By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.