Redis Internals

A self-paced course where you will 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


Starting up

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


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


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


Pipelining and Persistence

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


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


Memory management

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


Signals and Transactions

  • Implementing Graceful Shutdown 37 mins
  • Implementing Transactions 22 mins


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

₹14,999 $199

inclusive of all the taxes


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

Enroll Now

International folks, can also pay in USD or pay in EUR. In case you want to pay in any other currency, just drop me an email at arpit.masterclass@gmail.com.

Note: there is no discount on the course pricing; I feel discounts are unfair to the folks who paid the full; the price of the course is subject to a yearly hike.

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

Know Your Coach - Arpit Bhayani

Arpit Bhayani

I am a CS engineer passionate about Databases, Language Internals, Distributed Datastores, and Advanced Algorithms. I am currently working with Google as a Staff Software Engineer with the Dataproc team in 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 internal 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 Data Lake, 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.

Every week, I put out at least one YouTube video on an Engineering Topic and publish a newsletter. I always keep building things on the side, and a few of my hobby projects include

  • DiceDB - a tiny in-mem database
  • Revine - a visual programming language for kids

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.

Will I be able to change the cohort?

I will try but cannot guarantee to accomodate you in another cohort.

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.

Writings and Videos


Essays and Blogs

Arpit's Newsletter read by 56000+ engineers

Weekly essays on real-world system design, distributed systems, or a deep dive into some super-clever algorithm.