←back to thread

135 points barddoo | 4 comments | | HN request time: 0s | source

Writing Redis from scratch in Zig.
1. jasonjmcghee ◴[] No.45308740[source]
I'm not really sure what it costs these days - i know certain projects not entirely free like they were a few years ago, but there's a pretty good "build your own redis" among other things.

It has little step-by-step tasks with automated tests. There are some other good ones like git and docker. It's pretty cool.

https://app.codecrafters.io/courses/redis/overview

replies(2): >>45308845 #>>45309901 #
2. nine_k ◴[] No.45308845[source]
It's easy to write a KV store, even a KV store with key expiration. But Redis is quite a bit more than that. Consider sharding and replication at least. Then lists, sets, zsets, bitfields, streams, geospatial indexes, hyperloglog / bloom filters, time series.

Something like LevelDB is relatively easy to write. Then you can build the rest of Redis on top of it.

replies(1): >>45311950 #
3. barddoo ◴[] No.45309901[source]
Sounds pretty interesting.
4. johnisgood ◴[] No.45311950[source]
> Then lists, sets, zsets, bitfields, streams, geospatial indexes, hyperloglog / bloom filters, time series.

I mean, I have my own C libraries for most of these!