@GYLQ520: 学网络编程的人,老是栽在同一个坑里—— 理论看完了还是写不出来,源码读完了也不知道从哪儿下手改。 直到我翻到这个开源的宝藏教程:Build Your Own Redis,手把手带你从零硬肝出一个真正能跑的 Redis 服务器。 路线分两段…

X AI KOLs Timeline 工具

摘要

这个开源教程《Build Your Own Redis》教你手把手从零用C/C++实现一个功能完备的Redis服务器,深入讲解网络编程、数据结构和底层C语言,配有代码和详细说明。

学网络编程的人,老是栽在同一个坑里—— 理论看完了还是写不出来,源码读完了也不知道从哪儿下手改。 直到我翻到这个开源的宝藏教程:Build Your Own Redis,手把手带你从零硬肝出一个真正能跑的 Redis 服务器。 路线分两段: 先拿 socket 编程开刀,TCP 服务器、事件循环、键值存储,一层层往上搭 再往硬核里冲,哈希表、AVL 树、线程池,真正把底层啃明白 每章都带着代码 + 讲解,拆得够细,步子踩得够稳,跟着撸完你会发现自己是真懂了,不是那种“感觉懂了”。 免费网页版直接看: https://build-your-own.org/redis/
查看原文
查看缓存全文

缓存时间: 2026/06/17 01:44

学网络编程的人,老是栽在同一个坑里——

理论看完了还是写不出来,源码读完了也不知道从哪儿下手改。

直到我翻到这个开源的宝藏教程:Build Your Own Redis,手把手带你从零硬肝出一个真正能跑的 Redis 服务器。

路线分两段:

先拿 socket 编程开刀,TCP 服务器、事件循环、键值存储,一层层往上搭 再往硬核里冲,哈希表、AVL 树、线程池,真正把底层啃明白

每章都带着代码 + 讲解,拆得够细,步子踩得够稳,跟着撸完你会发现自己是真懂了,不是那种“感觉懂了”。

免费网页版直接看: https://build-your-own.org/redis/


Build Your Own Redis with C/C++ | Build Your Own Redis with C/C++

Source: https://build-your-own.org/redis/

Introduction

Buildreal-worldsoftware by codingfrom scratch.**If you can build a Redis server, you can build almost any software beyond CRUD!**Because it teaches you 3 fundamental skills:

  • Network programming. The next level of programming is programming for multiple machines. Think HTTP servers, RPCs, databases, distributed systems.
  • Data structures. Redis is the best example of applying data structures to real-world problems. Why stop at theoretical, textbook-level knowledge when you can learn from production software?
  • Low-level C. C was, is, and will be widely used for systems programming and infrastructure software. It’s a gateway to many low-level projects.

**Why from scratch?**A quote from Richard Feynman: “What I cannot create, I do not understand”. You should test your learning with real-world projects!

**Why a book?**The real Redis project is a large code base built with lots of effort. The book distills the core concepts and guides you throughsmall steps.

Table of Contents

Part 1. Redis from 0 to 1

  1. Introduction
  2. Socket Programming
  3. TCP Server and Client
  4. Request-Response Protocol
  5. Concurrent IO Models
  6. Event Loop (Part 1) Event Loop (Part 2)
  7. Key-Value Server

Part 2. Advanced Topics

  1. Hashtables (Part 1) Hashtables (Part 2)
  2. Data Serialization
  3. Balanced Binary Tree
  4. Sorted Set
  5. Timer and Timeout
  6. Cache Expiration with TTL
  7. Thread Pool

Source Code

https://build-your-own.org/redis/src.tgz

PDF/EPUB and Paperback Editions

The full book is free in web version. You can**purchase**the book if you find the book helpful.

Book Cover

Recommended Reading

I have curated a list of books that are highly relevant for people who intend to DIY their own Redis.

Beej’s Guide to Network Programming. [Amazon][Web] A comprehensive guide and reference to network programming. It’s a great supplement for coding your own networked apps, as the Redis book doesn’t cover all the details of socket programming.The Linux Programming Interfaceby Michael Kerrisk. [Amazon][Web] The socket API is only a subset of the Linux API interface. You will probably need to become familiar with the other parts, such as IOs, threads and processes, signals, and etc, if you are developing apps for Linux.The C Programming Languageby K&R. [Amazon] Are you scared of C, but still want to follow the project? No problem. This classic book is great for picking up C quickly, whether you are a beginner or an experienced developer.

相似文章

@grgerwcwetwet: 推荐一个 GitHub 上很硬核的网络工具教程项目:fanqiang。 从常见客户端怎么安装,到苹果美区账号注册、VPS 入门、软路由配置、不同系统的使用教程,基本都整理成了小白能看懂的步骤。 覆盖 Windows、macOS、Linux…

X AI KOLs Timeline

推荐一个GitHub上很硬核的网络工具教程项目:fanqiang,从客户端安装到账号注册、VPS配置,覆盖Windows/macOS/Linux/Android/iOS全平台,更新近十年,累计4w+ Star。

@Xudong07452910: 开源教程推荐:《Claude How-To》—— Claude Code 最完整的进阶学习路径,含图、含模板、含自测 如果你一直是「用到什么查什么」的方式用 Claude Code,这个项目值得花 11-13 小时系统过一遍。 它用 Me…

X AI KOLs Timeline

推荐一个名为《Claude How-To》的开源教程,提供Claude Code的完整进阶学习路径,包含可视化流程图、生产级模板和自测问卷,适合开发者从零到熟练掌握Claude Code。