Ashok Sahoo retweeted
10 things that make APIs expensive:
1. SELECT *
2. N+1 queries
3. Large JSON responses
4. Missing caching
5. Unbounded pagination
6. Repeated DB calls
7. Synchronous processing
8. Excessive logging
9. No connection pooling
10. No rate limiting
Ashok Sahoo retweeted
This code passes every unit test.
Then traffic spikes.
Suddenly, your database melts.
What happened?
Ashok Sahoo retweeted
Production Scenario 🧵
You have 3 read replicas. Replication lag is 2 seconds.
A user updates their profile and immediately refreshes.
They still see the old data.
How would you fix this without disabling read replicas?
Ashok Sahoo retweeted
System Design Question 🧵
Your application uses Redis.
A product price changes.
Some users still see the old price for several minutes.
How do you guarantee cache consistency?
Constraints:
- Millions of requests/day
- Low latency
- No manual cache clears
Ashok Sahoo retweeted
Can you spot the deployment issue?
Everything works in staging.
A rollback is needed after production deployment.
Why can using latest become a problem?
Ashok Sahoo retweeted
Grok 4.5 has surprised me.
I spent almost the entire day coding with it.
⚡ Responses were consistently fast.
📉 Weekly usage: only 4%.
So far, it’s proving to be a very cost-effective coding assistant.
Ashok Sahoo retweeted
Every microservice has a 99.9% uptime.
You chain together 20 of them.
How reliable is the entire request?
Ashok Sahoo retweeted
Your app needs to upload a 2GB video.
Would you send it through your backend API?
Or take a different approach?
Ashok Sahoo retweeted
This code passed code review.
Would you approve it?
Assume two requests hit it simultaneously.
Ashok Sahoo retweeted
When WhatsApp delivers a message to a group with 10,000 members…
Is the sender’s phone actually sending 10,000 copies?
How does that scale?
Ashok Sahoo retweeted
Top 10 database resources I still recommend to working devs:
1) Designing Data-Intensive Applications (Kleppmann). Real tradeoffs: logs vs DBs, replication, consistency.
2) Read the Postgres manual (especially indexes + MVCC). It answers 80% of production questions better than blog posts.
3) Use The Art of PostgreSQL (Dalibo). Practical query tuning with EXPLAIN and real patterns, not theory.
4) SQL Performance Explained (Markus Winand). Indexes, selectivity, and why your WHERE clause order doesn’t matter (but data does).
5) CMU 15-445/645 (Database Systems). Free lectures that explain why engines do what they do: locking, buffer pools, recovery.
6) Martin Fowler on database refactoring + migration patterns. Helps when schemas change weekly and you can’t take downtime.
7) Use, The Internals of PostgreSQL. Great when autovacuum, bloat, or WAL become your on-call problem.
8) Jepsen analyses (Kyle Kingsbury). Consistency failures in the wild; teaches you to distrust happy-path tests.
9) Practice project: build a tiny DB. Append-only log + SSTables + compaction + a simple index. You’ll stop treating storage like magic.
10) Practice project: take a slow query in your app and fix it end-to-end. Add an index, rewrite query, measure p95, watch write cost and bloat.
Ashok Sahoo retweeted
Your Docker image is 1.2GB and takes 4 minutes to build.
It should be 80MB and build in 20 seconds.
Here's how to fix it:
Ashok Sahoo retweeted
Application-level auth
or PostgreSQL Row Level Security?
Which do you prefer for multi-tenant apps?
Ashok Sahoo retweeted
Your API receives 10MB JSON payloads.
Traffic suddenly spikes.
CPU usage explodes before business logic even runs.
What would you redesign first?
Ashok Sahoo retweeted
Database query is fast in staging.
Same query is slow in production.
Schema is identical.
What would you investigate first?
Ashok Sahoo retweeted
Your queue has 2 million pending messages.
Workers process: 1000 msgs/sec
Yet the backlog keeps growing.
Do you:
- add more workers
- optimize processing
- or something else?
Ashok Sahoo retweeted
Most developers run npm install without thinking twice.
Have you ever checked what executes inside
preinstall and postinstall
in package.json?
Ashok Sahoo retweeted
Your API is experiencing 10x traffic spike during peak hours.
Your database connection pool is exhausted.
What's your immediate action plan?
Do you scale horizontally, implement connection pooling, or add a caching layer?







