ทวีตที่ปักหมุด
Ritesh Roushan
21.3K posts

Ritesh Roushan
@devXritesh
Software Engineer at Startup • System Design • Microservices • AI Infrastructure | Creating real-world content for devs
✉️ DM for Collab & Work เข้าร่วม Şubat 2018
894 กำลังติดตาม5.3K ผู้ติดตาม

@ayesha_fatiima I those mean time, otp is in queue or sometimes sms provider delaying
English

@droidbuilds Build your self first, keep surround yourself who's talking about self development, finance, businesses etc.
Everyone is distracted, so focus on yourself
English

8 KILLER CODING WEBSITES THAT I USE REGULARLY:
1. REGEX101.COM
Test, debug, and understand regex like a pro.
2. OVERAPI.COM
The ultimate cheat sheet collection for everything: JS, Python, Git, Linux, Regex...
3. CARBON.NOW.SH
Turn your code into beautiful images for social media or portfolios.
4. ROADMAP.SH
All the developer roadmaps you need - from frontend to DevOps.
5. DEVDOCS.IO
Offline-first, super-fast API documentation (React, JS, Python, etc.).
6. REPLIT.COM
Code & deploy multi-language apps in the browser - even backend APIs.
7. SOURCEGRAPH.COM
Search across real-world open source codebases - like you own GitHub.
8. HTMX.ORG
Add dynamic behavior to HTML - no JS required.
Bookmark it. Repost it
You will never see this account unless you follow me right now

English

@tanujDE3180 Cursor based pagination
Here is detailed explanation about pagination too
devxritesh.medium.com/api-database-d…
English

Most people answer:
A) Database
That's usually wrong.
The first thing that fails is often the cache.
Here's why 👇
1. Celebrity posts a tweet
50M followers.
Millions immediately refresh.
Everyone requests the same tweet.
2. Cache Miss Storm
If the tweet isn't cached yet:
Millions of requests hit Redis simultaneously.
This is called a cache stampede.
Suddenly:
• Redis CPU spikes
• Network saturation increases
• Database gets hammered
3. Database Becomes the Next Victim
After cache misses:
- Millions of requests fall back to the database.
- Now the database becomes overloaded.
- Not because it's slow.
Because the cache stopped protecting it.
4. How X/Twitter Handles This
Request Flow:
User
↓
CDN
↓
Load Balancer
↓
API Gateway
↓
Redis Cache
↓
Database
Most reads never reach the database.
5. Celebrity Problem
Normal users:
- Fan-out on Write
- Tweet gets pushed to follower timelines.
- Fast reads.
Celebrity users:
- Fan-out on Read
- Store the tweet once.
- Generate timelines dynamically.
Otherwise you'd write tens of millions of timeline entries.
6. Protection Layers
• Redis caching
• CDN edge caching
• Request coalescing
• Rate limiting
• Read replicas
• Queue-based timeline generation
Production lesson:
The database isn't usually the first thing that fails.
The system fails when too many requests bypass the cache.
Protect the cache.
The cache protects everything else.

Ritesh Roushan@devXritesh
System Design Interview Question: A celebrity with 50M followers posts a tweet. Within seconds: • Millions open the app • Millions refresh feeds • Millions request the same content What fails first? A) Database B) Cache C) API Servers D) Message Queue And how would you prevent it? Explain your architecture 👇
English

iPhone Models and Their Release Year
• 🍏 iPhone - 2007
• 🌐 iPhone 3G - 2008
• 🚀 iPhone 3GS - 2009
• 💎 iPhone 4 - 2010
• ⭐ iPhone 4S - 2011
• 🎵 iPhone 5 - 2012
• 🌈 iPhone 5c - 2013
• 👑 iPhone 5s - 2013
• 📘 iPhone 6 - 2014
• ➕ iPhone 6 Plus - 2014
• ✨ iPhone 6s - 2015
• 🏆 iPhone 6s Plus - 2015
• 🎯 iPhone SE - 2016
• 🎧 iPhone 7 - 2016
• 📷 iPhone 7 Plus - 2016
• 🔋 iPhone 8 - 2017
• ⚡ iPhone 8 Plus - 2017
• 🔟 iPhone X - 2017
• 🌈 iPhone XR - 2018
• 💫 iPhone XS - 2018
• 🦅 iPhone XS Max - 2018
• 📸 iPhone 11 - 2019
• 🎬 iPhone 11 Pro - 2019
• 🚁 iPhone 11 Pro Max - 2019
• 🎯 iPhone SE (2nd generation) - 2020
• 🤏 iPhone 12 mini - 2020
• 🧲 iPhone 12 - 2020
• 💠 iPhone 12 Pro - 2020
• 🏅 iPhone 12 Pro Max - 2020
• 🪶 iPhone 13 mini - 2021
• 🎥 iPhone 13 - 2021
• 💎 iPhone 13 Pro - 2021
• 🚀 iPhone 13 Pro Max - 2021
• 🎯 iPhone SE (3rd generation) - 2022
• 🟣 iPhone 14 - 2022
• 🌟 iPhone 14 Plus - 2022
• ✨ iPhone 14 Pro - 2022
• 👑 iPhone 14 Pro Max - 2022
• 🔌 iPhone 15 - 2023
• 🌊 iPhone 15 Plus - 2023
• 🛸 iPhone 15 Pro - 2023
• 🏔️ iPhone 15 Pro Max - 2023
• 🤖 iPhone 16 - 2024
• 🌌 iPhone 16 Plus - 2024
• 🔥 iPhone 16 Pro - 2024
• 🐉 iPhone 16 Pro Max - 2024
• 💎 iPhone 16e - 2025
• 🪶 iPhone Air - 2025
• 🎉 iPhone 17 - 2025
• 🌠 iPhone 17 Pro - 2025
• 🏰 iPhone 17 Pro Max - 2025
• 🆕 iPhone 17e - 2026
Which iPhone is your favorite?
English

Read this for cache strategy in detail
devxritesh.medium.com/caching-strate…
English

@devXritesh So the cache is the real hero here, protecting the database from a stampede of requests
English

@SahilExec This regex is a classic ReDoS bomb "a@aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." will nuke your CPU.
English



















