Fireship · @fireship
7 Database Paradigms
Uploaded September 3, 2020 · Length 9:53
Summary
This video explains the 7 main database paradigms, including key-value, wide-column, document-oriented, relational, graph, time-series, and multi-model databases, and their use cases.
- database paradigms
- key value database
- wide column database
- document oriented database
- relational database
- graph database
- time series database
- database design
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
My dad used to tell me, use the right tool for the job, and not vice versa.
- 0:03
When it comes to app development, choosing the right database is one of the single most important decisions that you'll ever make.
- 0:08
In today's video, we'll look at 7 different database paradigms, along with some databases you've probably heard of and some others that you haven't.
- 0:15
We'll look at how they work from a technical perspective, but most importantly, we'll try to understand what they're best used for,
- 0:20
because my dad also used to tell me, don't bring a knife to a gunfight.
- 0:23
If you're new here, like and subscribe, and also check out my new top 7 playlist for more videos like this.
- 0:28
Our list will start from the most simple type of database and gradually become more complex
- 0:32
as we get to number 7.
- 0:34
And that brings us to our first paradigm, the key value database.
- 0:37
Popular databases in this space include Redis, Memcached, and Etcd.
- 0:41
The database itself is structured almost like a JavaScript object or Python dictionary.
- 0:46
You have a set of keys where every key is unique and points to some value.
- 0:49
In Redis, for example, we can read and write data using commands.
- 0:52
We use the set command followed by a key and a value to write data,
- 0:56
than the git command to retrieve that data in the future. In the case of Redis and Memcached,
- 1:00
all of the data is held in the machine's memory, as opposed to most other databases that keep all
- 1:05
their data on the disk. This limits the amount of data you can store, however it makes the database
- 1:09
extremely fast because it doesn't require a round trip to the disk for every operation.
- 1:13
In addition, it doesn't perform queries, joins, or anything like that, so your data modeling options
- 1:18
are very limited, but again it's extremely fast, like sub-millisecond fast. You wouldn't want to
- 1:22
to use a key value store for your main app data. Most often, they're used as a cache to reduce data
- 1:27
latency. Apps like Twitter, GitHub, and Snapchat all use Redis for real-time delivery of their data.
- 1:33
There are other use cases beyond caching, like message queues, PubSub, and gaming leaderboards,
- 1:38
but more often than not, key value databases are used as a cache on top of some other persistent
- 1:43
data layer. Now, a database that only supports key value pairs is obviously pretty limited,
- 1:47
and that brings us to the wide column database. Popular options in this family include Cassandra
- 1:52
and HBase. A wide column database is like you took a key value database and added a second dimension
- 1:57
to it. At the outer layer, you have a key space, which holds one or more column families, and each


