Fireship · @fireship
Redis in 100 Seconds
Uploaded July 8, 2021 · Length 2:26
Summary
redis database explained: in-memory, multi-model, sub-millisecond latency, durable, cache, primary database
- redis database
- in-memory database
- multi-model database
- cache layer
- primary database
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
redis an in-memory multi-model database
- 0:03
famous for its sub-millisecond latency
- 0:05
it was created in 2009 based on the idea
- 0:08
that a cache can also be a durable data
- 0:11
store
- 0:11
around this time apps like twitter were
- 0:13
growing exponentially and needed a way
- 0:15
to deliver data to their end users
- 0:16
faster than a relational database could
- 0:18
handle
- 0:19
redis which means remote dictionary
- 0:20
server was adopted by some of the most
- 0:22
heavily trafficked sites in the world
- 0:24
because it changed the database game by
- 0:26
creating a system where data is always
- 0:28
modified or read from the main computer
- 0:30
memory
- 0:31
as opposed to the much slower disk but
- 0:33
at the same time
- 0:34
it stores its data on the disk so it can
- 0:36
be reconstructed
- 0:37
as needed which means the database is
- 0:39
fully durable supporting things like
- 0:40
snapshots and backups every data point
- 0:43
in the database is a key
- 0:44
followed by one of many different data
- 0:46
structures like a string
- 0:48
list hash or stream so you can store
- 0:50
data naturally just like you would with
- 0:52
your favorite programming language as
- 0:53
opposed to squeezing it into a bunch of
- 0:55
tables or json documents
- 0:57
interacting with the database is handled
- 0:59
with a simple set of commands
- 1:00
like set followed by a key and value to
- 1:03
create data
- 1:04
then git followed by a key to read data
- 1:07
historically
- 1:08
redis has been described as a key value
- 1:10
store and is often used as a cache to
- 1:12
make relational databases faster at
- 1:14
scale
- 1:14
but here's where your mind is about to
- 1:16
be blown redis is perfectly suitable as
- 1:18
a primary database
- 1:19
and can dramatically reduce complexity
- 1:21
because making things go fast at scale
- 1:23
is the primary cause of complexity in
- 1:25
the first place with redis your database
- 1:27
is already fast
- 1:28
no need for a complex caching layer but
- 1:31
you might be wondering
- 1:32
how do i model complex relationships
- 1:34
today redis is what you would call
- 1:35
a multi-model database supporting a
- 1:38
variety of different database paradigms
- 1:39
with
- 1:40
add-on modules that you can opt into as
- 1:42
needed if your data contains
- 1:43
relationships bring in redis graph
- 1:45
and query it with cipher or use the json
- 1:47
module to structure your data as a
- 1:49
hierarchy
- 1:50
just like a document-oriented database
- 1:52
then use the search module
- 1:54
to turn your database into a full text
- 1:55
search engine and it even has modules
- 1:57
for ai workloads time series data


