It is not space vs time, but space vs time vs correctness

Arpit Bhayani

Arpit Bhayani

Sep 02, 2024 • 1 min read


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

Arpit Bhayani

Principal Engineer II at Razorpay - building Agent Studio, Ex-staff engg at GCP Memorystore & Dataproc, Creator of DiceDB, ex-Amazon Fast Data, ex-Director of Engg. SRE and Data Engineering at Unacademy. I spark engineering curiosity through my no-fluff engineering videos on YouTube and my courses