Optimistic vs Pessimistic Locking in NestJS: Pick One, Not Both
A practical breakdown of optimistic versioning and SELECT FOR UPDATE in NestJS and PostgreSQL, with real code and a clear recommendation for wallets, inventory, and reservations.
Showing 12 articles
A practical breakdown of optimistic versioning and SELECT FOR UPDATE in NestJS and PostgreSQL, with real code and a clear recommendation for wallets, inventory, and reservations.
Fix "no signatures found matching the expected signature for payload" in NestJS. Configure raw body capture for Express and Fastify to verify Stripe webhooks.
Safely execute PostgreSQL schema migrations in NestJS without locking production tables. Master concurrent index builds and expand-and-contract renames.
A production dunning architecture for NestJS SaaS apps — grace periods, 3D Secure recovery emails, and webhook-driven state sync that recovers most failed subscription payments.
A NestJS architecture for Stripe subscription dunning that syncs Postgres state, handles 3D Secure retries, and recovers failed payments instead of just canceling users.
Most MongoDB aggregation slowdowns in NestJS come from stage order, not missing indexes. Here's how to fix $lookup memory spikes and force IXSCAN.
A two-tier memory pattern for NestJS AI agents — Redis for the last few turns, pgvector for permanent facts — with the code, the tradeoffs, and where it breaks.
How to buffer usage events with Redis Streams and report them to Stripe without hitting 429s or double-charging customers, using a NestJS batch worker and deterministic idempotency keys.
A field guide to diagnosing V8 memory leaks and event loop lag in high-throughput NestJS APIs — measuring lag with perf_hooks, killing RxJS subscription leaks, and offloading CPU work to worker threads.
How to wire Stripe's Payment Element into a React app so 3D Secure, Apple Pay, and Google Pay don't leave you with orphaned orders or duplicate charges.
Change Streams look production-ready in a demo and fall apart on deploy day. Here's how to persist resume tokens, batch under load, and survive replica set elections in NestJS.
How to stop Stripe webhooks from double-charging users, showing stale subscription status, or racing the frontend redirect in a NestJS and PostgreSQL app.