Context
This is a self-hosted over-the-air (OTA) update system for the white-label React Native apps of an ed-tech company, about 660 school apps. I was the architect and the only implementer.
The problem
Every fix needed a store release for every school app, and that took days.
What I did
I built a Node update server with a registry, delivery and bucketed rollouts, on top of expo-updates in the app.
Updates are code-signed with a Cloud KMS key through an approval-gated build job, so no person holds the signing key. Manifests cannot be signed by hand.
I added a runtime-compatibility id so an update only reaches binaries it can run on, and per-school native rewrites in the build.
Rollout is staged, with an opt-out flag per school. The infrastructure is Terraform, with BigQuery for telemetry and Pub/Sub for publish requests from the app builder.
I ran a device test matrix covering Widevine L3, FairPlay, offline start, crash rollback and tamper rejection, and timed a rollback.
Key decision
I made OTA default-on for every school, with a per-school opt-out. The cost was 0.23 s of added cold start, which I measured and accepted.
In return, a fix can reach every school the same day instead of waiting for a store release.
Result
From first internal release to default-on for every school took 4 days. A rollback reaches devices in about 2 minutes.
Cold start gets 0.23 s slower. In return a fix can reach all schools the same day.
What I learned
I would again build the signing and rollback path before the delivery path.
Stack
- Node.js
- expo-updates
- Cloud KMS
- Terraform
- BigQuery
- Pub/Sub
- React Native
