Databases Were Not Designed For This

This title could be clearer and more informative.Try out Clickbait Shieldfor free (5 uses left this month).

Traditional database architecture rests on five implicit assumptions — deterministic callers, intentional writes, brief connections, loud failures, and schema as a developer contract — that agentic AI systems violate simultaneously. The post walks through each broken assumption with concrete PostgreSQL patterns: role-level statement timeouts, soft deletes with agent identity tracking, append-only event log tables with idempotency keys, dedicated connection pools with PgBouncer in transaction mode, query tagging for observability, agent-readable view layers with descriptive column comments, and least-privilege role-per-agent-type access. The argument is that patterns long treated as optional best practices become load-bearing infrastructure when AI agents replace deterministic human-authored code as the database caller.

15m read timeFrom arpitbhayani.me
Post cover image
Table of contents
Assumption - Deterministic CallerAssumption - Writes are IntentionalAssumption - Connections are BriefAssumption - Bad Queries Fail LoudlyAssumption - Schema is a Contract With EnggScoping Blast RadiusDefensively Designed Data LayerConclusion and Footnote
1 Comment

Sort: