Page 11 of 15: older articles, tutorials, and videos.

The INFO command is the last major piece of my Redis clone, and in this part I build out the server, client, and memory sections of its response.

I fix a missing mutex unlock bug in my Go Redis clone, refactor the code into focused files, and then implement the MONITOR command so one client can receive every command other clients run.

I implement Redis's allkeys-lru and allkeys-lfu eviction policies in my Go Redis clone by sorting sampled keys with the metadata already stored on each item, then reusing my evict-until-memory-freed loop.

I fix AOF file sync in my Go Redis clone by making every array read share one buffered reader instead of creating a fresh reader each time, which was causing replay to restore only the first key.

I implement the allkeys-random eviction policy for my Go Redis clone by sampling a bounded set of keys and deleting until memory is freed.

I add real memory management to my Go Redis clone: every key now reports its approximate footprint, and the server refuses writes once it hits a configured max-memory limit.

I implement Redis-style database transactions in my Go Redis clone, adding MULTI, EXEC, and DISCARD command handlers and a transaction queue that holds commands until execution.

I build the BGREWRITEAOF command for my Go Redis clone so the append-only file stops replaying outdated SET commands and keeps only the latest value for each key.

EXPIRE and TTL need each key to carry its own expiry timestamp, so I change the store from a map of strings to a map of *Key structs holding the value and an expiry time.Time, then fix every handler that breaks.

I implement AUTH and password protection for my Go Redis clone by adding a requirepass directive, tracking authentication state per client, and blocking unauthenticated commands.

I add SHA-256 checksum protection to the RDB save path in my Go Redis clone so a snapshot is only considered successfully written when the in-memory buffer and on-disk file hashes match.

I implement the DBSIZE and FLUSHDB commands in my Go Redis clone, and I show why the obvious way to flush a database is the wrong one.


Dude, you’re at the bottom of my landing page.
Just book a call already if you’re that interested.
You scrolled all the way here.