Loading...

Build your own Redis

Learn about TCP servers, the Redis protocol and more

Redis is an in-memory data structure store often used as a database, cache, message broker and streaming engine. In this challenge you'll build your own Redis server that is capable of serving basic commands, reading RDB files and more.

Along the way, you'll learn about TCP servers, the Redis Protocol and more.

Stages

Bind to a port
Login via GitHub to view this stage
Respond to PING
Login via GitHub to view this stage
Respond to multiple PINGs
Login via GitHub to view this stage
Handle concurrent clients
Login via GitHub to view this stage
Implement the ECHO command
Login via GitHub to view this stage
Implement the SET & GET commands
Login via GitHub to view this stage
Expiry
Login via GitHub to view this stage

RDB Persistence

RDB file config
Login via GitHub to view this stage
Read a key
Login via GitHub to view this stage
Read a string value
Login via GitHub to view this stage
Read multiple keys
Login via GitHub to view this stage
Read multiple string values
Login via GitHub to view this stage
Read value with expiry
Login via GitHub to view this stage

Replication

Configure listening port
Login via GitHub to view this stage
The INFO command
Login via GitHub to view this stage
The INFO command on a replica
Login via GitHub to view this stage
Initial Replication ID and Offset
Login via GitHub to view this stage
Send handshake (1/3)
Login via GitHub to view this stage
Send handshake (2/3)
Login via GitHub to view this stage
Send handshake (3/3)
Login via GitHub to view this stage
Receive handshake (1/2)
Login via GitHub to view this stage
Receive handshake (2/2)
Login via GitHub to view this stage
Empty RDB Transfer
Login via GitHub to view this stage
Single-replica propagation
Login via GitHub to view this stage
Multi Replica Command Propagation
Login via GitHub to view this stage
Command Processing
Login via GitHub to view this stage
ACKs with no commands
Login via GitHub to view this stage
ACKs with commands
Login via GitHub to view this stage
WAIT with no replicas
Login via GitHub to view this stage
WAIT with no commands
Login via GitHub to view this stage
WAIT with multiple commands
Login via GitHub to view this stage

Streams

The TYPE command
Login via GitHub to view this stage
Create a stream
Login via GitHub to view this stage
Validating entry IDs
Login via GitHub to view this stage
Partially auto-generated IDs
Login via GitHub to view this stage
Fully auto-generated IDs
Login via GitHub to view this stage
Query entries from stream
Login via GitHub to view this stage
Query with -
Login via GitHub to view this stage
Query with +
Login via GitHub to view this stage
Query single stream using XREAD
Login via GitHub to view this stage
Query multiple streams using XREAD
Login via GitHub to view this stage
Blocking reads
Login via GitHub to view this stage
Blocking reads without timeout
Login via GitHub to view this stage
Blocking reads using $
Login via GitHub to view this stage

Transactions

The INCR command (1/3)
Login via GitHub to view this stage
The INCR command (2/3)
Login via GitHub to view this stage
The INCR command (3/3)
Login via GitHub to view this stage
The MULTI command
Login via GitHub to view this stage
The EXEC command
Login via GitHub to view this stage
Empty transaction
Login via GitHub to view this stage
Queueing commands
Login via GitHub to view this stage
Executing a transaction
Login via GitHub to view this stage
The DISCARD command
Login via GitHub to view this stage
Failures within transactions
Login via GitHub to view this stage
Multiple transactions
Login via GitHub to view this stage