Swift at scale: building the TelemetryDeck analytics service
The decision to go with Swift brought a lot of unexpected advantages for us. We come from a world of iOS in the frontend, Python, Node, or Ruby in the backend for server-based applications. Compared to these languages and frameworks, Swift is just as easy to use, and its compiled nature allows us to catch a lot of possible errors at compile time instead of runtime, making it ideal for a hardened, high-performance web service.
→ swift.org/blog/building-privacy-first-analytics-with-swift/
TelemetryDeck is an analytics service for app developers. It focuses on privacy. It anonymises data and makes tracking easy.
The service handles data from millions of users each month. It helps thousands of app makers improve their products. The backend uses Swift. They chose Swift and the Vapor framework for the server. This choice brought benefits. Swift catches errors at compile time. It performs well with many threads. It handles high loads with low costs.
They store metadata in Postgres and analytics data in Apache Druid. They use Swift tools to connect to these. At first, they picked Swift because they liked it. It led to a fast, stable system. They can develop quickly. Swift's Codable makes JSON handling safe and simple. It rejects bad data right away. This improves security. Development feels good in Xcode. They run tests, debug, and use local databases. This helps new team members start fast.
Lessons include: Structure code with Swift packages. Databases often cause slowdowns, not Swift code. Use Vapor's built-in tools. Version APIs from the start. Set cache timeouts. Monitor errors yourself.
Enjoyed this post?
Well, you could share the post with others, follow me with RSS Feeds and/or send me a comment via email.
Tags
Category:
Tags:
Year: