DAILYSPHERE MEDIA•Today's Briefing
Advertisement
Leaderboard (728×90 / 970×90) — Reserved Ad Space

Moving Airtable’s Android data layer out of a WebView, with a small team and no feature freeze

Advertisement
In-Content (728×90 / 300×250) — Reserved Ad Space

By Steven Meliopoulos and Oren Freiberg

Airtable’s Android app drew almost all of its screens natively, but for eleven years the layers beneath ran in an invisible instance of the web client inside the app.

A native app with a WebView as its data layer

An unusual but effective approach initially made it possible to quickly bring Airtable’s rich functionality to mobile users when our Android app was first created more than ten years ago. The UI layer was almost entirely native, but all the state, logic, and networking were the responsibility of the existing Airtable web client running inside an invisible WebView. Native code called methods of the web client, and the results came back as callbacks through a JavaScript interface.

Eventually, newer functionality was built on top of a more typical fully native architecture, but the WebView remained in place as it was still underpinning much of the older feature set. For all the velocity the original approach had bought before the formation of a dedicated mobile team, several years later the tradeoffs had shifted.

Debugging and code changes often meant doing the work twice, once in the web client and once in the native code, each with its own code base, tech stack, and runtime.

But an even bigger problem was the ceiling the WebView placed on the app’s performance. Before the app could even request the session, it had to load and start the web client, which added seconds to every cold start. And because objects cannot pass the JavaScript interface, all data forwarded to the native code underwent an additional serialization round trip.

The memory impact was elusive yet substantial. The WebView’s renderer runs in its own process. That means the JavaScript engine, the web client, and all the data it holds don’t count toward the native app process’s heap limit, and they don’t show up in the app’s own memory telemetry. But this split didn’t provide any savings either. All application data that reached the user was eventually passed to the native side and held there as a duplicate. On our test device, the renderer process used about as much memory as the main app process. And that footprint still counted toward the device’s memory pressure.

The only way to fix these problems was to stop relying on the WebView. That is why, in 2022, the Android team decided to replace everything the WebView did with native code.

Mapping the work

For any large undertaking, the plan of attack matters at least as much as the engineering. Before diving into coding, we identified and mitigated several organizational risks, most of which stemmed from the project’s sheer size.

We were facing over a hundred individual WebView method calls as well as two complex logic components in need of native replacements. Most of them were powering older but still heavily used features, which required familiarization first. And engineering resources were limited as new feature work had to continue in parallel.

Notably, nearly the entire performance payoff would only materialize at the very end when the WebView could be dropped entirely. Driving the project to completion was crucial because there was no partial credit.

Everyone agreed the WebView had to go, but it was hard to see where to start. Nobody could tell whether a piece that looked small would turn into a rabbit hole, and we had to plan without knowing how much time the project would be allocated.

The team in 2022 had already put valuable groundwork into place, such as live-update handling and a native data layer to migrate to. That push had stalled when other product work took priority. We couldn’t assume we would be any more immune to interruption, so our plan had to at least be resilient.

One piece of preparation was central in addressing these concerns: an initial scoping pass produced a custom Airtable dashboard that broke the overall effort down into small tasks — one for each of the methods — making this daunting endeavor more tractable.

Each task came with a high-level description to facilitate picking a starting point. A rough complexity estimate and an assignee field let anyone pick appropriately sized tasks based on their available bandwidth without coordination overhead. After performing the first batch of migrations, we shared a walkthrough and the best practices we had found with the rest of the team. This ultimately resulted in team members outside the project contributing about a quarter of all method migrations. Later, the same list became the queue for our AI agents.

When other priorities did cause a pause halfway through, the preserved record of the remaining work allowed us to resume seamlessly. And finally, the dashboard’s status charts and complexity estimates continuously communicated progress, which kept morale up and planning accurate.

Small, tiered rollouts for safety and early feedback

The faster we could complete the migration, the sooner our users would get to enjoy the performance benefits. But swapping out an app’s data layer is inherently risky, and our customers rely on Airtable for important work, so stability was always a priority. The challenge was to perform the rollout with the right balance of speed and safety.

Because the live-update component we had inherited from the previous push had been sitting dormant for years, its exact degree of completeness, correctness, and compatibility with the current backend was unknown to us. Activating it would require careful reviewing and re-testing. This motivated us to ship subsequent migrations as continuously as possible to minimize the risk carried by each release, get feedback early, and avoid accumulating more unproven code.

Segmenting the migration into four tiers and employing a combination of different safety mechanisms allowed us to make rollouts as granular as possible and only as coarse as necessary.

