Build Your Own X: Redis, Database, Compiler
Bought separately
Minimum price
Suggested price

Build Your Own X: Redis, Database, Compiler

About the Bundle

3 Books from the "Build Your Own X" series:

  • Build Your Own Redis with C/C++
  • Build Your Own Database From Scratch
  • From Source Code To Machine Code
  • Share this bundle
  • Categories

    • C and C++
    • Networking
    • Databases
    • Computer Science
    • Software Architecture
    • Computers and Programming
    • Go
    • Python
    • Software Engineering

About the Books

Build Your Own Redis with C/C++

  • 100%


  • PDF

  • EPUB

Learn network programming and data structures by building a Redis-like server from scratch with C/C++.


What Is This Book About?

This book contains a step-by-step walkthrough of a simple implementation of a Redis-like server. It is intended as a practical guide or tutorial to network programming and the implementation and application of basic data structures in C.

What to Learn From This Book?

Redis could be considered one of the building blocks of modern computing that stood the test of time. The knowledge required for building such a project is broader and deeper than usual application-level development. Learning from such projects is a good way for software developers to level up their skills.

Redis is a good target for learning because it covers two important subjects of software engineering: network programming and data structures.

  • While there are many guides on socket APIs or high-level libraries, network programming is more than calling APIs or libraries. It is important to understand core concepts such as the event loop, protocols, timers, etc, which this book will cover. The lack of understanding can result in fatal mistakes even if you are just employing high-level networking libraries or frameworks in your applications.
  • Although many people learned some basic data structures from textbooks, there is still something more to learn. Data structures implemented in real projects often have some practical considerations which are not touched by textbooks. Learning how data structures are used in a non-toy environment (especially in C) is a unique experience from building Redis.

Like most real-world projects, Redis is a complex project built with lots of effort, which can be hard to grasp for beginners. Instead, this book takes an opposite approach: learning by building things from scratch.

Why From Scratch?

A couple of points:

  • To learn faster. By building things from scratch, concepts can be introduced gradually. Starting from the small, adding things incrementally, and getting the big picture in the end.
  • To learn deeper. While there are many materials explaining how an existing stuff works, the understanding obtained by reading those materials is often not the same as building the stuff yourself. It is easy to mistake memorization for understanding, and it’s easier to pick up unimportant details than principles and basics.
  • To learn more. The “from scratch” approach forces you to touch every aspect of the subject — there are no shortcuts to knowledge! And often not every aspect is known to you beforehand, you may discover “things I don’t know I don’t know” in the process.

Summarized in a quote from Feynman: “What I cannot create, I do not understand”.

Build Your Own Database in Go From Scratch

From B+tree to SQL in 3000 lines
  • 100%


  • PDF

  • EPUB

Learn databases from the bottom up by coding your own, in small steps, and with simple Go code (language agnostic).

  • Atomicity & durability. A DB is more than files!
  • Persist data with fsync.
  • Crash recovery.
  • KV store based on B-tree.
  • Disk-based data structures.
  • Space management with a free list.
  • Relational DB on top of KV.
  • Learn how tables and indexes are related to B-trees.
  • SQL-like query language; parser & interpreter.
  • Concurrent transactions with copy-on-write data structures.


You may also like my other book: Build Your Own Redis.

From Source Code To Machine Code

Build Your Own Compiler From Scratch
  • 100%


  • PDF

  • EPUB

Build a compiler to learn how programming languages work. Use low-level assembly to learn how computers work.

Walks through a minimal yet complete compiler implementation. Compiles a static-typed language into x64 ELF executables.

  1. Simple interpreter. Get your own programming language up and running.
  2. Bytecode compiler. A step closer to the machine.
  3. x64 assembly & instruction encoding. Understand how the machine works.
  4. Translate bytecode to x64 code. Bridging the virtual machine to the real machine.
  5. Generate binary executables. Putting it all together.


Web version of the interpreter chapters.

You may also like: Build Your Own X Series

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

80% Royalties. Earn $16 on a $20 book.

We pay 80% royalties. That's not a typo: you earn $16 on a $20 sale. If we sell 5000 non-refunded copies of your book or course for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earnedover $13 millionwriting, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub