Context

The TARS wiki needs metadata persistence — backlinks, project relationships, search indexing, and eventually cross-PAI knowledge sharing. The question was whether to use flat files, SQLite, or a hosted Postgres instance.

Options Considered

OptionProsCons
Flat files onlyZero infrastructure, simpleNo relational queries, backlinks are slow
SQLiteFast, local, no setupNot accessible across machines, no web access
Neon PostgresServerless, accessible everywhere, relationalRequires network, cost at scale
PlanetScale (MySQL)Branching modelMySQL, not standard Postgres

Decision

Neon Postgres — serverless Postgres with generous free tier, auto-suspend when idle, accessible from Cloudflare Workers via Hyperdrive.

Rationale

  1. The wiki needs to be accessible from multiple machines (desktop, laptop, Codespaces). SQLite doesn’t support that.
  2. Neon’s auto-suspend means near-zero cost for a low-traffic personal wiki.
  3. Standard Postgres means I can use any Postgres client (Drizzle, pg, etc.) without learning a vendor-specific API.
  4. Hyperdrive integration means future Cloudflare Worker API endpoints can query it efficiently.

Implementation

Connection string stored in sops: secrets get NEON_DATABASE_URL

Schema defined in ~/cloud/projects/wiki/tools/schema.sql.

Status

active

Database created. Schema not yet applied — pending wiki tool build.

Revisit Triggers

  • If cost exceeds $5/month → evaluate moving to D1 or SQLite + sync
  • If query complexity grows → consider adding Prisma ORM