Scala at Yammer

Earlier this week, a private email I wrote to Donald Fischer and Martin Odersky
was leaked and a surprising amount of controversy ensued. The fact that I
described some of our team’s negative experiences with Scala was misrepresented
by some as constituting an official Yammer position or announcement. It was
not; it was a private email.

This is Yammer’s official position on the subject: our goal at Yammer is to
revolutionize the way modern workers collaborate and we’ll use whatever tools
will allow us to iterate faster on that goal. If Scala is that tool, we’ll use
Scala; if Java is that tool, we’ll use Java; if INTERCAL is that tool, we’ll use
INTERCAL. (We don’t expect to have to use INTERCAL; don’t worry.)

Scala is currently the main language for our high-performance backend services
and in the past two years we’ve solved a number of hard problems using it. We
built a real-time message delivery service which has scaled to hundreds of
thousands of concurrent users. We built a distributed data store for message
feeds which serves tens of thousands of requests per second over terabytes of
data. We built a new search system, including both a distributed data store for
denormalizing business objects into indexable documents and a low-latency query
system for auto-completing the millions of people and group names on Yammer. We
built a specialized server for integrating with Active Directory which streams
staff changes from companies with hundreds of thousands of employees. We built
a service for handling Yammer notifications which handles thousands of
notifications a second with extremely low latency. We built an OAuth token
service which manages gigabytes of cached principal objects and returns results
in single-digit milliseconds.

All of these Scala projects are running in production right now, and we built
them all with a team of seven people.

Along the way, we’ve found some problems with Scala. And Java. And Ruby. And C.
And Javascript. And Objective-C. And Erlang. There isn’t a single piece of
technology we use that our engineers can’t criticize; everything has flaws. For
us, it’s never been a question about whether Scala is perfect–it couldn’t
possibly be–but rather a question about whether or not Scala helps us in our
goal of changing the face of business collaboration. It absolutely has, which is
why we’ve used it for the past two years.

We’ve definitely found some things that Scala is currently not good at, and
that’s what Donald and I were talking about in that email conversation. Scala is
a relatively young language, especially given Martin’s broad vision of
cutting-edge concepts used in a practical, pragmatic, industrial programming
language. Of course it has rough edges. Of course it has flaws. It’s roughly
where Java 1.3 was in Java’s history.

It was precisely those rough edges and my experiences with them that Donald was
asking about. He saw an opportunity to get feedback on Scala’s rough edges, and
I saw an opportunity to get the rough edges we’d found sanded down. If Brian
Goetz were to email me asking about the negative aspects of Java, or Yukihiro
Matsumoto about those of Ruby, I’d have similarly lengthy responses for each of
them. (They haven’t yet, but hope springs eternal.) If Donald had, for whatever
reason, asked about the positive aspects of Scala I could have banged out 2,000
words on that, too. We’d be seeing blog posts titled “Yammer Announces Deep And
Abiding Affection For Scala” or “Yammer Announces It Hates Java”.

Typesafe, throughout this whole mess, has been nothing but awesome. When Donald
heard we were moving some components from Scala to Java he reached out to me,
asking what resources they could provide that might help us or what they could
learn about our experiences which would help them improve Scala in the future.
He and Martin read my giant wall of critical text with surprising grace, asked
clarifying questions, and forwarded it to their engineering team. We’ve been
talking a lot since then, and I’d imagine we’ll be talking a lot in the future.

So here at Yammer, we’re going to get back to work. We’ve got a lot of things
left to build and some exciting new features in the pipeline and none of that
will go any faster if we sit around here arguing about tools.