Swift at scale: building the TelemetryDeck analytics service
TelemetryDeck runs its privacy-focused app analytics service, covering over 16 million users a month, on Swift and Vapor in Kubernetes, with Postgres for metadata and Apache Druid for analytics data. Codable gives type-safe JSON parsing and validation. The team moved away from a shared client/server DTO package because API versioning made shared structs brittle, and now keeps DTOs inline in their controllers. Practical lessons include versioning API URLs from day one, leaning on Vapor's queues, migrations and Fluent, setting TTLs on every Redis cache entry, and adding error and performance monitoring with Swift Distributed Tracing, since the database and storage layers, not Swift, are usually the bottleneck.
Related posts
- Client Tracing: Understanding Mobile and Desktop Application Performance at Scale
Slack Engineering mediumAdeptSlack extended its backend distributed tracing to iOS, Android and JavaScript clients so engineers could pinpoint why client actions like channel switches are slow. API calls are broken into queue, HTTP request and parse spans, with trace IDs propagated in HTTP headers to join client and server spans. SQLite access is split into wait, execute and save spans, and a general view-load trace schema covers cache-then-network screens. Slack built its own Swift/Kotlin/JS tracing API instead of OpenTracing because thread-local context breaks on highly concurrent mobile code. The API passes an explicit TraceContext, samples traces (1% of API requests), and flushes open traces when the app is backgrounded.
- How we brought Datadog’s data visualization to iOS: A focus on performance
Datadog Engineering mediumAdeptDatadog built DogGraphs, an internal SwiftUI graphing library constrained to iOS 14 (no Canvas), with a result-builder API that type-checks graph compositions at compile time. Profiling with _printChanges() and Xcode Instruments showed that layers observing a shared EnvironmentObject coordinate system caused twice the expected body evaluations (339 vs 113 for a 113-line chart). Moving coordinate-system reduction into the @resultBuilder via TupleGraphContent fixed that. For charts with thousands of bars, a Batch content type groups shapes by fill and stroke style and draws each group as a single Path, which removes the rendering hangs. The post also explains SwiftUI's diffing order: memcmp for POD views, then Equatable, then reflection.
- How Meta enables de-identified authentication at scale
Meta Engineering mediumAdeptMeta's Anonymous Credential Service (ACS) authenticates clients without user IDs by splitting authentication into token issuance over an authenticated channel and unlinkable token redemption over an anonymous channel, built on VOPRFs and blind signatures with an HMAC over business data keyed by a shared secret. ACS is a multitenant C++ Thrift service on Twine that isolates use cases with per-use-case keys and rotates them routinely. It serves hundreds of thousands of requests per second for WhatsApp's de-identified telemetry. Scaling lessons include configurable credential reuse limits backed by a ZippyDB counter to cut capacity costs, dithering plus a global rate limiter to absorb synchronized nightly client spikes, and self-service onboarding with Android/iOS SDKs so teams need no cryptography expertise.
- Lessons From Building iOS Widgets
Shopify Engineering mediumAdeptShopify rebuilt its iOS analytics widgets natively in SwiftUI rather than React Native, because app extensions have tight memory limits, WidgetKit serializes SwiftUI view hierarchies, and React Native had no official widget support. Each widget fetches data independently through Reportify/ShopifyQL while sharing session tokens with the app. iOS calls getTimeline and getSnapshot several times per update cycle, which caused redundant network calls and a token-refresh race that logged users out. A one-minute per-widget cache keyed on configuration fixed both problems. The post also covers a flexible metric decoder, a size-agnostic SwiftUI layout built on LazyVGrid and an OptionSet of layout options, and why relative timestamps were rejected for lack of customization.
- Sentry's Flutter SDK 10.0: Streaming Traces and More Accurate Crash-Free Rates
Sentry mediumAdeptSentry's Flutter SDK 10.0 switches tracing to a streaming model that sends finished spans in batches instead of waiting for the whole transaction, with `Sentry.startSpan` for custom instrumentation and an opt-out via `SentryTraceLifecycle.static`. Unhandled Flutter errors that don't kill the app no longer mark sessions as crashed (they end as `unhandled`), making crash-free rates more accurate. App startup becomes its own `app.start` root trace on Android and iOS, with an optional extension API. The release also removes the enable flags for logs and metrics, captures Dio failures that have no HTTP response, masks Flutter `SensitiveContent` in Replay, drops profiling and raises minimums to Dart 3.12 and Flutter 3.44, with sampling and filter rules needing review during upgrade.