Ayush Basak
Big Ben, the Houses of Parliament and Westminster Bridge fading into cyan and pale teal mist, with vintage photographic grain.
Ayush Basak

Hi, I’m Ayush.

CTO and systems architect building dependable backend, database, and AI systems.

Every useful lesson becomes an essay, field note, or tool you can reuse.

Recent writing

  1. The Agent Was Interrupted. Should Its Work Disappear?

    Agent swarm concurrency explained through an interactive lab: wound-wait, page-level commits, prefix-safe updates, and the limits of preserving reasoning.

  2. WAL, S3, and Postgres Branching: What AI Agents Can Safely Undo

    How Lakebase-style Postgres separates WAL durability from page storage, and what branching means for agent isolation, cold reads, and recovery.

  3. Reliable Scheduled Jobs: Idempotency, Missed Runs, and Time Zones

    Design scheduled jobs around durable occurrence identities, explicit catch-up rules, time-zone semantics, and recovery from partial business effects.

  4. AI Agent SSRF Prevention: Put URL Fetching Behind an Egress Policy

    Design safe URL-fetching tools for AI agents using constrained destinations, redirect handling, connection-time enforcement, and bounded responses.

  5. Kafka Tombstones: Why a Compacted Topic Can Leave Stale Consumer State

    Understand Kafka tombstone retention, stale materialized views, rebuild boundaries, and the recovery policy needed after a consumer misses a deletion.

  6. Prevent Double Booking with PostgreSQL Exclusion Constraints

    Model booking conflicts with PostgreSQL ranges and exclusion constraints, then handle cancellation, retries, tenant boundaries, and payment failure explicitly.

  7. PostgreSQL work_mem: Budget for Concurrent Queries, Not One Fast Sort

    Tune PostgreSQL work_mem using query plans, concurrent operators, parallel workers, and spill costs without turning a faster report into a memory incident.

  8. Sharded Postgres: Query Locality Is the Architecture Contract

    How to evaluate sharded PostgreSQL: tenant locality, distributed query costs, connection budgets, snapshot guarantees, and failure policies.

  9. USB Explained: Enumeration, Endpoints, Transfers, and What Breaks

    Understand how USB devices become usable: host control, descriptors, endpoints, transfer types, speed limits, and a practical debugging checklist.

  10. Database Credential Rotation: How to Replace Secrets Without Breaking Connection Pools

    A rollout protocol for rotating database credentials across cached secrets, connection pools, workers, rollback windows, and emergency revocation.

All Posts