Using our dashboard’s complexity estimates, we started with the methods that were low-risk enough to be shipped directly.

In the second tier, we protected the more complex methods with a kill switch. Sharing a single kill switch across this group minimized overhead but would still allow us to quickly revert in case of a defect. The major cost compared to the first tier was having to maintain the old code paths in tandem as a fallback instead of replacing them outright, which also spawned another round of post-rollout cleanup.

Because the remaining methods read and wrote shared state inside the WebView, they could no longer be migrated independently from one another. All of them had to be grouped behind a single feature flag that could only be turned on once all the methods had been re-implemented natively. But because every method that could move on its own went into the first two tiers, this set was as small as possible.

Finally, we split session initialization and WebView instantiation into a separate fourth tier. This further lowered risk via increased granularity but was primarily forced by practical constraints: relying on our existing feature flag system like the previous tiers was not possible at app start because the session initialization itself is what fetches the feature flag values. Since the app already included the Firebase SDK for push notifications, we decided to leverage its remote config functionality as our new pre-session gating mechanism, which other rollouts have since adopted.

This tier also activated the inherited live-update component, after we had audited it against the current backend and fixed the gaps we found. When the WebView is no longer initialized, any method calls on it fail. To guard against accidental feature flag misconfiguration, an additional client-side check forced the previous tier’s feature flag on whenever a session loaded natively. An automatic fallback to the WebView in case of a fatal error made sure the app would remain functional during the rollout even in the worst case.

Turning manual migrations into a coding agent skill

After more than half of the method migrations had been done by hand, we built an AI agent skill to perform a deliberately narrow task: migrate a single WebView method and produce a reviewable pull request. Each migration required understanding behavior across Android, iOS, the web client, the JavaScript interface, and the backend. Writing down that process gave the agent access to decisions and pitfalls we had already worked through.

We started with six representative, reviewed PRs, drawn from dozens of completed manual migrations. From those, we identified five recurring migration patterns and extracted three Kotlin templates: request parameters, HTTP calls, and repository updates. We then separated the skill into a procedural workflow, a detailed reference with safety checks, and links to the example PRs. The workflow told the agent what to do next, and the examples showed what a good result looked like.

We then ran two pilots against the same method, which changed a collaborator’s permissions. After each attempt, we reviewed the generated code and revised the instructions. Repeating the same migration let us check whether the revision addressed the previous failure. Those pilots shaped discovery steps, conditions that required the agent to stop, and verification checks. For example, callers could bypass the usual wrapper, so searching only for wrapper calls missed real usage. The skill had to explicitly cover direct calls and imported methods too. These mistakes were all caught during manual code review or testing.

After subsequent migrations, we asked the agent to reflect on review feedback and testing failures and propose reusable improvements to the skill. A useful update changed what the agent inspected, generated, or verified. When a migration missed JavaScript-side name validation, we added instructions to discover and preserve those rules. Reviewing that skill update revealed five remaining gaps: the searches missed inline validation, the checklist lacked a corresponding requirement, tests did not cover each rule, QA lacked an observable pass criterion, and the failure-behavior guidance was inconsistent. For an invalid name, for example, verification now includes checking that no network request is sent.

We made 13 further meaningful updates after the two initial commits through the subsequent migrations. These included new safeguards, review lessons, and maintenance. This series of steps allowed us to go faster even though the migrations got more complex as we moved on.

Outcome

Today, the migration is complete: the app no longer loads the web client or runs any operations through it, and the payoff has arrived.

App launch now takes about half as long. The median time from launch to the loaded home screen fell from 3.87 seconds through the WebView to 1.88 seconds on the native path, and the improvement is even larger at higher percentiles. Opening a base, which used to include the serialization round trip described above, got faster as well: its median fell from 2.81 to 2.30 seconds.

In production, the app process itself uses about the same memory on both paths, so the saving is in the renderer: on our test device, the app and its WebView renderer together used roughly 30% less memory, a saving of around 200 MB. The renderer did not disappear entirely, because certain screens still use separate but much lighter WebViews.

This is a performance change that our customers can feel but that took years to achieve.

Thanks to colleagues who advanced this work between their other projects, and to earlier engineers whose HTTP client, repositories, and live-update infrastructure provided the foundation that made this migration possible.


Moving Airtable’s Android data layer out of a WebView, with a small team and no feature freeze was originally published in The Airtable Engineering Blog on Medium, where people are continuing the conversation by highlighting and responding to this story.