I'm on a dilemma on whether implement a basic, redis-like, temporary cache with TTL (Let's call it UltraMiniRedis) using tokio sync primitives, or just discard the idea and go for the real Redis, which sounds overkill since I just need that basic functionality.
If I go with the implementation, I'm planning on using the RwLock on a HashMap, and using an interval to remove the stale entries. It's particularly the usage of the interval that makes me question the viability of it.
Any thoughts on this? I was also considering Jon Gjengset's Concurrent HashMap, but bringing a dependency would be going against the idea of not using external dependencies. Same goes for mini-redis, hence the mocking title, since I just want to be able to check if something is in the cache to avoid unnecessary database lookups.