- Apple's Password Monitoring Service Migration: Apple moved its global Password Monitoring service from Java to Swift. This led to a 40% increase in throughput and a significant reduction in memory usage, freeing up nearly 50% of Kubernetes capacity.
- Details in the Recent Post: Engineers detailed how the rewrite helped the service scale to billions of requests daily while improving responsiveness and maintainability. Lower memory overhead, improved startup time, and simplified concurrency were key reasons for choosing Swift over JVM optimization. Swift allowed for smaller, more expressive code with 85% reduction in lines of code while prioritizing safety and efficiency.
- Service Responsibilities: The Password Monitoring service is part of the Password app ecosystem and is responsible for securely checking if user's saved credentials have been in data breaches without revealing private info. It handles billions of requests daily using privacy-preserving protocols.
- Previous Java Implementation Issues: The previous Java implementation struggled to meet the service's growing performance and scalability needs. Garbage collection caused unpredictable pause times, degrading latency consistency. Startup overhead from JVM initialization and JIT compilation slowed real-time scaling. The service's large memory footprint reduced infrastructure efficiency and raised costs.
- Swift's Advantages: Swift's deterministic memory management based on reference counting eliminated latency spikes from GC pauses. It also improved startup times without JVM initialization overhead or JIT warm-up, supporting global autoscaling. After tuning, Swift had sub-millisecond 99.9th percentile latencies and consumed only hundreds of megabytes compared to tens of gigabytes with Java.
- Broader Trend: This migration reflects a trend towards performance-oriented languages for large-scale services. Meta has a long history with Rust, Netflix introduced a high-performance Go proxy, and AWS increasingly relies on Rust for services with deterministic performance and low resource usage. While Java and similar languages aren't declining, at the highest performance requirements, some are finding general-purpose runtimes insufficient.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。