It is not space vs time, but space vs time vs correctness.
If you want to improve on space and time, be okay with giving up on correctness. Bloom filters and the entire spectrum of approximate data structures and algorithms fork from this constraint.
all the trade-offs Redis takes internally give up on correctness wherever possible to save space and time. Their eviction and expiration strategy are prime examples of it.
So, space vs time was never a dilemma but a trilemma.
⚡ I keep writing and sharing my practical experience and learnings every day, so if you resonate then follow along. I keep it no fluff.
arpitbhayani.me/redis