- Why AI-built apps lose data - the preview sandbox is ephemeral by design
- How Supabase, Neon, Firebase, and plain Postgres fit vibe-coded workflows
- A ranked recommendation by where your app is in its life
- A promotion runbook: sandbox to durable persistence in one session
Every AI-built app hits the same moment: the prototype works, someone besides you wants to use it, and the data suddenly needs to stay. The builders' preview environments - brilliant for iteration - are ephemeral by design, and the database decision they deferred becomes yours. Here's how the real options stack up for this specific workflow, where the constraints are unusual: the 'developer' may be prompting rather than coding, schemas change at conversation speed, and durability matters more than throughput. (Disclosure: Swyftstack is our product; its section says plainly where it fits and doesn't.)
What vibe-coded workflows actually need
Survival of regeneration. The app will be rebuilt many times; the database must live outside the blast radius, connected by one env var.
Backups you can actually use. Prompt-driven migrations are one 'drop the old column' away from needing a restore. Daily backups + self-serve restore is the bar.
A database-level safety net. Generated code forgets authorization checks; Row Level Security makes the database refuse cross-user leaks regardless.
Standard interfaces. AI tools are best at the patterns they've seen most: plain PostgreSQL + a connection string beats bespoke SDKs for prompt-reliability.
Stage | Best fit | Why |
|---|---|---|
Prototyping in a builder | Builder default (often Supabase) | Zero setup, fast iteration |
Sharing with real users | Supabase or Neon | Persistent, still low-ops |
Graduated / durable | Plain Postgres (DATABASE_URL) | Portable, predictable, yours |
Non-relational data | Firebase | Document model fits |
Matching the option to where the app is in its life.
Matching the option to where the app is in its life.
Supabase: the default for a reason (in Lovable especially)
Lovable's native integration makes Supabase the path of least resistance: auth, database, and storage wired by the builder itself. That integration is genuinely valuable - take it if you're all-in on Lovable's flow. Go in knowing the free tier's pause behavior, that your RLS/auth becomes Supabase-shaped (fine until you leave; see our export guide), and that the bundle is more platform than most vibe-coded apps end up using.
Neon: previews for your previews
Neon's branching model rhymes beautifully with AI iteration - a database branch per experiment, scale-to-zero for the twenty prototypes you abandoned. v0/Vercel workflows pair with it naturally. The checks: cold starts on woken databases, usage-based billing once something goes always-on, and the branching workflow being a power tool the builder won't drive for you - you'll manage it yourself. (More in our database branching explainer.)
Firebase: when the app was never relational
For mobile-shaped, realtime-heavy AI builds, Firebase's SDKs and offline sync remain excellent - and some builders generate Firebase-flavored code well. The strategic caveat from our BaaS guide applies double here: the document model is a long-term commitment that AI-generated schemas make casually. If your data is obviously relational (users, orders, projects...), prefer SQL and let the AI generate what it's statistically best at.
Swyftstack: boring Postgres for apps that graduated (ours)
Our lane is the post-prototype moment: a real PostgreSQL 16 database provisioned in under a minute, connected to any builder's output by pasting DATABASE_URL, with daily backups and one-click restore included (the feature this workflow needs most), RLS surfaced as a guided console feature, and object storage for uploads on the same flat $19/mo plan. Honest non-fit: we don't provide auth or realtime - pair us with Clerk/Auth.js (the production checklist shows the full assembly). Per-builder wiring guides: Lovable, Bolt, Cursor, v0.
Local SQLite / builder-native storage: fine, labeled correctly
In-sandbox SQLite and builder-native storage are legitimate prototype tools - zero setup, perfect for the idea stage. Label them mentally as 'demo storage': the moment a second human enters, promote the data. The promotion is a prompt away: 'switch persistence to PostgreSQL using DATABASE_URL from env' is a request every major builder and coding agent executes competently.
Ranked recommendations
All-in on Lovable's flow: Supabase via the native integration.
Experiment-heavy, Vercel-centric: Neon.
Graduated prototype, wants durable + simple: Swyftstack (that's the case we built for).
Mobile realtime product: Firebase, with the model commitment understood.
Still ideating: sandbox storage, guilt-free - just export before inviting users.
The promotion runbook: sandbox to durable in one session
Export what exists: most builders can dump current data or at least the schema; even a prototype's test rows are useful for verifying the move.
Provision the durable database and note its connection string - on a platform with daily backups included, since prompt-driven schema changes make restores MORE likely, not less.
Set DATABASE_URL in the builder's environment settings (never paste it into code - it will end up in the client bundle, the classic vibe-coding leak).
Prompt the schema into place: 'apply the existing schema to the new PostgreSQL database via migrations' - and review what it generates before running.
Verify with the two-account test: sign up twice, confirm each account sees only its own data, then enable RLS so that stays true through every future regeneration.
Delete or clearly label the sandbox data source so no code path quietly writes to the old location - split-brain data is the subtle failure mode of half-finished promotions.
Elapsed time in practice: under an hour, most of it the verification steps that matter. The runbook is deliberately builder-agnostic - the same six steps work from Lovable, Bolt, v0-plus-your-API, or a Cursor-built app, because they all reduce to 'point the standard database client at a standard connection string'. That standardization is the quiet reason to prefer plain PostgreSQL at this stage: it's the interface every AI tool speaks natively.
The pattern behind every recommendation above: separate the tool's lifecycle from the data's lifecycle. Builders, frameworks, and even your choice of AI assistant will churn over the next two years - the space is moving that fast. A boring standard database with real backups is the one component designed to outlive all of it, which is why the promotion runbook is worth an hour this week regardless of which builder you love today. For the mistakes that follow AFTER the database is durable - leaked keys, missing auth checks, regeneration spirals - the vibe coding mistakes guide picks up where this one ends.
One more selection pressure worth naming: your database choice shapes what the AI can help you with later. Tools reason best about what they've seen most, and plain PostgreSQL with a standard connection string is the most-documented database setup in their training data - prompts like 'add an index for this slow query' or 'write a migration for this feature' land reliably. Exotic setups make every future prompt a little worse; boring ones compound with the tools' strengths.
AI builders compressed app-writing from months to hours; they didn't compress the consequences of losing user data. Whatever you pick, pick something with backups before the second user shows up.
Frequently asked questions
Why did my AI-built app lose its data?
Preview environments are ephemeral by design: in-browser SQLite, sandbox containers, or trial databases reset on rebuild or expiry. The app was never broken - its storage was temporary. The fix is attaching a persistent external database and setting DATABASE_URL so rebuilds stop mattering.
Do AI app builders force a specific database?
They have defaults, not mandates. Lovable integrates Supabase natively; Bolt provisions its own backend options; v0 pairs naturally with Vercel's marketplace databases; Cursor/Claude Code/Windsurf write whatever code you ask for. All of them can talk to any standard PostgreSQL over a connection string - you just have to ask for it.
What database features matter most for vibe-coded apps?
Durability first (real backups - AI-driven schema changes make restores more likely to be needed, not less), then Row Level Security (generated endpoints forget WHERE clauses; RLS makes that a non-event), then simplicity of connection (one URL beats an SDK the AI half-knows). Raw performance is rarely the issue at this stage.
Should I just use what the builder defaults to?
For the first week, sure - momentum matters. Before real users: check the default's lifecycle rules (does it sleep, expire, or cap?), confirm you can export, and decide deliberately. Defaults optimize for the builder's onboarding, not for your app's second year.