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 8 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.
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.
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.
A practical breakdown of why serverless Next.js apps exhaust PostgreSQL connections, and the three fixes that actually work — singleton clients, transaction-mode pooling, and HTTP drivers.
How to configure HNSW indexes, tune maintenance_work_mem and shared_buffers, and add hybrid search so pgvector holds up under real RAG traffic.
How to stop Stripe webhooks from double-charging users, showing stale subscription status, or racing the frontend redirect in a NestJS and PostgreSQL app.