build-your-own.org > Books > Build Your Own Redis with C/C++
EBook·Paperback
⟵ prev Contents next ⟶

ℹ️ New Book: Build Your Own Database

01. Introduction

Network Programming and Data Structures

Explore the 2 topics in a learn-by-doing way by coding a Redis clone step-by-step.

Many software components reply on computer networks. Think of HTTP servers, RPCs, databases, and etc. Network programming is essential to building these system-y software.

Data structure is overlooked in application development. Due to the lack of practical examples, many don’t know more than what a hashtable is. Code a Redis is the perfect exercise to fills this gap.

Why Start From Scratch?

To quote Feynman: “What I cannot create, I do not understand”. There are different levels of “create” and “understand”. Welding libraries and frameworks together is the most common way to create software, but it requires the least understanding. You don’t have to stay at this level.

Learning from scratch means starting with the fundamentals, not the minor details – a wise use of time.

Why C?

The first version of Redis was written using the TCL scripting language. But Redis the product is written in C, and Redis in TCL is a toy. Why is so many serious software written in C? Can I follow this exercise in a high-level language like Python or JS?

Why Should I Code A Redis?

About The Book

Each chapter is an incremental step with complete source code which can be downloaded, but you’ll expected to do the coding yourself.

The final product is only 1200 lines of code. The code is small, but it includes many important lessons while skipping uninteresting details. Many things are simplified or done differently to better illustrate the topics. For this reason, the result is not compatible with the real Redis.

The code is plain C with minimal C++ features. Don’t worry if you don’t know C. C is small enough to get started quickly with Beej’s Guide to C.

Book Series

This is part of the “Build Your Own X” book series, where X includes database, web server and compiler. Read the web version on the website.

https://build-your-own.org

( Report an Error | Ask a Question) @ build-your-own.org


⟵ prev Contents next ⟶