Live data from Hacker News

The “Build Your Own Redis” Book Is Completed

build-your-own.org

31–40 of 131 posts

Re: The “Build Your Own Redis” Book Is Completed

#31
post #26

I actually build minimal Redis clones in every new language or runtime, or when I want to explore threading models. It all started with https://github.com/rcarmo/miniredis (which I forked to add and experiment with pub/sub), and I just found myself doing it again and again because Redis is the quintessential network service: By implementing it, you learn about socket handling, event loop for a specific runtime, threa…

RESP3 is really nice too. It should probably be required reading.

There’s a lot of interesting / subtle design choices worth studying.

https://github.com/antirez/RESP3/blob/master/spec.md

The best parts still haven’t been implemented.

Re: The “Build Your Own Redis” Book Is Completed

#32
post #7

i love this! is there a book like this to learn rust with? it would be amazing to have a working system at the end. (not looking for a beginner, but say, intermediate level book).

You could try https://www.zero2prod.com/ , which walks through building an newsletter service in rust.

Re: The “Build Your Own Redis” Book Is Completed

#33
It is nice to see more on "build your own database" topics.

Although people constantly bug me on attempts to build their own ClickHouse. Someone is trying to do it with Apache Arrow and DataFusion. Folks from DuckDB are trying to build their own crippled version of ClickHouse. Friends from China doing it with their Apache Doris. InfluxDB is being rewritten to be closer to ClickHouse in an attempt to make it better and so on...

Re: The “Build Your Own Redis” Book Is Completed

#35

One of my pet peeves when I was learning programming is that I couldn't find any books that would teach how to write tests in real world. There was that chicken and egg problem then, when potential employers would skip my CV because I didn't have any TDD experience and I couldn't find anywhere how to learn this. Before I even learned that something like testing exist, I was so confident like "oh I could write somethi…

I commented this above, but Distributed Services in Go does testing and low-level kafka-like implementation. It taught me so much, I'm probably going to reread at some point and implement in Rust.

Re: The “Build Your Own Redis” Book Is Completed

#36
Maybe I'm missing something but the server application resulting from the source code in this book does not actually work with redis-cli or any Redis clients. It appears to be using a custom binary protocol, not valid RESP. I feel that the RESP protocol itself is the most challenging task of building ones own Redis.

Re: The “Build Your Own Redis” Book Is Completed

#37
post #36

Maybe I'm missing something but the server application resulting from the source code in this book does not actually work with redis-cli or any Redis clients. It appears to be using a custom binary protocol, not valid RESP. I feel that the RESP protocol itself is the most challenging task of building ones own Redis.

It says on the site:

> The end result is a mini Redis alike with only about 1200 lines of code. 1200 LoC seems low, but it illustrates many important aspects the book attempts to cover.

The techniques and approaches used in the book are not exactly the same as the real Redis. Some are intentionally simplified, and some are chosen to illustrate a general topic. Readers can learn even more by comparing different approaches.

I wouldn't emphasize the importance is understanding Redis per-se but the ideas around a system like Redis.

Re: The “Build Your Own Redis” Book Is Completed

#38
post #26

I actually build minimal Redis clones in every new language or runtime, or when I want to explore threading models. It all started with https://github.com/rcarmo/miniredis (which I forked to add and experiment with pub/sub), and I just found myself doing it again and again because Redis is the quintessential network service: By implementing it, you learn about socket handling, event loop for a specific runtime, threa…

I'm curious if you re-use the same tests across different languages? And is it actually on a network or are you pretending?

Re: The “Build Your Own Redis” Book Is Completed

#39
post #15

I am very happy to see more content like this (attempting to teach how to create a real system) becoming available. Few month ago there was a launch announcement of YC backed startup that sell you walk-through labs guiding you to build Redis, Docker, Git and others. (Can't find link to it now.) What is still missing, in my opinion, and is badly needed, is content or even an idea on how to teach taking such projects f…

You're probably thinking of https://codecrafters.io/ . I've been meaning to check them out with my education stipend from work, just haven't had the time to devote to it.

So expensive IMO, only reason I'm avoiding it.

Re: The “Build Your Own Redis” Book Is Completed

#40
post #7

i love this! is there a book like this to learn rust with? it would be amazing to have a working system at the end. (not looking for a beginner, but say, intermediate level book).

distributed services in go is intermediate/advanced programming book where you build a commit log like Kafka. It's pretty intense. VERY fun
Post reply on HN