@MansiCodez We had this problem, you must implement a solution to suppress duplicate function calls, ensuring that only one execution is in-flight for a given key at a time.
we used singleflight in Go.
@trunarla@NYCMayor You're walking a road we paved. Trust us—we've seen the ending. It leads nowhere but emptiness and ruin.
Look at the Iranian regime and how a religious regime killed 53,000 of its own people just for peaceful protesting.
I'm working on my PaaS idea with Rust.
At first, everything felt hard, blurry, and full of "How?" and "Why?" questions. But with time, things became clearer than ever.
If you're a beginner like I was, it's okay to feel the same way. Keep going—clarity comes with time.
The data we store on S3 is replicated multiple times to make sure it is never lost (even in the event of a disaster). If they simply stored multiple copies of the data, it would get expensive very quickly at the exabyte scale.
This is where erasure coding gives you the same durability for a fraction of the storage cost. Let me explain...
The idea is simple: split your data into k chunks, then compute m extra parity chunks from them, for a total of n = k + m chunks spread across different disks or nodes. You can lose any m of those n chunks and still reconstruct the original data.
Standard storage class of S3 uses an erasure coding scheme, around 9 data shards and 4 parity shards, spread across multiple availability zones. That gives 99.999999999 percent (eleven nines) durability while using roughly 1.5x the actual data size.
This would have been 3x for a naive triple replication, and thus, the additional cost is pretty low with erasure coding.
The parity math comes from Reed-Solomon codes, the same technique used in QR codes. Given any k of the n total chunks, you can solve a system of linear equations to recover the rest. You can read the Reed-Solomon wiki page for more details, or ask your fav LLM.
By the way, here, the tradeoff is compute.
Reconstructing missing chunks needs CPU cycles to run the decoding math, while replication just reads a copy. Reconstruction also gets slower as you increase the number of parity shards, since the math involves larger matrices.
This is why systems tune k and m carefully. Too few parity shards and durability suffers; too many and reconstruction becomes more expensive.
By the way, Erasure Coding is the reason cloud storage is both cheap and durable at the same time. Just a bunch of encoding math at play.
Hope you found this interesting.
Build Your Own Database From Scratch in C
it walks you through building SQLite from scratch. starts with a REPL, then adds a B-tree, then paging, then persistence to disk
by the end you understand why databases are structured the way they are. not just how to use them
Introducing React Native Doctor
Find performance and security bugs in your mobile app
Run via CLI and fix with agents. Fully open source
npx react-doctor@latest
How Servers Work: A Hands-On Introduction to TCP Sockets 🧙♂️
Hot off the press! Learn how servers actually work by building a tiny TCP server and client from scratch. Traditionally, with a bunch of visual explainers and practical challenges:
https://t.co/9VzdxjTv5t