Hacker News new | ask | show | jobs
by jeremiep 4625 days ago
It's actually a quick tutorial describing how to add a new command to Redis, not an actual analysis of the source code as I expected.
3 comments

You might be interested in one of these articles:

http://pauladamsmith.com/articles/redis-under-the-hood.html

http://blog.togo.io/how-to/adding-interval-sets-to-redis

They have both been discussed before though.

Ah yes, I remember the interval sets article. The first post is a lot more in depth than mine. Both great links, thanks.
Yeah, it's a pretty shallow introduction. I'd like to write more articles on the Redis code. The sorted set skiplist stuff is really interesting.
The entire implementation of sorted sets is really interesting, with a dual implementation of ziplists and skiplists being used depending on the amount of elements in the list. I've been meaning to write bit more about Redis internals lately; maybe I'll start on that in my commute hours.

I've got a couple of general articles on adding a command and adding a datatype to Redis at http://starkiller.net, but I don't get too into existing code. I'd be interested in writing a bit more about the other data structures as well as the multiple strategies used for EXPIRE (which recently changed I believe).

Write: How to write custom C commands ?
It's more of an analysis of the structure of Redis' code.