Engineering Notes & ADRs

Engineering Journals

Detailed technical breakdowns, architectural decision records (ADRs), and production insights behind scalable systems, zero-rent e-commerce, and high-performance full-stack applications.

Featured Architectural Log
Security9 min deep-dive•Nov 6, 2026

Weaponizing Account Lockouts: How a 5-Attempt Security Guard Enabled Permanent Denial-of-Service on Admin Accounts

An in-depth cybersecurity post-mortem on how a pre-verification account lockout rule and user enumeration error leak allowed anonymous attackers to permanently deny store owners and administrators access to their own platform with just 5 HTTP requests every 15 minutes, and how we engineered constant-time verification and 2FA step-up escalation to eliminate it.

Vulnerability Class
Pre-Check Lockout DoS & Enumeration
Attack Complexity
Trivial (5 requests per 15 mins)
Primary Risk
Perpetual Administrative Lockout
Remediation Standard
Constant-Time & 2FA Step-Up Escalation
Read Full Engineering Log
Weaponizing Account Lockouts: How a 5-Attempt Security Guard Enabled Permanent Denial-of-Service on Admin Accounts
SecurityFeatured Case Study
9 min read•Nov 6, 2026

Weaponizing Account Lockouts: How a 5-Attempt Security Guard Enabled Permanent Denial-of-Service on Admin Accounts

An in-depth cybersecurity post-mortem on how a pre-verification account lockout rule and user enumeration error leak allowed anonymous attackers to permanently deny store owners and administrators access to their own platform with just 5 HTTP requests every 15 minutes, and how we engineered constant-time verification and 2FA step-up escalation to eliminate it.

Vulnerability Class:Pre-Check Lockout DoS & Enumeration
Attack Complexity:Trivial (5 requests per 15 mins)
Primary Risk:Perpetual Administrative Lockout
Remediation Standard:Constant-Time & 2FA Step-Up Escalation
#Cybersecurity#Authentication#Denial of Service#User Enumeration#Two-Factor Auth#Indrani Jewellers#Next.js 16#OWASP Top 10#Bcrypt
Read Log
The Zombie Payment Trap: Why Background Crons Must Finalize Captured Payments, Not Just Defer Them
ArchitectureFeatured Case Study
10 min read•Nov 4, 2026

The Zombie Payment Trap: Why Background Crons Must Finalize Captured Payments, Not Just Defer Them

A distributed systems post-mortem on how a stock release reconciliation cron discovered captured payments on the gateway but only incremented a deferral counter and walked away—trapping high-value jewelry orders in an infinite unpaid limbo—and how we engineered a unified, idempotent single-writer settlement engine to achieve guaranteed eventual consistency.

Vulnerability Class:Reconciliation Gap & Deferral Limbo
Primary Hazard:₹2.45L Captured Payment Trapped in Unpaid Hold
Recovery Invariant:100% Automated Multi-Channel Settlement
State Isolation:ACID Idempotent Single-Writer Finalization
#Distributed Systems#Payment Reconciliation#Razorpay#State Machine#Indrani Jewellers#Inventory Locking#MongoDB Transactions#Next.js 16#Reliability Engineering
Read Log
The 38.60-Litre Inventory Black Hole: Why Asymmetric Deletion Handlers Leak Physical Warehouse Stock
DatabaseFeatured Case Study
8 min read•Nov 3, 2026

The 38.60-Litre Inventory Black Hole: Why Asymmetric Deletion Handlers Leak Physical Warehouse Stock

A real-world engineering post-mortem from building a custom FMCG cold-chain distribution app: how a naive 5-line order deletion handler caused 69 physical units (38.60 Litres) of inventory to vanish into a phantom state during warehouse reconciliation, and how we engineered symmetrical lifecycle rollbacks and audit ledgers to fix it.

Vulnerability Class:Asymmetric Entity Lifecycle Deletion
Phantom Deficit:38.60 Litres across 69 Packaged Units
Database Invariant:Atomic MongoDB Multi-Document Rollback
Reconciliation Health:100% Symmetrical Stock Synchronization
#Database State Machines#MongoDB Transactions#Inventory Systems#ACID Atomicity#FMCG Cold-Chain#Next.js 16#Software Reliability
Read Log
The Fail-Open Trap: How Payment Gateway Timeouts and 100-Hop DB Transactions Oversold Diamond Inventory
ArchitectureFeatured Case Study
9 min read•Nov 2, 2026

The Fail-Open Trap: How Payment Gateway Timeouts and 100-Hop DB Transactions Oversold Diamond Inventory

An in-depth post-mortem on how a fail-open catch block and a 100-network-hop MongoDB transaction during gateway outages caused high-value diamond inventory reservations to be prematurely cancelled and oversold, and how we engineered fail-closed invariants and per-order micro-transactions to solve it.

Vulnerability Class:Fail-Open State Transition & Monolithic Lock
Primary Hazard:Oversold ₹1.85L Solitaire Inventory
Batch Latency:Reduced from 14.8s to 320ms
Resiliency Standard:100% Fail-Closed Under Gateway Outage
#Distributed Systems#MongoDB Transactions#Razorpay#Fail-Open Invariant#Inventory Locking#Indrani Jewellers#Next.js 16#Reliability Engineering
Read Log
The Silent Outbox: Why Order Confirmation Emails Disappeared and Were Marked Published
ArchitectureFeatured Case Study
8 min read•Nov 1, 2026

The Silent Outbox: Why Order Confirmation Emails Disappeared and Were Marked Published

When payment settled, the outbox emitted ORDER_CONFIRMED, but the background worker checked for order.confirmed. Because of a case mismatch, the worker silently skipped the email dispatch and marked the event as PUBLISHED. Here is the full post-mortem and architectural fix for [LUMINA] Custom Ecommerce App.

Drop Rate Before Fix:100% of Settled Orders
False Health Signal:0 Error Codes (100% Green)
Root Cause:String Case Mismatch (ORDER_CONFIRMED vs order.confirmed)
Remediation:Typed Event Catalog + DLQ Fallback
#Next.js 16#E-Commerce#Outbox Pattern#Queues#MongoDB Atlas#Distributed Systems#TypeScript#Reliability
Read Log
The Double-Restock Ghost: How Orphaned Inventory Holds Corrupted Stock Counters on Checkout Failure
ArchitectureFeatured Case Study
9 min read•Oct 31, 2026

The Double-Restock Ghost: How Orphaned Inventory Holds Corrupted Stock Counters on Checkout Failure

When multi-item checkout fails halfway through, a naive compensation loop restores item counters but leaves hold documents orphaned. 15 minutes later, the background sweeper treats those holds as expired and restocks the items a second time. The complete post-mortem and transactional fix for [LUMINA] Custom Ecommerce App.

Failure Mode:Double-Restock (+1 Drift)
Trigger:Partial Cart Checkout
Secondary Trap:15m Background Sweeper
Remediation:Atomic Cancellation
#inventory-systems#distributed-locks#race-conditions#mongodb-transactions#ecommerce-engineering#node-js
Read Log
Fixing Phantom 404s: The 2000ms Database Timeout Trap in Next.js Serverless
DatabaseFeatured Case Study
8 min read•Oct 31, 2026

Fixing Phantom 404s: The 2000ms Database Timeout Trap in Next.js Serverless

A deep architectural post-mortem analyzing how an aggressive 2000ms Mongoose connection timeout caused intermittent silent fetch failures during Next.js static builds, and how resilient connection pooling and automated CI safeguards eliminated phantom 404 errors.

Latency Hazard:2000ms Connection Timeout
Failure Mode:Phantom 404 Build Drops
Resilience Fix:15000ms Cold-Start Buffer
CI Verification:100% Automated Schema & XSS Validation
#Database Engineering#MongoDB Atlas#Next.js 16#Serverless Architecture#Performance#Mongoose#Webshastraa#CI/CD Safeguards
Read Log
Distributed Payment Systems: Solving the Razorpay Webhook Race with Atomic MongoDB State Transitions
ArchitectureFeatured Case Study
9 min read•Oct 30, 2026

Distributed Payment Systems: Solving the Razorpay Webhook Race with Atomic MongoDB State Transitions

An in-depth distributed systems case study on how Indrani Jewellers resolved the classic payment gateway race condition where asynchronous server webhooks arrive before the frontend browser redirect, using atomic conditional MongoDB transitions and idempotent reward commits.

Concurrency Hazard:Webhook vs Browser Redirect Race
Primary Risk:Double Fulfillment / Duplicate Rewards
Database Primitive:Atomic findOneAndUpdate
Idempotency Status:100% Mitigated & Verified
#Distributed Systems#Payment Architecture#Razorpay#Race Conditions#MongoDB Atomicity#Idempotency#Indrani Jewellers#Next.js 16
Read Log
Security Case Study: Product Creation Bypassed Admin 2FA in Next.js 16
SecurityFeatured Case Study
8 min read•Oct 30, 2026

Security Case Study: Product Creation Bypassed Admin 2FA in Next.js 16

A complete engineering post-mortem analyzing how an edge proxy matcher gap and controller-level trust assumption allowed direct API product injection without 2FA verification in a luxury e-commerce platform.

Vulnerability Class:CWE-287 / Broken 2FA
CVSS v3.1 Severity:7.5 (High / AV:N)
Evidence Status:Verified (Lab Repro)
Remediation:Zero-Trust Defense
#Security Case Study#Next.js 16#Indrani Jewellers#2FA Bypass#Edge Proxy#OWASP API1#Zero Trust Architecture#CWE-287
Read Log
Open to Contract & Full-Time Roles

Ready to build your next product?

Whether you need a high-scale SaaS platform, a bespoke e-commerce store, or a high-performance web app, I'm ready to collaborate.

© 2026 Ajay Thakkar. Built with Next.js, TypeScript & Tailwind CSS.