@alex_verem Strong advice. Local AI is worth exploring, especially for privacy and independence. Keeping the same model weights doesn't always guarantee identical outputs. The inference setup matters too. The real win is having control over your data & less dependence on cloud providers.
Correct tenant context can still carry the wrong tenant.
AsyncLocalStorage propagates values; your app must authorize them.
A synthetic NestJS example shows the boundary. Database isolation is untested.
Read: https://t.co/zKupRtpyFY
Spent 4 years fixing high-scale NestJS in production (multi-tenant context leaks, memory spikes, circular modules).
Distilled the whole playbook into a 15-Point Production Pre-Flight Checklist.
Zero leaks, bulletproof scoping, safe deploys.
Grab it here:
https://t.co/YVojCNJ2xC
NestJS Production Incident:
Default Singleton scope leaked cross-tenant data during concurrent DB queries.
Scope.REQUEST fixed the leak but spiked latency 6x (35ms -> 210ms).
AsyncLocalStorage solved both: zero leaks + 34ms p99.
Full autopsy
https://t.co/fsf2kOTY1d
2 days ago I promised this breakdown:
Why Scope.REQUEST killed our NestJS API under concurrent load — and how AsyncLocalStorage fixed a multi-tenant data leak with zero latency hit.
Full deep dive on Medium -->
https://t.co/fsf2kOTY1d
#nestjs#backend
Before merging to main, run this 10-point checklist.
I packaged 4 years of production incident lessons into a 1-page NestJS Pre-Flight sheet (zero leaks, safe deploys).
100% Free download ($0+):
https://t.co/6wM35uJ4X9
Express is great for weekend hacks. But at scale, unopinionated code becomes technical debt.
After 4 years and millions of production requests, here's why we migrated our backend from Express to NestJS. What broke, and what we learned
https://t.co/xLbuX59ylx
Writing a deep dive on a production incident:
How a singleton service leaked Tenant A's data into Tenant B under load...
And why NestJS `Scope.REQUEST` made latency 5x worse.
Dropping in tomorrow with code snippets & the AsyncLocalStorage fix.
Most NestJS production incidents come down to the same 5 architecture mistakes.
I compiled my battle-tested 15-point scoping, security & testing checklist into a 1-page visual guide.
Audit your backends before deploying 👇
https://t.co/ENgEK6I2j8
@thesaint_dev 100% stays in CI permanently! Once a production bug bites you, that test becomes permanent regression armor so no future refactor or PR reintroduces it.
We tagged it in a concurrency suite that runs on every merge. Never delete incident regression tests!
I let tenant data leak between requests in a multi-tenant NestJS app.
The reason? I used the default singleton scope for my TenantService.
Here are 5 brutal production mistakes I made in 4 years of NestJS (so you don't have to) 👇
https://t.co/2D2s4QrGpa
@thesaint_dev Yes, 100%
We wrote the test first to reproduce the leak before touching the code.
Watching it fail with crossed-over IDs confirmed the exact race condition. Once we added Scope.REQUEST, it went green immediately.
Reproducing it first saved us from blind guessing!
@thesaint_dev We did both! Switched to Scope.REQUEST immediately, and added a Promise.all parallel integration test with 2 tenant headers.
Later, moved tenant state to AsyncLocalStorage (via NestJS CLS) to dodge DI overhead.
Do you run concurrency tests in your CI?
@thesaint_dev Unfortunately, a user reported it via an 11 PM support ticket: "Why am I seeing another company’s invoices?"
Our staging & unit tests were running sequential requests, so everything looked green until concurrent production traffic hit.
I treat state in singletons with paranoia
Hiring: PHP Lead / Architect — Bangalore
Mandatory skills:
→ PHP 8.3
→ API Design
→ Claude Code
→ GCP
→ MySQL
Exp: 4–14 Years | 4 Openings
Drop a DM with your resume and I'll refer you directly. 🙌
RT to help a PHP dev land this! 🔁
#BangaloreJobs
@SrinivasanSS52 The USD 20 is basically a "gym membership for AI" at this point We all pay, we all plan to use it more, and then we Google stuff the old way anyway.