๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
@dsalgorithms
11.5K
subscribers
20
photos
2
files
144
links
It contains data structures & algorithmic problem solutions.
Download Telegram
Join
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
11.5K subscribers
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%AC%F0%9D%97%BC%F0%9D%98%82%F0%9D%97%BF-%F0%9D%98%81%F0%9D%97%B6%F0%9D%97%BA%F0%9D%97%B2%F0%9D%98%80%F0%9D%98%81%F0%9D%97%AE%F0%9D%97%BA%F0%9D%97%BD%F0%9D%98%80-%F0%9D%97%AE%F0%9D%97%BF%F0%9D%97%B2-%F0%9D%97%B9%F0%9D%98%86-share-7490042897287938048-_G--/?utm_source=share&utm_medium=member_desktop&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
Distributed Systems: Time Isn't Shared, Causality Matters | Kanahaiya Gupta posted on the topic | LinkedIn
๐ฌ๐ผ๐๐ฟ ๐๐ถ๐บ๐ฒ๐๐๐ฎ๐บ๐ฝ๐ ๐ฎ๐ฟ๐ฒ ๐น๐๐ถ๐ป๐ด ๐๐ผ ๐๐ผ๐.
Every distributed systems engineer learns this the hard way.
โฐ
โ
Most developers believe one simple thing:
"If Event A has an earlier timestamp than Event B...
...then A happened first."
Seems obvious.
It's also wrong.
๐จ
โฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%A7%F0%9D%98%84%F0%9D%97%BC-%F0%9D%98%80%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%83%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%80-%F0%9D%97%A7%F0%9D%98%84%F0%9D%97%BC-%F0%9D%97%B1%F0%9D%97%B6%F0%9D%97%B3%F0%9D%97%B3%F0%9D%97%B2%F0%9D%97%BF%F0%9D%97%B2%F0%9D%97%BB%F0%9D%98%81-share-7490391933538983936-upIZ/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs8
LinkedIn
Lamport Logical Clocks: Causality Over Time | Kanahaiya Gupta posted on the topic | LinkedIn
๐ง๐๐ผ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ๐. ๐ง๐๐ผ ๐ฑ๐ถ๐ณ๐ณ๐ฒ๐ฟ๐ฒ๐ป๐ ๐ฐ๐น๐ผ๐ฐ๐ธ๐. ๐ช๐ต๐ถ๐ฐ๐ต ๐ผ๐ป๐ฒ ๐ถ๐ ๐ฟ๐ถ๐ด๐ต๐?
๐ค
โ
Imagine this.
Server A says it's 10:00 AM.
Server B says it's 9:59 AM.
Both processed the same request.
Now answer this:
Which event happened first?
You can't tell.
And that's exactly why physicalโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%A7%F0%9D%98%84%F0%9D%97%BC-%F0%9D%97%B2%F0%9D%98%83%F0%9D%97%B2%F0%9D%97%BB%F0%9D%98%81%F0%9D%98%80-%F0%9D%97%B0%F0%9D%97%AE%F0%9D%97%BB-%F0%9D%97%B5%F0%9D%97%AE%F0%9D%97%BD%F0%9D%97%BD%F0%9D%97%B2%F0%9D%97%BB-%F0%9D%97%AE%F0%9D%98%81-share-7490786218939682819-lN7J/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs8
LinkedIn
Lamport Clocks vs Vector Clocks in Distributed Systems | Kanahaiya Gupta posted on the topic | LinkedIn
๐ง๐๐ผ ๐ฒ๐๐ฒ๐ป๐๐ ๐ฐ๐ฎ๐ป ๐ต๐ฎ๐ฝ๐ฝ๐ฒ๐ป ๐ฎ๐ ๐๐ต๐ฒ ๐๐ฎ๐บ๐ฒ ๐๐ถ๐บ๐ฒ.
And neither happened first.
That sounds impossible...
Until you build distributed systems.
๐คฏ
โ
Imagine Alice and Bob are editing the same Google Doc.
Alice updates Paragraph 1.
Bob updates Paragraph 5.
Both are offline.โฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%A0%F0%9D%97%BC%F0%9D%98%80%F0%9D%98%81-%F0%9D%97%B0%F0%9D%97%AE%F0%9D%97%BB%F0%9D%97%B1%F0%9D%97%B6%F0%9D%97%B1%F0%9D%97%AE%F0%9D%98%81%F0%9D%97%B2%F0%9D%98%80-%F0%9D%97%B0%F0%9D%97%AE%F0%9D%97%BB-%F0%9D%97%B2%F0%9D%98%85-share-7491108355768213504-3-uA/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs8
LinkedIn
Leader Election in Distributed Systems Ensures Single Authority | Kanahaiya Gupta posted on the topic | LinkedIn
๐ ๐ผ๐๐ ๐ฐ๐ฎ๐ป๐ฑ๐ถ๐ฑ๐ฎ๐๐ฒ๐ ๐ฐ๐ฎ๐ป ๐ฒ๐ ๐ฝ๐น๐ฎ๐ถ๐ป ๐ฅ๐ฎ๐ณ๐.
๐ฉ๐ฒ๐ฟ๐ ๐ณ๐ฒ๐ ๐ฐ๐ฎ๐ป ๐ฒ๐ ๐ฝ๐น๐ฎ๐ถ๐ป ๐๐ต๐ ๐๐ฒ๐ฎ๐ฑ๐ฒ๐ฟ ๐๐น๐ฒ๐ฐ๐๐ถ๐ผ๐ป ๐ฒ๐ ๐ถ๐๐๐.
๐ค
That's exactly where many System Design interviews are won or lost.
โ
Imagine five engineers working on the same project.
Everyone starts assigning tasks independently.
๐จ
โฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%AA%F0%9D%97%B5%F0%9D%97%AE%F0%9D%98%81-%F0%9D%97%B5%F0%9D%97%AE%F0%9D%97%BD%F0%9D%97%BD%F0%9D%97%B2%F0%9D%97%BB%F0%9D%98%80-%F0%9D%98%84%F0%9D%97%B5%F0%9D%97%B2%F0%9D%97%BB-%F0%9D%98%81%F0%9D%98%84%F0%9D%97%BC-%F0%9D%98%80%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%83%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%80-share-7491491197421621249-WBGa/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs8
LinkedIn
Raft Leader Election Simplified for Distributed Systems | Kanahaiya Gupta posted on the topic | LinkedIn
๐ช๐ต๐ฎ๐ ๐ต๐ฎ๐ฝ๐ฝ๐ฒ๐ป๐ ๐๐ต๐ฒ๐ป ๐๐๐ผ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ๐ ๐ฏ๐ผ๐๐ต ๐๐ฎ๐...
"I'm the leader."
๐
Without rules, distributed systems become chaos.
Raft solved this with one brilliantly simple idea.
โ
Imagine 5 friends choosing a football captain.
๐ฅ
Alice
๐ฅ
Bob
๐ฅ
Charlie
๐ฅ
David
๐ฅ
Emma
The currentโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%A7%F0%9D%97%B5%F0%9D%97%BF%F0%9D%97%B2%F0%9D%97%B2-%F0%9D%97%B0%F0%9D%97%BC%F0%9D%97%BD%F0%9D%97%B6%F0%9D%97%B2%F0%9D%98%80-%F0%9D%97%BC%F0%9D%97%B3-%F0%9D%98%86%F0%9D%97%BC%F0%9D%98%82%F0%9D%97%BF-%F0%9D%97%B1%F0%9D%97%AE%F0%9D%98%81%F0%9D%97%AE-share-7491850059265896448-NhNH/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs8
LinkedIn
Replication Tradeoffs in Distributed Systems | Kanahaiya Gupta posted on the topic | LinkedIn
๐ง๐ต๐ฟ๐ฒ๐ฒ ๐ฐ๐ผ๐ฝ๐ถ๐ฒ๐ ๐ผ๐ณ ๐๐ผ๐๐ฟ ๐ฑ๐ฎ๐๐ฎ ๐ฐ๐ฎ๐ป ๐ฏ๐ฒ ๐๐ผ๐ฟ๐๐ฒ ๐๐ต๐ฎ๐ป ๐ผ๐ป๐ฒ.
If those three copies don't agree.
โ
Imagine your database has 3 replicas:
A โ $1,000
B โ $1,000
C โ $1,000
A customer deposits $500.
For a short period, you might have:
A โ $1,500
โ
B โ $1,000
โ
C โ $1,000โฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%A7%F0%9D%97%B5%F0%9D%97%BF%F0%9D%97%B2%F0%9D%97%B2-%F0%9D%98%80%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%83%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%80-%F0%9D%97%B0%F0%9D%97%AE%F0%9D%97%BB-%F0%9D%97%B5%F0%9D%97%AE%F0%9D%98%83%F0%9D%97%B2-share-7492229245058859008-My0I/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs8
LinkedIn
Distributed Systems: The Hard Problem of Consensus | Kanahaiya Gupta posted on the topic | LinkedIn
๐ง๐ต๐ฟ๐ฒ๐ฒ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ๐ ๐ฐ๐ฎ๐ป ๐ต๐ฎ๐๐ฒ ๐๐ต๐ฒ ๐๐ฎ๐บ๐ฒ ๐ฑ๐ฎ๐๐ฎโฆ๐ฎ๐ป๐ฑ ๐๐๐ถ๐น๐น ๐ฑ๐ถ๐๐ฎ๐ด๐ฟ๐ฒ๐ฒ.
โ
Replication gives you multiple copies.
But it doesn't automatically give you consistency.
The real problem is much harder:
๐ช๐ต๐ฎ๐ ๐ต๐ฎ๐ฝ๐ฝ๐ฒ๐ป๐ ๐ป๐ฒ๐ ๐?
โ
Imagine 3 servers:
Server A
Server B
Server C
All startโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%99%F0%9D%97%B6%F0%9D%98%83%F0%9D%97%B2-%F0%9D%98%80%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%83%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%80-%F0%9D%97%B1%F0%9D%97%B6%F0%9D%98%80%F0%9D%97%AE%F0%9D%97%B4%F0%9D%97%BF%F0%9D%97%B2%F0%9D%97%B2-share-7492581209768673282-5Wmt/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs8
LinkedIn
Understanding Consensus in Distributed Systems | Kanahaiya Gupta posted on the topic | LinkedIn
๐๐ถ๐๐ฒ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ๐ ๐ฑ๐ถ๐๐ฎ๐ด๐ฟ๐ฒ๐ฒ. ๐ช๐ต๐ผ ๐ด๐ฒ๐๐ ๐๐ผ ๐ฑ๐ฒ๐ฐ๐ถ๐ฑ๐ฒ ๐๐ต๐ผ'๐ ๐ฟ๐ถ๐ด๐ต๐?
Imagine this:
A โ X = 100
B โ X = 100
C โ X = 200
D โ X = 100
E โ
โ
crashed
Four servers are alive.
But they don't agree.
And the network can't tell you whether a server is:
๐
Dead
๐
Slow
๐
Disconnectedโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_distributedsystems-systemdesign-softwarearchitecture-share-7492945454012256257-D0_m/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs8
LinkedIn
Choosing the Right Consistency for Your Distributed System | Kanahaiya Gupta posted on the topic | LinkedIn
๐ฆ๐๐ฟ๐ผ๐ป๐ด ๐ฐ๐ผ๐ป๐๐ถ๐๐๐ฒ๐ป๐ฐ๐ ๐ถ๐๐ป'๐ ๐ฎ๐น๐๐ฎ๐๐ ๐ฏ๐ฒ๐๐๐ฒ๐ฟ. ๐๐'๐ ๐ผ๐ณ๐๐ฒ๐ป ๐ท๐๐๐ ๐บ๐ผ๐ฟ๐ฒ ๐ฒ๐ ๐ฝ๐ฒ๐ป๐๐ถ๐๐ฒ.
โ๏ธ
โ
Imagine your database has 3 replicas:
A โ B โ C
A user changes their name through A:
A โ John
โ
But replication takes time.
For a short period:
A โ John
B โ Old value
C โ Old valueโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_distributedsystems-systemdesign-softwarearchitecture-share-7493301314400034817-LE7J/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
Distributed Systems: When Coordination is Not Always Necessary | Kanahaiya Gupta posted on the topic | LinkedIn
๐ง๐ต๐ฒ ๐บ๐ผ๐๐ ๐ฒ๐ ๐ฝ๐ฒ๐ป๐๐ถ๐๐ฒ ๐๐ผ๐ฟ๐ฑ๐ ๐ถ๐ป ๐ฎ ๐ฑ๐ถ๐๐๐ฟ๐ถ๐ฏ๐๐๐ฒ๐ฑ ๐๐๐๐๐ฒ๐บ ๐บ๐ถ๐ด๐ต๐ ๐ฏ๐ฒ:
โ๐๐ฎ๐ป ๐ ๐ฝ๐ฟ๐ผ๐ฐ๐ฒ๐ฒ๐ฑ?โ
๐จ
โ
One server asks.
Another server checks.
A third server confirms.
Only then does the request move forward.
That sounds safe.
Until every request starts doing it.
โ๏ธ
Latency increases.โฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%96%F0%9D%97%BC%F0%9D%97%BB%F0%9D%98%80%F0%9D%97%B2%F0%9D%97%BB%F0%9D%98%80%F0%9D%98%82%F0%9D%98%80-%F0%9D%98%80%F0%9D%97%AE%F0%9D%98%86%F0%9D%98%80-%F0%9D%97%9F%F0%9D%97%B2%F0%9D%98%81%F0%9D%98%80-%F0%9D%97%AE%F0%9D%97%B4%F0%9D%97%BF%F0%9D%97%B2%F0%9D%97%B2-share-7493668307510861825-PYp1/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
CRDTs: Conflict-Free Replicated Data Types for Distributed Systems | Kanahaiya Gupta posted on the topic | LinkedIn
๐๐ผ๐ป๐๐ฒ๐ป๐๐๐ ๐๐ฎ๐๐: โ๐๐ฒ๐โ๐ ๐ฎ๐ด๐ฟ๐ฒ๐ฒ ๐ฏ๐ฒ๐ณ๐ผ๐ฟ๐ฒ ๐๐ฒ ๐ฎ๐ฐ๐.โ
๐๐ฅ๐๐ง๐ ๐๐ฎ๐: โ๐๐ฒ๐โ๐ ๐ฎ๐ฐ๐. ๐ช๐ฒโ๐น๐น ๐บ๐ฒ๐ฟ๐ด๐ฒ ๐น๐ฎ๐๐ฒ๐ฟ.โ
๐คฏ
โ
At first, that sounds like a recipe for data corruption.
Two replicas.
No immediate coordination.
Both changing the same data.
What could possibly go wrong?
๐จ
CRDTโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%AC%F0%9D%97%BC%F0%9D%98%82%F0%9D%97%BF-%F0%9D%97%BF%F0%9D%97%B2%F0%9D%97%BD%F0%9D%97%B9%F0%9D%97%B6%F0%9D%97%B0%F0%9D%97%AE%F0%9D%98%80-%F0%9D%97%B0%F0%9D%97%AE%F0%9D%97%BB%F0%9D%98%81-%F0%9D%98%81%F0%9D%97%AE%F0%9D%97%B9%F0%9D%97%B8-share-7494016228458684416-T2Zv/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
Designing for Network Partitions in Distributed Systems | Kanahaiya Gupta posted on the topic | LinkedIn
๐ฌ๐ผ๐๐ฟ ๐ฟ๐ฒ๐ฝ๐น๐ถ๐ฐ๐ฎ๐ ๐ฐ๐ฎ๐ป'๐ ๐๐ฎ๐น๐ธ ๐๐ผ ๐ฒ๐ฎ๐ฐ๐ต ๐ผ๐๐ต๐ฒ๐ฟ. ๐๐ผ ๐๐ผ๐ ๐ฟ๐ฒ๐ท๐ฒ๐ฐ๐ ๐๐ต๐ฒ ๐๐๐ฒ๐ฟ?
Or accept the write and deal with the consequences later?
๐ฅ
โ
A network partition happens.
Replica A is disconnected from B and C.
Then a user says:
"Update my shopping cart."
You have two choices.โฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%94-%F0%9D%97%B1%F0%9D%97%B6%F0%9D%98%80%F0%9D%98%81%F0%9D%97%BF%F0%9D%97%B6%F0%9D%97%AF%F0%9D%98%82%F0%9D%98%81%F0%9D%97%B2%F0%9D%97%B1-%F0%9D%98%80%F0%9D%98%86%F0%9D%98%80%F0%9D%98%81%F0%9D%97%B2%F0%9D%97%BA-%F0%9D%97%B0-share-7494404118522793984-SWKL/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
๐ ๐ฑ๐ถ๐๐๐ฟ๐ถ๐ฏ๐๐๐ฒ๐ฑ ๐๐๐๐๐ฒ๐บ ๐ฐ๐ฎ๐ป ๐ฏ๐ฒ ๐ฐ๐ผ๐บ๐ฝ๐น๐ฒ๐๐ฒ๐น๐ ๐ฐ๐ผ๐ฟ๐ฟ๐ฒ๐ฐ๐โฆ
๐๐ป๐ฑ ๐๐๐ถ๐น๐น ๐บ๐ฎ๐ธ๐ฒ ๐๐ฒ๐ฟ๐ผ ๐๐ฒ๐ป๐๐ฒ ๐๐ผ ๐๐๐ฒ๐ฟ๐.
๐จ
โ
Imagine opening a conversation and seeing:โฆโฆ
๐ ๐ฑ๐ถ๐๐๐ฟ๐ถ๐ฏ๐๐๐ฒ๐ฑ ๐๐๐๐๐ฒ๐บ ๐ฐ๐ฎ๐ป ๐ฏ๐ฒ ๐ฐ๐ผ๐บ๐ฝ๐น๐ฒ๐๐ฒ๐น๐ ๐ฐ๐ผ๐ฟ๐ฟ๐ฒ๐ฐ๐โฆ
๐๐ป๐ฑ ๐๐๐ถ๐น๐น ๐บ๐ฎ๐ธ๐ฒ ๐๐ฒ๐ฟ๐ผ ๐๐ฒ๐ป๐๐ฒ ๐๐ผ ๐๐๐ฒ๐ฟ๐.
๐จ
โ
Imagine opening a conversation and seeing:
Bob: โGreat idea!โ
No context.
No original message.
Just the reply.
Great idea about what?
The data is there.
The replicas mayโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%A0%F0%9D%97%BC%F0%9D%98%80%F0%9D%98%81-%F0%9D%97%B1%F0%9D%97%B6%F0%9D%98%80%F0%9D%98%81%F0%9D%97%BF%F0%9D%97%B6%F0%9D%97%AF%F0%9D%98%82%F0%9D%98%81%F0%9D%97%B2%F0%9D%97%B1-%F0%9D%98%80%F0%9D%98%86%F0%9D%98%80%F0%9D%98%81%F0%9D%97%B2%F0%9D%97%BA%F0%9D%98%80-share-7494752851064315906-iT4x/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
๐ ๐ผ๐๐ ๐ฑ๐ถ๐๐๐ฟ๐ถ๐ฏ๐๐๐ฒ๐ฑ ๐๐๐๐๐ฒ๐บ๐ ๐ฎ๐ฟ๐ฒ ๐ผ๐๐ฒ๐ฟ-๐ฐ๐ผ๐ผ๐ฟ๐ฑ๐ถ๐ป๐ฎ๐๐ฒ๐ฑ.
๐ง๐ต๐ฒ ๐ฟ๐ฒ๐ฎ๐น ๐บ๐ถ๐๐๐ฎ๐ธ๐ฒ? ๐ฆ๐ผ๐น๐๐ถ๐ป๐ด ๐๐ต๐ฒ ๐๐ฟ๐ผ๐ป๐ด ๐ฝ๐ฟ๐ผ๐ฏ๐น๐ฒ๐บ.
๐ฅ
โ
We often jump straight to:โฆ | Kanahaiyaโฆ
๐ ๐ผ๐๐ ๐ฑ๐ถ๐๐๐ฟ๐ถ๐ฏ๐๐๐ฒ๐ฑ ๐๐๐๐๐ฒ๐บ๐ ๐ฎ๐ฟ๐ฒ ๐ผ๐๐ฒ๐ฟ-๐ฐ๐ผ๐ผ๐ฟ๐ฑ๐ถ๐ป๐ฎ๐๐ฒ๐ฑ.
๐ง๐ต๐ฒ ๐ฟ๐ฒ๐ฎ๐น ๐บ๐ถ๐๐๐ฎ๐ธ๐ฒ? ๐ฆ๐ผ๐น๐๐ถ๐ป๐ด ๐๐ต๐ฒ ๐๐ฟ๐ผ๐ป๐ด ๐ฝ๐ฟ๐ผ๐ฏ๐น๐ฒ๐บ.
๐ฅ
โ
We often jump straight to:
๐
Consensus
๐
Locks
๐
Transactions
๐
Global coordination
Because distributed systems are hard.
But sometimes, the real question is muchโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%9C%F0%9D%97%B3-%F0%9D%9F%AD%F0%9D%9F%AC%F0%9D%9F%AC%F0%9D%9F%AC%F0%9D%9F%AC-%F0%9D%98%80%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%83%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%80-%F0%9D%97%BB%F0%9D%97%B2%F0%9D%97%B2%F0%9D%97%B1-share-7495115540496039936-IT7d/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
๐๐ณ ๐ญ๐ฌ,๐ฌ๐ฌ๐ฌ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ๐ ๐ป๐ฒ๐ฒ๐ฑ ๐๐ผ ๐ธ๐ป๐ผ๐ ๐๐ผ๐บ๐ฒ๐๐ต๐ถ๐ป๐ดโฆ
๐๐ผ๐ปโ๐ ๐บ๐ฎ๐ธ๐ฒ ๐ผ๐ป๐ฒ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ ๐ฐ๐ฎ๐น๐น ๐๐ต๐ฒ๐บ ๐ฎ๐น๐น.
๐จ
โ
Imagine a new configuration is deployed.
10โฆ
๐๐ณ ๐ญ๐ฌ,๐ฌ๐ฌ๐ฌ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ๐ ๐ป๐ฒ๐ฒ๐ฑ ๐๐ผ ๐ธ๐ป๐ผ๐ ๐๐ผ๐บ๐ฒ๐๐ต๐ถ๐ป๐ดโฆ
๐๐ผ๐ปโ๐ ๐บ๐ฎ๐ธ๐ฒ ๐ผ๐ป๐ฒ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ ๐ฐ๐ฎ๐น๐น ๐๐ต๐ฒ๐บ ๐ฎ๐น๐น.
๐จ
โ
Imagine a new configuration is deployed.
10,000 servers need to know.
The obvious solution?
One node โ 10,000 messages.
Simple.
Until that โsimpleโ design becomes your bottleneck.โฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%AC%F0%9D%97%BC%F0%9D%98%82%F0%9D%97%BF-%F0%9D%97%B1%F0%9D%97%B6%F0%9D%98%80%F0%9D%98%81%F0%9D%97%BF%F0%9D%97%B6%F0%9D%97%AF%F0%9D%98%82%F0%9D%98%81%F0%9D%97%B2%F0%9D%97%B1-%F0%9D%98%80%F0%9D%98%86%F0%9D%98%80%F0%9D%98%81%F0%9D%97%B2%F0%9D%97%BA-share-7495462714237009921-oaQy/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
๐ฌ๐ผ๐๐ฟ ๐ฑ๐ถ๐๐๐ฟ๐ถ๐ฏ๐๐๐ฒ๐ฑ ๐๐๐๐๐ฒ๐บ ๐ฐ๐ฎ๐ป ๐ป๐ฒ๐๐ฒ๐ฟ ๐ธ๐ป๐ผ๐ ๐ณ๐ผ๐ฟ ๐๐๐ฟ๐ฒ ๐๐ต๐ผ ๐ถ๐ ๐ฎ๐น๐ถ๐๐ฒ.
๐๐ป๐ฑ ๐๐ต๐ฎ๐โ๐ ๐ป๐ผ๐ ๐ฎ ๐ฏ๐๐ด.
๐จ
โ
Imagine a cluster:
A B C D E
Then D suddenlyโฆโฆ
๐ฌ๐ผ๐๐ฟ ๐ฑ๐ถ๐๐๐ฟ๐ถ๐ฏ๐๐๐ฒ๐ฑ ๐๐๐๐๐ฒ๐บ ๐ฐ๐ฎ๐ป ๐ป๐ฒ๐๐ฒ๐ฟ ๐ธ๐ป๐ผ๐ ๐ณ๐ผ๐ฟ ๐๐๐ฟ๐ฒ ๐๐ต๐ผ ๐ถ๐ ๐ฎ๐น๐ถ๐๐ฒ.
๐๐ป๐ฑ ๐๐ต๐ฎ๐โ๐ ๐ป๐ผ๐ ๐ฎ ๐ฏ๐๐ด.
๐จ
โ
Imagine a cluster:
A B C D E
Then D suddenly disappears from A's view.
A says:
"D is dead."
B says:
"I can still reach D."
And D?
"I'm literally still here."
โ๏ธ
That isโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%94%F0%9D%97%B1%F0%9D%97%B1-%F0%9D%9F%AD-%F0%9D%98%80%F0%9D%97%B2%F0%9D%97%BF%F0%9D%98%83%F0%9D%97%B2%F0%9D%97%BF-%F0%9D%97%AA%F0%9D%97%B5%F0%9D%98%86-%F0%9D%97%BA%F0%9D%97%BC%F0%9D%98%83%F0%9D%97%B2-%F0%9D%97%BA%F0%9D%97%B6%F0%9D%97%B9%F0%9D%97%B9%F0%9D%97%B6%F0%9D%97%BC%F0%9D%97%BB%F0%9D%98%80-share-7495835669043355648-0zWE/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
๐๐ฑ๐ฑ ๐ญ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ.
๐ช๐ต๐ ๐บ๐ผ๐๐ฒ ๐บ๐ถ๐น๐น๐ถ๐ผ๐ป๐ ๐ผ๐ณ ๐ธ๐ฒ๐๐?
๐จ
Thatโs the problem consistent hashing was built to solve.
โ
Imagine your system hasโฆ
๐๐ฑ๐ฑ ๐ญ ๐๐ฒ๐ฟ๐๐ฒ๐ฟ.
๐ช๐ต๐ ๐บ๐ผ๐๐ฒ ๐บ๐ถ๐น๐น๐ถ๐ผ๐ป๐ ๐ผ๐ณ ๐ธ๐ฒ๐๐?
๐จ
Thatโs the problem consistent hashing was built to solve.
โ
Imagine your system has 3 servers:
A B C
And millions of users.
A simple rule decides where each user's data lives:
hash(user_id) % number_of_servers
Fast.โฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%A7%F0%9D%97%B5%F0%9D%97%B2-%F0%9D%97%BA%F0%9D%97%BC%F0%9D%98%80%F0%9D%98%81-%F0%9D%97%B2%F0%9D%98%85%F0%9D%97%BD%F0%9D%97%B2%F0%9D%97%BB%F0%9D%98%80%F0%9D%97%B6%F0%9D%98%83%F0%9D%97%B2-%F0%9D%97%B1%F0%9D%97%AE%F0%9D%98%81-share-7496183906136809472-JPgt/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
๐ง๐ต๐ฒ ๐บ๐ผ๐๐ ๐ฒ๐ ๐ฝ๐ฒ๐ป๐๐ถ๐๐ฒ ๐ฑ๐ฎ๐๐ฎ๐ฏ๐ฎ๐๐ฒ ๐บ๐ถ๐๐๐ฎ๐ธ๐ฒ?
Choosing your shard key before understanding your queries.
๐จ
โ
At 10,000 users, almost anyโฆ
๐ง๐ต๐ฒ ๐บ๐ผ๐๐ ๐ฒ๐ ๐ฝ๐ฒ๐ป๐๐ถ๐๐ฒ ๐ฑ๐ฎ๐๐ฎ๐ฏ๐ฎ๐๐ฒ ๐บ๐ถ๐๐๐ฎ๐ธ๐ฒ?
Choosing your shard key before understanding your queries.
๐จ
โ
At 10,000 users, almost any partitioning strategy works.
At 100 million?
The wrong one becomes an architectural constraint you carry for years.
โ๏ธ
โ
๐๐ผ๐ป๐๐ถ๐ฑ๐ฒ๐ฟโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://www.linkedin.com/posts/kanahaiya-gupta_%F0%9D%97%A3%F0%9D%97%AE%F0%9D%97%BF%F0%9D%98%81%F0%9D%97%B6%F0%9D%98%81%F0%9D%97%B6%F0%9D%97%BC%F0%9D%97%BB%F0%9D%97%B6%F0%9D%97%BB%F0%9D%97%B4-%F0%9D%97%B0%F0%9D%97%AE%F0%9D%97%BB-%F0%9D%98%80%F0%9D%97%B0%F0%9D%97%AE%F0%9D%97%B9%F0%9D%97%B2-share-7496563230887284737-EgI1/?utm_source=social_share_send&utm_medium=member_desktop_web&rcm=ACoAAAnABVQBlknMXqfQbboPiNxNmcKfRLyBNs
LinkedIn
๐ฃ๐ฎ๐ฟ๐๐ถ๐๐ถ๐ผ๐ป๐ถ๐ป๐ด ๐ฐ๐ฎ๐ป ๐๐ฐ๐ฎ๐น๐ฒ ๐๐ผ๐๐ฟ ๐ฑ๐ฎ๐๐ฎ๐ฏ๐ฎ๐๐ฒ.
๐๐ ๐ฐ๐ฎ๐ป ๐ฎ๐น๐๐ผ ๐บ๐ฎ๐ธ๐ฒ ๐๐ผ๐๐ฟ ๐ป๐ฒ๐ ๐ ๐ผ๐๐๐ฎ๐ด๐ฒ ๐ฏ๐ถ๐ด๐ด๐ฒ๐ฟ.
๐จ
โ
Imagine 1 billion users.
So you split theโฆโฆ
๐ฃ๐ฎ๐ฟ๐๐ถ๐๐ถ๐ผ๐ป๐ถ๐ป๐ด ๐ฐ๐ฎ๐ป ๐๐ฐ๐ฎ๐น๐ฒ ๐๐ผ๐๐ฟ ๐ฑ๐ฎ๐๐ฎ๐ฏ๐ฎ๐๐ฒ.
๐๐ ๐ฐ๐ฎ๐ป ๐ฎ๐น๐๐ผ ๐บ๐ฎ๐ธ๐ฒ ๐๐ผ๐๐ฟ ๐ป๐ฒ๐ ๐ ๐ผ๐๐๐ฎ๐ด๐ฒ ๐ฏ๐ถ๐ด๐ด๐ฒ๐ฟ.
๐จ
โ
Imagine 1 billion users.
So you split the data:
๐
Users AโM โ Partition 1
๐
Users NโZ โ Partition 2
Traffic is distributed.
The database can scale.
โ๏ธ
Then Server A crashes.โฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://lnkd.in/p/d9Gi8UjF
LinkedIn
Distributed transactions don't solve your hardest problem.
They make you pay for certainty.
๐ฅ
โ
Imagine transferring $100 fromโฆ
Distributed transactions don't solve your hardest problem.
They make you pay for certainty.
๐ฅ
โ
Imagine transferring $100 from Alice to Bob.
Alice's balance lives on Partition A.
Bob's balance lives on Partition B.
Step 1:
Alice โ -$100
โ
Then the serverโฆ
๐๐๐ง๐ ๐ฆ๐ง๐ฅ๐จ๐๐ง๐จ๐ฅ๐๐ฆ ๐๐ก๐ ๐๐๐๐ข๐ฅ๐๐ง๐๐ ๐ฆ
https://lnkd.in/p/dcsBZK7t
LinkedIn
#distributedsystems #microservices #systemdesign #softwarearchitecture #engineering | Kanahaiya Gupta
๐ฆ๐ฎ๐ด๐ฎ ๐ฑ๐ผ๐ปโ๐ ๐ฝ๐ฟ๐ฒ๐๐ฒ๐ป๐ ๐ณ๐ฎ๐ถ๐น๐๐ฟ๐ฒ.๐ง๐ต๐ฒ๐ ๐ฑ๐ฒ๐๐ถ๐ด๐ป ๐ณ๐ผ๐ฟ ๐ถ๐.
โ
Imagine an e-commerce order:
๐
Reserve inventory
๐
Charge payment
๐
Create shipment
Three services.
Three databases.
One business workflow.
Now imagine:
Inventory
โ
Payment
โ
Shipping
โ
A traditional transactionโฆ