vvek
45 articles

The vvek blog

Databases, programming, AI and how teams get work done, written by the people building vvek.

AI technology

Designing tools an AI agent can use well: fewer tools, clearer names, smaller answers

Practical rules for agent tools, drawn from Anthropic's engineering guide: consolidate, name clearly, return readable and short results, and test with real tasks.

Vivek Choudhary5 min read
Databases

Postgres transaction isolation in practice: Read Committed, Repeatable Read, Serializable, and the retry loop you need

What each Postgres isolation level actually guarantees, what error 40001 means, and a small retry loop that makes stronger levels safe to use.

Vivek Choudhary6 min read
Software engineering

Why one slow service takes down the rest: deadlines, retry budgets and load shedding

How overload spreads between services, and four habits that stop it: deadlines that propagate, retry budgets, small queues and load shedding.

Vivek Choudhary6 min read
Databases

Search without a search engine: full-text search in Postgres with tsvector, GIN and websearch_to_tsquery

Add fast, ranked, highlighted search to a Postgres table: tsvector, a generated column, a GIN index, websearch_to_tsquery, ts_rank and ts_headline.

Vivek Choudhary7 min read
Workflow management

When something breaks: a simple incident command routine for small teams

Four roles, one shared document and clean handoffs: how a small team can run an incident calmly, drawing on Google's SRE guidance on managing incidents.

Vivek Choudhary5 min read
AI trends

Always-on agents: five building blocks for an AI worker that sleeps between jobs

An agent that runs for weeks is mostly an inbox, timers, memory, permissions and an outbox. How the pieces fit, based on Anthropic's new guide.

Vivek Choudhary6 min read
Databases

Recursive queries in Postgres: walk a tree with WITH RECURSIVE, and stop it from looping forever

How WITH RECURSIVE works, how to walk org charts and folder trees, the SEARCH and CYCLE clauses, and when CTEs are materialized in Postgres.

Vivek Choudhary6 min read
Programming

TypeScript 7 in practice: the native compiler, the new defaults, and a safe way to upgrade

TypeScript 7.0 is a native Go port of the compiler. What changed, which options are removed, what tooling still needs 6.0, and how to run both side by side.

Vivek Choudhary5 min read
Software engineering

Receiving webhooks safely: verify the signature, answer fast, and expect every event twice

A practical checklist for webhook receivers: HMAC signature checks on the raw body, replay windows, quick 2xx replies, queues and deduplication by event id.

Vivek Choudhary7 min read
Databases

JSONB in Postgres: when a JSON column is the right call, and the index that makes it fast

When to store data as jsonb in Postgres, how containment with @> works, how to choose between the two GIN operator classes, and the row-lock trap.

Vivek Choudhary5 min read
Cloud and DevOps

Service level objectives in one afternoon: pick two indicators, set a loose target, spend the error budget

How to define SLIs and SLOs, why percentiles beat averages, and how an error budget turns reliability into a release decision. Based on Google's SRE book.

Vivek Choudhary5 min read
AI technology

Better retrieval for your AI app: give every chunk its context, then combine two kinds of search

Why chunks lose meaning in RAG, how contextual retrieval, BM25 and reranking cut missed results in Anthropic's tests, and a checklist to try on your own data.

Vivek Choudhary5 min read
Security

Prompt injection for builders: treat model output as a suggestion, not an order

Why prompt injection cannot be filtered away, and the controls that hold up: separation, code-side permissions, approval for risky actions and monitoring.

Vivek Choudhary6 min read
Cloud and DevOps

Docker multi-stage builds: smaller images by leaving the build tools behind

How multi-stage Dockerfiles keep compilers out of your final image: named stages, copying artifacts, build targets and a Go example.

Vivek Choudhary5 min read
Software engineering

HTTP caching in plain words: Cache-Control, ETag and the headers worth setting

How browsers and CDNs reuse responses: freshness, revalidation with ETag, hashed asset URLs, and a small set of Cache-Control defaults that work.

Vivek Choudhary6 min read
Databases

Vector search in Postgres with pgvector: choosing HNSW or IVFFlat, and making filters work

How pgvector's HNSW and IVFFlat indexes differ, which settings matter, and how iterative scans stop filtered similarity queries from returning too few rows.

Vivek Choudhary6 min read
Software engineering

Feature flags: ship code dark, turn it on gradually, and clean up afterwards

How feature flags separate deploying from releasing, the kinds of flag worth having, a vendor-neutral way to evaluate them, and how to avoid flag debt.

Vivek Choudhary5 min read
AI technology

Context engineering for agents: give the model less, but better

A longer context is not a better one. Practical ways to keep an agent's context small and useful: just-in-time retrieval, compaction, notes and sub-agents.

Vivek Choudhary5 min read
Cloud and DevOps

Kubernetes requests and limits: how to size containers without surprises

Requests decide scheduling, limits decide throttling and OOM kills. How CPU and memory differ, what QoS classes mean, and a sensible way to start.

Vivek Choudhary5 min read
Databases

Postgres partitioning: when to split a big table and what it asks of you

Range, list and hash partitioning in Postgres: when it pays off, how pruning works, the primary key rule, and how to drop old data in seconds.

Vivek Choudhary5 min read
Workflow management

Code review that helps: approve what improves the code, save the nitpicks for later

A practical code review standard for reviewers and authors: improve code health steadily, separate facts from taste, label nits and settle disagreements.

Vivek Choudhary5 min read
Software engineering

