Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Sorry for being a little off topic, but the Mini Redis tutorial [1] was really fun when I did it a few years ago. It has you implement a server and client in Rust using the Tokio library.

I think Redis is a great server to “build yourself” as you don’t need to start with much to get it going.

[1] https://tokio.rs/tokio/tutorial/setup



If anyone is looking at this stuff and thinking it’s intimidating then think again: Redis is mostly a lot of fuss around a hash map. There are cool features sure but the idea is mainly “what if a hash map were accessible from two or more servers”. If you only have one or two servers, you only want a cache, and you don’t anticipate scaling up soon (be honest) you can just use a hash map with expiry checking and not have to learn how to deploy another piece of software.


Redis offeres alot more then just a key value store. The fuss is the data structures it provides.

And just using a hash map in memory isn't sufficient. You'll have unbounded growth. You need a max size and need to evict. Then you want to do that efficiently so your not wasting space on useless keys...


And some languages will even have this built in to the standard library, like C#'s MemoryCache class.


IIRC there’s a nice abstraction in .NET Core for caching, which has a swappable backend that means you can upgrade from MemoryCache to Redis if you ever need it. If only all software was this good. One of the least-leaky abstractions of all time.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: