PostgreSQL on Neon for visits and introductions
Visits and introductions go to serverless PostgreSQL on Neon’s free tier, with Flyway migrations; moving to Cloud SQL is a connection-string change.
Context
Tracking and the admin panel need a small amount of durable, queryable data. The assistant was to keep its logs here too; as built it keeps nothing (ADR 0019), and this record was revised to stop saying otherwise. Cloud SQL costs $10–25/month for an always-on instance; Firestore is free but foreign to a Java/SQL portfolio.
Decision
Serverless PostgreSQL on Neon's free tier (scales to zero), with Flyway migrations and Spring Data. Moving to Cloud SQL later is a connection-string change.
Consequences
- A cold database adds latency to the first write after idle periods; writes from the site are asynchronous.
- Real SQL, migrations and integration tests with Testcontainers — the same stack used in production work.