← All posts
EngineeringNovember 2026 · 5 min read

Change the engine mid-flight: moving a live app to a new database without a rewrite.

Groove kept its own data wiring long after it joined our shared framework. Here is how we moved it onto a shared data layer, swapping the database underneath a live app without its screens ever noticing.

S
SiyabongaAuthor
XLinkedIn
Changing the store, not the app

When Groove moved onto E-Core, our shared app framework, it brought its data with it. Not the way we would choose today. The app kept its own wiring to an older database, its own custom code for reading and writing every account, every notification, every feature request. The framework had since grown a cleaner place to keep that data, and our ops console was already using it. Groove was the one left behind, talking to a store that nothing else talked to. This is the story of finishing the move, and of a design decision that made a frightening migration almost boring.

An app should not own its database

The useful idea here is old, and we keep relearning it: a piece of software should depend on what it needs, not on where that thing happens to live. Groove's screens need a user's profile, their notification inbox, the list of feature requests people have voted on. They do not need to know that a profile is a record in one database today and a document in another tomorrow.

So in E-Core, every one of those needs sits behind a small interface we call a provider. A screen asks the user provider for a profile. It never asks a database for anything. That seam, the thin line between "what I need" and "where it is stored", is the whole trick. Behind the user provider there can be an implementation backed by a Realtime Database, or one backed by Firestore, or one backed by an in-memory fake we use in tests. The screen cannot tell them apart, because the only thing it was ever handed was the interface. Swap the implementation and the app keeps running, none the wiser.

A screen asks the user provider for a profile. It never asks a database for anything. That one rule is what let us change the database under a living app without rewriting the app.

What keeping your own wiring actually costs

Groove kept its own data code for a practical reason. When it first joined the framework, rewriting all of that persistence at once was a risk nobody needed to take, so the move was postponed. Postponed is not free. Two costs pile up quietly while you wait.

The first is divergence. Our ops console, the tool the team uses to verify a user, switch on maintenance mode, or send a notice to everyone, already wrote to the newer store. Groove read from the older one. So an action taken in ops reached a dead end: verify a user there, and Groove never heard about it. The two halves of one product had drifted onto different sources of truth, and the gap between them was invisible until someone leaned on it.

The second is duplication. Every bespoke connection Groove wrote was one more thing to maintain, test, and reason about, doing roughly what the framework already did for every other app. That is code you pay rent on forever, in attention if not in money.

Moving a living thing without stopping it

A data migration on a shipped app is not a code change. It is surgery on something that is awake. People are opening the app while you work, saving settings, casting votes, changing their minds. Lose a profile or reset someone's notification preferences and you have not shipped a feature, you have taken something away. So the discipline matters more than the code. A few of the rules we held to:

  • Move one area at a time, smallest first. The pieces nobody will miss go before the account records that everything else leans on. Each move is small enough to verify on its own before the next one begins.
  • Rehearse on a copy, never on the real thing first. Count the records before, count them after, and refuse to proceed until the two numbers agree.
  • Never let a copy overwrite something newer. The console may already have written to the destination. The migration's job is to fill gaps, not to stamp on fresher data.
  • Write and review the access rules before the app reads a single record from the new place. Who may read and change what is not a detail you bolt on afterwards.
  • Convert honestly. Values the old store kept as loose text, a date written as a string, a yes or no stored as a word, become real dates and real booleans on the way across, not a shape that merely looks right.

None of this is glamorous. All of it is the difference between a migration nobody notices and an incident everybody does.

7data areas moved
1shared data layer
0screens rewritten

The best migration is the one nobody can see

When the last area moved across, the measure of success was almost comic in how little happened. Profiles showed the same handles and the same photos. Unread badges held the same counts. A notice sent from the console now actually arrived. Nothing on screen announced that the ground underneath had been replaced, because the seam held, and the seam is the only thing the screens were ever attached to.

What Groove gained is not a feature you can screenshot. It is subtraction. A pile of custom data code is gone, replaced by the layer every other Existence app already shares. The app and the console finally read and write the same truth, so an action in one place lands where a person will see it. And the next time we need to change where this data lives, we will change it in one place, behind the provider, and the apps on top will once again fail to notice.

What we are taking with us

We did not do anything clever here. We did something patient. The cleverness, if there was any, got spent years ago, on the day someone insisted that a screen should ask for a profile and never for a database. That one boundary, held consistently, turned a migration that could have been a month of fear into a sequence of small, checkable steps.

It is a good reminder for the work ahead. The seams you draw early are the moves you get to make cheaply later. Draw them where the pain will be, hold them even when it is tempting to reach straight through to the thing on the other side, and the day you have to swap the engine, you get to do it mid-flight, with the cabin calm and the app none the wiser.

S
SiyabongaWriting for Existence

Notes, as they happen.

One email when we publish. No digest, no drip, just the post.