#AsliEngineering

Redis Internals


A self-paced course where we understand the Redis internals by actually reimplementing its core features, like event loop, serialization protocol, persistence, pipelining, eviction, and transactions, in Golang.




If you have already enrolled, you can directly login to the portal.


The Course

Redis has to be the most versatile modern database out there. Although it is heavily used as a cache, it can also be used as a Message Broker, a Streaming engine, and so much more. This course will be an answer to some of your most common questions about Redis - why is it so fast? and how it can handle a large number of TCP connections while being single-threaded?

In this self-paced recorded course, we will be understanding the internals of Redis by actually reimplementing it in Golang, and the features include

  • event loop
  • serialization protocol
  • approximated LRU eviction
  • command pipelining and transactions

Our reimplementation in Golang will be an actual drop-in replacement of Redis which means you would be able to connect to this DB through any Redis client in the world! Our entire reimplementation is open-sourced and can be found on Github at DiceDB/dice.

Course curriculum


CHAPTER 1

Starting up

  • Course Introduction 10 mins
  • What makes Redis special? 22 mins
  • Writing a Simple TCP Echo Server 16 mins

CHAPTER 2

RESP, PING, and Event Loop

  • Speaking the Redis' Language 16 mins
  • Implementing RESP 15 mins
  • Implementing PING 19 mins
  • IO Multiplexing and Event Loops 21 mins
  • Handling multiple concurrent clients 26 mins

CHAPTER 3

GET, SET, and auto-delete

  • Implementing GET, SET, and TTL 22 mins
  • Implementing EXPIRE and auto-deletion 27 mins
  • Eviction strategies and implementing simple-first 20 mins

CHAPTER 4

Pipelining and Persistence

  • Implementing Command Pipelining 21 mins
  • Implementing AOF Persistence 21 mins

CHAPTER 5

Objects, statistics, and LRU

  • Object, Encodings, and Implementing INCR 25 mins
  • Implementing INFO and allkeys-random eviction 20 mins
  • The Approximated LRU Algorithm 23 mins
  • Implementing the Approximated LRU Algorithm 25 mins

CHAPTER 6

Memory management

  • Understanding how Redis caps memory 13 mins
  • Overriding malloc for better performance 6 mins

CHAPTER 7

Signals and Transactions

  • Implementing Graceful Shutdown 37 mins
  • Implementing Transactions 22 mins

CHAPTER 8

Core Data Structures and Algorithms

  • List Internals - Ziplist and Quicklist 28 mins
  • Set Internals - Intset 13 mins
  • Geospatial Queries and Geohash 21 mins
  • String Internals - Simple Dynamic Strings 16 mins
  • Hyperloglog and Cardinality Estimation 13 mins
  • LFU and Approximate Counting 21 mins

Why should you enroll?

The primary objective of this program is to make you fall in love with database internals, help you understand the various components of any database, and walk you through on building your own database from scratch.



Know the internals

Learning how a database is built from scratch and key design decisions that make it special has its own thrill.

Know the unknowns

Learn some of the most interesting concepts and super-clever algorithms that makes Redis extra-special.

Be a better engineer

Take yourself to the next level and become a better, an Asli Engineer.

Doubt Resolution

Get your doubts cleared asynchronously on Discord or synchronously over a common 30-minute zoom call that would happen every 14 days.

Network community

Network, interact, and learn by being a part of the Asli Engineering Discord community.

Glimpse of the course

The first few videos of this course are available for free, watch them here and then decide if you want to take this up or not



Program pre-requisites

In this course, we would be reimplementing the core features of Redis, like event loop, serialization protocol, persistence, pipelining, and eviction; hence we would need a basic familiarity with Go. We will also be writing our own Event Loop and because every OS exposes its own set of System Calls, we will be restricting ourselves to Linux, and hence having a Linux-based development environment is essential to follow. In a gist, the program pre-requisites are

  • basic familiarity with Go
  • linux-based development environment
  • a Google account because I only support Sign-in with Google :)

If you meet the pre-requisites and are excited to learn, enroll ↓

Buy Now

₹9,999 $125

inclusive of all the taxes


YOU'LL GET


9 hours of Redis Internals

Curated resources to explore internals better

Source code of our Golang based implementation - Dice DB

Bi-weekly doubt solving - Tuesday 7:30 pm to 8:00 pm IST

Lifetime access to all the course videos and notes

Lifetime access to the #AsliEngineering Discord Community


If you have questions or need any clarifications before enrolling, please reach out to me at arpit.masterclass@gmail.com.

Arpit Bhayani

Hi, I'm Arpit Bhayani 👋


I am a CS engineer passionate about building systems that scale and currently working with Google as a Staff Software Engineer with the Dataproc team and making Apache Spark faster. Throughout my career, I have worked across a variety of domains and have built systems, services, and platforms that scale to billions; and have worked at companies like Unacademy, Amazon, Practo, and D. E. Shaw.

Post my masters in CSE from IIIT Hyderabad I joined D. E. Shaw for a short stint of 2 months, before moving to Practo and working there as a Platform Engineer, building and owning close to 8 different microservices. Post Practo I worked at Amazon on their primary mission-critical E-Commerce Database and built Data Pipelines that cold tiered the stale data.

After quitting Amazon in 2018, I joined Unacademy as their first Technical Architect and there I designed, built, managed, and scaled services like Search, Notification, Logging, Deployment Engine, and many more. I then transitioned into the leadership role and operated as a Director of Engineering and led the Site Reliability and Data Engineering verticals.

I run a YouTube channel named Asli Engineering where I post videos about Real-world System Design, Language Internals, Distributed Algorithms, and much more. The channel right now as a subscriber base of 20k.

On the side, I am building my own database named DiceDB that aims to be an in-memory KV store optimized for CPU intensive workload. I am also building a programming language named Revine that would aid kids to develop logic and programming intuitions by building micro-games and animations.

Frequently asked questions

You can always drop me an email at arpit.masterclass@gmail.com for other questions.


Is this course right for me?

This course is for any engineer who wants to understand the internals of Redis and build a KV store from scratch.

Will the sessions happen live?

The course is self-paced and upon the purchase, the access to the videos will be given.

Will you be resolving the doubts?

All the doubts will be resolved synchronously over a 30 min common zoom call that would happen every two weeks on Tuesday 7:30 pm IST, or asynchronously on the Discord server.

Can I get this course reimbursed from my company?

Talk to your manager and check if they can sponsor this course. The invoice that will be issued is a legally valid and sound invoice that can be used for any kind of reimbursement.

Will there be a recording available for future reference?

You will have lifetime access to the course.

Is there a refund policy?

Fees once paid for the Redis Internals course will not be refunded.

What are the programming pre-requisites?

Basic familiarity with Golang and a Linux-based development environment.

Will I be getting an invoice of Payment?

Yes. An invoice will be issued to you with all the legal and necessary details. This means your employer can choose to process this invoice and provide reimbursement. Drop me an email at arpit.masterclass@gmail.com if you want a detailed invoice.

Will you issue a course completion certificate?

I generate the course completion certificate on-demand and hence if you seek one drop me an email at arpit.masterclass@gmail.com

Will you implement every single Redis command?

No. The commands and features that will be implemented are mentioned in the curriculum. Core Data Structures and Algorithms of Redis are theoretically covered in extreme detail. We will be following the aforementioned curriculum.

Will you live code?

No. I will be giving an exhaustive code walkthrough of our Golang based implementation and the code will evolve with every commit.




  • v13.7.5
  • © Arpit Bhayani, 2022

Powered by this tech stack.