Build your own Redis

Early Access

In this challenge, you’ll build an application that can speak the Redis protocol, and is capable of serving basic commands like PING, ECHO, SET and GET. Along the way, you’ll learn about TCP servers, event loops and more.

This challenge has 7 stages.

#1

Bind to a port

In this stage, you’ll start a TCP server on port 6379, which is the default port that Redis uses.

#2

Respond to PING

In this stage, you’ll respond to the PING command. You’ll use the Redis protocol to encode the reply.

#3

Respond to multiple PINGs

In this stage, you’ll respond to multiple PING commands sent by the same client.

#4

Handle concurrent clients

In this stage, you’ll add support for multiple concurrent clients to your Redis server. To achieve this you’ll use an Event Loop, like the official Redis implementation does.

#5

Implement the ECHO command

In this stage, you’ll respond to the ECHO command. You’ll parse user input according to the the Redis protocol specification.

#6

Implement the SET & GET commands

In this stage, you’ll need to implement the SET & GET commands.

#7

Expiry

In this stage, you’ll add support for setting a key with an expiry. The expiry is provided using the “PX” argument to the SET command.

Interested in trying out the Build your own Redis Challenge? Checkout our early access program!