A bigger context window does not guarantee better retrieval. Needle-in-a-haystack shows many LLMs miss facts buried in the middle of the context, and agent systems can favour tools listed first over better later options. Better structure beats bigger prompts.
#LLMs #AIEngineering #AgentSystems
Posts by Fahim khan
lesson: don't just design for scale. design for recovery. your system should degrade gracefully and have ways to break out of death spirals. (4/4)
fixes: exponential backoff with jitter, circuit breakers, load shedding (reject before you die), backpressure signals. your system needs escape hatches from failure states. (3/4)
the worst part? reducing traffic doesn't help. the backlog is too deep. clients keep timing out and retrying, creating a retry storm. you're stuck until you restart everything. (2/4)
"Why does our service keep crashing even after we reduce the load?"
metastable failure—your system is stuck in a vicious cycle. slow responses → timeouts → retries → more load → even slower. It can't escape on its own. #DistributedSystems (1/4)
(5/5) There's no perfect architecture. Just trade-offs. The goal is finding what works for YOUR context, not following someone else's blueprint blindly.
(4/5) The key insight: when related functionality is scattered across multiple services, changes will ripple everywhere. Things that change together should live together.
(3/5) What kills loose coupling:
- Picking the wrong integration patterns
- Services exposing way too many endpoints
- Chatty services that constantly ping each other
(2/5) Cohesion = stuff inside a service working together. Coupling = dependencies between services.
High cohesion + low coupling = you can actually deploy things independently. Otherwise you just have a distributed monolith.
(1/5) Constantine's Law: "A structure is stable if cohesion is strong and coupling is low"
This 1970s principle is why your microservices are probably harder to maintain than they should be. #Microservices #SoftwareArchitecture
(3/3) It's like Rust's exhaustive matching but for TS. Not perfect, but way better than hunting bugs in logs. Try it next time you write a switch statement!
(2/3) The fix: `${role satisfies never}` in default case. TypeScript immediately errors: "Type 'superadmin' does not satisfy 'never'". Caught at compile time!
(1/3) TypeScript tip that changed how I write switch statements: Use `satisfies never` in your default case to get exhaustive checking 🔥 #TypeScript #CodingTips
The problem: Add "superadmin" to your Role union, forget to handle it in the switch, get "Unknown role" in production logs.
(5/5) Law of Forced Efficiency: there's never enough time for everything, but there's always time for what matters most. Start with your most important task. Eat that frog first.
(4/5) Best question from the book: "What's something only I can do that, if done well, will make a real difference?" If you can't answer it yourself, ask your boss or team. Their answer might surprise you.
(3/5) The "Proper Prior Planning Prevents Poor Performance" principle is so real. We tell ourselves we work better under pressure, but that just leads to mistakes and rework. Plan ahead, add a 20% buffer for surprises.
(2/5) Been rereading "Eat That Frog" and the 7-step system hits different now. Decide what you want → write it down → set deadlines → list what you need → make a plan → take action → do something daily.
(1/5) Real talk: you'll never finish your to-do list. And honestly? That's fine. The trick is focusing on the 20% that actually moves the needle. #Productivity #TimeManagement
How much typescript is too much typescript
#typescript #webdev #react
Unlock cleaner SaaS onboarding with my Deferred Commit Pattern in Node.js + Redis + JWT. Learn how to prevent dirty data and turn abandoned signups into leads: fahim.shonif.com/blogs/deferr... #NodeJS #SaaS #webdev
OCaml’s type inference is wild: the compiler figures out precise, static types for everything, even when you never write a single explicit annotation.
#OCaml #FunctionalProgramming #TypeInference #HindleyMilner #StrongTyping #ProgrammingLanguages #FP
A language that doesn’t affect the way you think about programming is not worth knowing - Alan J. Perlis
#OCaml #FunctionalDesign #computerscience
github.com/M0rfes/OCaml...
AsyncLocalStorage in Node.js transforms context management, ending “parameter drilling” with automatic async context propagation. Streamline request logging, auth, transactions, and more! Read: fahim.shonif.com/blogs/asyncl... #NodeJS #AsyncLocalStorage
Struggling with interrupted downloads in web apps?
I just published a guide on building fully resumable
fahim.shonif.com/blogs/resuma...
#ResumableDownloads #ReactJS #NodeJS #Express #NestJS #TypeScript #WebDev #Frontend #Backend
Streaming is deceptively hard, and two problems always top my list:
2. Correct order of delivery
1. Exactly one delivery
2. Correct order of delivery
Some things never get easier—especially when they get delivered twice but still out of order! 🚚🔄
#StreamingProblems #TechHumor
fahim.shonif.com/blogs/stream...
#golang #javascript #api
One of the key components of designing a distributed system is deciding when the “distributed” part is actually unnecessarily complex.
#SystemDesign #DistributedSystems #SoftwareArchitecture #TechLeadership #EngineeringDecisions #SimplicityMatters #DesignTradeoffs #ComplexityManagement
Which old sayings are true and which are myths? Do snice guys finish last"? Or first? A Do quitters never win? Or is stubbornness the real enemy? Does confidence rule the day? When is itjust delusion?
Which old sayings are true and which are myths?
Do snice guys finish last? Or first?
A quitters never win? Or is stubbornness the real enemy?
Does confidence rule the day? When is it just a delusion?
#LeadershipMyths #SuccessTruths #ConfidenceVsDelusion #CareerWisdom #MindsetMatters #GrowthMindset
MeteorJS walked so Next.js could run.
#webdevelopment #JavaScript #MeteorJS #Nextjs #FullStack #TechEvolution #ReactJS #ModernWeb #SoftwareEngineering #StartupTech #Innovation
const express = require('express'); const app = express(); // Enable built-in ETag handling app.set('etag', 'strong'); app.get('/data', (req, res) => { const responseData = JSON.stringify({ message: 'Hello World' }); res.send(responseData); }); app.listen(3000, () => { console.log('Server running on port 3000'); });
ETag in HTTP empowers smarter caching! By allowing servers to signal resource changes, it prevents redundant downloads and saves bandwidth for both users and providers. Optimize your APIs with ETags for speed and efficiency. #WebDevelopment #HTTP #APIPerformance