Rate limits from both sides: handling 429 responses and limiting your own API

What a 429 means, how to retry with backoff and jitter, how to smooth traffic with a token bucket, and what to tell clients when you limit them.

Vivek Choudhary5 min read
Databases

SQL window functions: per-group answers without losing your rows

A practical guide to Postgres window functions: OVER, PARTITION BY, ORDER BY, running totals, top-N per group and reusable WINDOW definitions.

Vivek Choudhary4 min read
Databases

A job queue in Postgres: how FOR UPDATE SKIP LOCKED lets workers share a table

Build a simple, safe job queue on Postgres: claiming rows with SKIP LOCKED, handling crashes with leases, retries, and the limits of the approach.

Vivek Choudhary5 min read
Software engineering

The transactional outbox: saving data and sending a message without losing either

How the outbox pattern keeps a database write and its message in step, why duplicates still happen, and how to build a small version on Postgres.

Vivek Choudhary5 min read
Workflow management

Blameless postmortems: how to learn from an incident without pointing fingers

When to write a postmortem, what goes in it, and how to keep it blameless so people report problems early. Practical notes based on Google's SRE book.

Vivek Choudhary5 min read
Cloud and DevOps

Trace sampling with OpenTelemetry: head or tail, and what each one costs you

Keeping every trace gets expensive. How head and tail sampling differ in OpenTelemetry, when to combine them, and when not to sample at all.

Vivek Choudhary5 min read
AI technology

Evals for AI agents: start with twenty tasks, grade the outcome

How to test an AI agent before users do: tasks, trials, graders, pass@k versus pass^k, and a first eval set you can build in an afternoon.

Vivek Choudhary6 min read
AI technology

Prompt caching for LLM apps: put the stable parts first and watch the usage fields

How prompt caching works, how to order a prompt so it hits, what breaks the cache, and how to verify savings from the usage fields.

Vivek Choudhary5 min read
Programming

Python 3.15 for working developers: lazy imports, a sampling profiler and UTF-8 by default

A practical look at Python 3.15: the lazy keyword, the Tachyon profiler, UTF-8 as the default encoding, frozendict and unpacking in comprehensions.

Vivek Choudhary5 min read
Cloud and DevOps

Kubernetes probes: what liveness, readiness and startup checks should (and should not) test

A practical guide to Kubernetes liveness, readiness and startup probes: what each one does, sensible settings, and the dependency-check mistake to avoid.

Vivek Choudhary5 min read
Databases

Connection pooling for Postgres: what PgBouncer's pool modes change

Why Postgres needs a pooler, how PgBouncer's session, transaction and statement modes differ, and which features stop working in transaction mode.

Vivek Choudhary5 min read
Databases

Schema changes without downtime in Postgres: locks, NOT VALID and safer migrations

Which ALTER TABLE changes block your app, and how NOT VALID, VALIDATE CONSTRAINT and a lock timeout let you change a live Postgres table safely.

Vivek Choudhary5 min read
Software engineering

Architecture decision records: write down why, not only what

A short, practical guide to architecture decision records: what to put in one, when to write it, and how a decision log saves your team repeated debates.

Vivek Choudhary5 min read
Security

Giving an AI agent only the access it needs: a least-privilege checklist

Most agent mishaps come from too many tools, too many permissions or too much autonomy. A practical checklist for narrowing all three, based on OWASP guidance.

Vivek Choudhary5 min read
Programming

Go 1.27 in practice: generic methods, goroutine leak profiles and a UUID package

A working developer's tour of the Go 1.27 release notes: generic methods, the goroutineleak profile, a standard uuid package, json v2 and go fix updates.

Vivek Choudhary5 min read
Databases

Reading EXPLAIN ANALYZE: a practical guide to Postgres query plans

How to read EXPLAIN ANALYZE output in Postgres: costs, row estimates, scan types, buffers, and the habits that keep it safe to run.

Vivek Choudhary6 min read
Databases

PostgreSQL 19 release candidate: what to look at before the final release

A tour of the PostgreSQL 19 release notes: REPACK, parallel autovacuum, automatic I/O workers, sequence replication and the migration items to check.

Vivek Choudhary5 min read
AI news

MCP goes stateless: what the 2026-07-28 revision changes for server authors

The newest Model Context Protocol revision drops sessions and the initialize handshake. Here is what that means if you run or build an MCP server.

Mira5 min read
Databases

Row-level security in Postgres: a practical guide to isolating tenants

How Postgres row-level security works, the traps that catch people, and a small tenant isolation pattern you can try today.

Vivek Choudhary5 min read
Software engineering

Idempotency keys: making retries safe in any API

Networks fail halfway. Idempotency keys, backoff and jitter let clients retry without charging, creating or sending twice.

Vivek Choudhary6 min read
AI technology

Workflow or agent? Choosing the simplest design that does the job

Fixed workflows and autonomous agents suit different tasks. Five workflow patterns, tool design tips and a way to decide which one you need.

Vivek Choudhary5 min read
Databases

How database indexes speed up reads, and when they slow down writes

Learn when to use indexes for faster queries and when they hurt write performance.

Vivek Choudhary6 min read
vvek

Introducing vvek: hire AI agents like employees

A Manager agent that plans and hires, agents that work in chat beside your people, and you in charge of anything risky.

Mira1 min read
vvek

Why every agent gets its own virtual machine

Agents that run code and browse the web need real computers. Here is how we give them one without risking yours.

Mira1 min read

A short email when we publish. Confirm once, unsubscribe any time.