Recently I stopped creating new managed backend projects. Per-project pricing did not fit how a studio works, and I had a cheaper place to put them.
That decision is easy to misread as a complaint about the platform, so let me give the context first. Bundled backend platforms are good products. The popular ones put Postgres, an auth server, an auto-generated REST API, storage and functions behind one dashboard and one set of SDKs, and the best of them are mostly open source. That last part is the only reason my exit was possible in days instead of weeks. If you are a team with one product and real users, the managed version is probably a bargain, and I would tell you to keep paying for it.
I am not that team. I run a small software studio, and the studio's output is projects. That changes the arithmetic completely.
The bill was shaped wrong for a studio
Most managed backend platforms bill per project. On a paid tier, every new backend starts costing money from the day you create it, before it has a single user. For a company with one product that is invisible. For a studio it is the whole problem. I had several projects at very different stages, and per-project pricing charges them all the same from day zero.
The saving was a by-product. On its own I would not have done the work for it. What I could not accept was the marginal cost: a studio that wants to start a lot of small things cannot pay rent on each one from day zero. The goal I wrote down for the migration was that a new project backend should cost approximately nothing.
And I already had self-hosted capacity. Capacity was not the constraint. Habit was.
Where the lock-in actually lives
Before choosing anything, I audited what each app actually depended on. The answer was more interesting than the vendor's name.
The data was never locked in. It is plain Postgres, and pg_dump moves it anywhere. The real coupling sat in three places.
First, the contract between client and server: an HTTP path layout (on a Supabase-style stack that means /auth/v1, /rest/v1, /functions/v1, /storage/v1) and a JWT whose sub claim feeds the row-level security policies through auth.uid(). In my case that was over a hundred policies, all of them written against that one function.
Second, the client SDKs that talk to those paths. They are convenient because they hide the contract, so most teams never look at it.
Third, the platform-only extras: a secrets store inside the database, extensions that let cron call functions over the network, webhooks and bucket policies configured in the dashboard. These are the parts nobody lists when they estimate a migration.
That first point matters most. An app that talks raw HTTP to those paths, with no SDK at all, would not notice the difference if the same contract were served from somewhere else. Keep the contract and the applications cannot tell they moved.
I compared three options. Self-host the open-source pieces of the stack. Rip everything out and write my own API and sign-in, which meant rewriting every one of those policies into application code over several weeks. Or move straight to a managed cloud Postgres, which costs money now and still needs one of the other two on top, because a bare database does not issue tokens or serve a REST API. I picked the first, with conditions.
What I run now
A self-hosted Postgres with the open-source auth and REST components in front of it, and a database per app. Each customer-facing app gets its own auth and REST pair, plus a realtime layer only when the app genuinely needs one. Because the paths and token shape match, the existing SDKs keep working unchanged. User ids, password hashes and every one of those policies carried over as they were.
Internal tools are different. They do not need a customer sign-up flow, so internal tools sign in through a separate identity provider instead of the customer auth server. The REST layer validates that provider's tokens instead, and the apps' data calls barely changed. Keeping staff and customer identity apart is worth doing anyway: a bug in customer sign-up cannot become a way into your back office.
Every cutover had the same gate: a parity diff between the old project and the new database had to come back at zero lines. Table counts, policies, RLS flags, function bodies, grants, user ids and their password hashes, content hashes per table, storage objects. If the diff printed anything, the cutover did not happen. Every one came back empty, verified by a script rather than by me.
The four portability rules
Self-hosting the stack would have been a lateral move if I had copied its habits along with its components. So the migration came with four rules whose whole purpose is to keep a managed cloud Postgres one connection string away.
The database never makes HTTP calls. No pg_net, no cron job inside Postgres that invokes a function over the network. Scheduled work runs as plain timers outside the database. A sync job that used to be a database-triggered function is now a plain timer, and its failures show up next to every other job's. A database that makes outbound calls is a database you cannot move without re-plumbing its side effects, and managed providers differ a lot in which extensions they allow.
Secrets live in a real secrets manager. Not in the database's own secrets extension. Application secrets go to a dedicated secrets manager that the apps read at start-up. Secrets stored inside the database travel with the database, which sounds convenient until you look at what a restore actually brings back. Secrets stored in a database's secrets extension are often not in a plain dump at all, because the encryption key lives with the provider, not in your tables. Your backup looks complete and is not.
No dashboard-only config. Webhooks, bucket policies and triggers are committed code. If a setting exists only because someone clicked it in a web console, it will not survive a migration, and nobody will remember it exists until production behaves differently. The test is simple: could you rebuild the project from the repository and a dump alone? Anything that fails that test is a liability, whether or not you ever plan to move.
Files go to S3-compatible storage through a thin wrapper. Storage speaks the S3 API, and the rule is that apps reach it through a small layer of their own rather than coupling to one vendor's storage SDK. It is a few functions: put, get, delete, signed URL. Swapping the backing store for a hosted bucket later should be configuration, not a rewrite.
Put together, the remaining surface is Postgres plus an auth server plus a REST layer, and optionally realtime. The open-source auth and REST components run against any Postgres. That is what "one connection string away" means in practice: the day a product justifies a managed database, I point the same components at it and the application code does not change.
There is a fifth line, and it is a spending rule rather than a portability rule. Managed cloud Postgres happens when a product justifies it, and not before. Without it written down, the decision gets relitigated every time a provider ships a nice feature.
What it costs
Self-hosting is not free. You own patching, upgrades, monitoring and the 3 a.m. question of whether the disk is full. A managed provider sells you exactly those things, and for a team with paying users and no ops appetite they are worth the money. What I changed was not "managed is bad". It was "managed is a decision per product, made when the product earns it", instead of a default tax on every experiment.
The rules cost something too: a wrapper to maintain, timers to monitor, config to write down instead of click. Each cost is smaller than the coupling it removes, but a team that will never move should weigh them honestly.
Prove the dump restores
The single habit that matters most in any migration like this is boring. Before you touch anything, take full dumps of every project, auth schema included, into storage that is itself backed up. Then restore one into a scratch database and diff it against the source. Until that diff comes back clean, you do not have a backup, you have a file.
Keep the old projects alive until the new ones have run for a while and a restore drill has passed. Deleting the old side early is the step that turns a reversible migration into an irreversible one, and it is always tempting, because the bill keeps arriving.
And look at what the dump does not contain. Edits made after the last dump are gone if you need it. Secrets in the database's secrets extension may not be there at all. That is the secrets rule seen from the other side: a secret that lives inside a proprietary extension is a secret your backups quietly do not contain. You want to discover that during a drill, not during a restore.
How to keep the exit open
You do not need to leave a managed provider to benefit from this. The rules are worth applying while you stay.
Start by finding where your lock-in really lives. Run a dump of your database and check what it does not contain. If your secrets, cron jobs, webhooks or storage permissions are missing from that file and from your repository, that list is your actual vendor dependency, and it is usually much shorter than people assume and much more dangerous than they assume.
Then move those items one at a time into places you control: scheduled work out of the database, secrets into a secrets manager, console settings into committed code, file access behind a thin wrapper. Each one is a small change you can make on a Tuesday afternoon.
And write the gate down before the first cutover. Mine was a parity diff of zero lines, checked by a script rather than by anyone's confidence. When agents do migration work, a mechanical gate is what lets you hand it off safely. The agent does not get to decide the migration worked; the diff does.
The migration is not finished, but the direction no longer depends on me remembering why. The provider you are on today may be the right one for years. The point is to make staying a choice you keep making, rather than a cost you can no longer avoid.