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.
Something like LevelDB is relatively easy to write. Then you can build the rest of Redis on top of it.