Backend Development 6 min read

Migrating Whitepages Services from Ruby to Scala and Akka: Performance Gains and Lessons Learned

Whitepages migrated several high‑traffic services from a Ruby monolith to Scala running on the Akka actor framework, achieving dramatically lower latency and higher throughput while sharing the practical benefits, challenges, and best‑practice insights they discovered during the transition.

Art of Distributed System Architecture Design
Art of Distributed System Architecture Design
Art of Distributed System Architecture Design
Migrating Whitepages Services from Ruby to Scala and Akka: Performance Gains and Lessons Learned

Whitepages, a U.S. company that provides personal and business contact information, serves 50 million unique users per month and handles 35 million searches daily, with its mobile product attracting over 18 million active users each month.

Facing scaling bottlenecks in its Ruby‑based architecture, the engineering team decided to rewrite the most costly components in Scala using the Akka framework, and developers John Nestor and Dragos Manolescu shared their experience.

The legacy Ruby system suffered from high latency, excessive memory and CPU consumption, poor degradation support for upstream services, limited concurrency, thread starvation when blocked on slow upstream calls, and weak connection management and recovery.

Scala was chosen for several reasons:

Elegant combination of functional and object‑oriented programming paradigms.

Static type system with type inference that reduces boilerplate and catches many errors at compile time.

Runs on the JVM, offering fast execution, seamless interoperability with existing Java libraries, and mature tooling.

Actor‑based concurrency model provided by Akka.

Whitepages’ reactive services are built as service‑oriented components communicating via Thrift or HTTP/JSON, with latency and throughput being critical, and they require extensive logging, monitoring, and agile development, testing, build, and deployment pipelines.

After migrating services to Scala and Akka, performance improvements were evident, as shown in the table below:

Service

p50 ms

p99 ms

through RPS/core

DirSvc – Scala

25

300

80

DirSvc – Ruby

140

1200

7

The team started with one backend service, has now migrated four, and has six more in development. The number of Scala developers grew from six to twenty, and further migrations are planned.

Key success factors they identified include:

Concise Scala syntax that boosts developer productivity.

Asynchronous code that improves performance.

Immutable collections and functional programming that reduce bugs.

Strong static type checking that enhances maintainability (though it makes metaprogramming harder).

Improved concurrency capabilities.

Spray’s excellent performance and asynchronous API.

SBT’s flexible build customization (despite a steep learning curve).

Excellent Scala support in IntelliJ IDEA.

Responsive developer support from Typesafe, with quick feedback on complex issues.

Challenges encountered during the migration were:

Poor documentation, especially for SBT, often requiring reading source code of Scala and Akka libraries.

Unstable APIs and large upgrade jumps.

Lack of robust concurrency analysis tools; attempts with Typesafe Console never fully succeeded.

An ecosystem that lags behind Java, with an overwhelming number of choices (e.g., over ten JSON libraries) and variable project quality on GitHub.

Difficulty debugging asynchronous code and actors.

Language and library issues such as type erasure, missing type checks for actors, and hidden complexity in seemingly simple Scala code.

Overall, the team concluded that the benefits of Scala and Akka outweigh the drawbacks, making them well‑suited for building responsive systems.

They also emphasized the importance of skilled developers: experienced Scala engineers are scarce, so Whitepages is both hiring new Scala talent and training existing Ruby developers to transition to Scala.

PerformanceAkkaBackend MigrationRubyScala
Art of Distributed System Architecture Design
Written by

Art of Distributed System Architecture Design

Introductions to large-scale distributed system architectures; insights and knowledge sharing on large-scale internet system architecture; front-end web architecture overviews; practical tips and experiences with PHP, JavaScript, Erlang, C/C++ and other languages in large-scale internet system development.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.