The author is a Forbes contributor. The opinions expressed are those of the writer.

Loading ...

Loading ...

This story appears in the {{article.article.magazine.pretty_date}} issue of {{article.article.magazine.pubName}}. Subscribe

Continued from page 2

(Image via CrunchBase)

Twitter experienced record-shattering and long-lasting traffic surges on Election Night this week without so much as a hiccup—let alone a fail whale—and one of the company’s top tech execs said the high-powered performance was due in large part to Twitter’s migration away from Ruby and toward Java.

Noting that on Tuesday night Twitter handled more than 800,000 Tweets in one particular minute and more than 15,000 in one particular second, VP of Infrastructure Operations Engineering Mazen Rawashdeh emphasized the company's "new bottom line" in a blog post that came out the day after the election:

“No matter when, where or how people use Twitter, we need to remain accessible 24/7, around the world,” Rawashdeh wrote.

That’s a profound commitment for the 6-year-old company to make, and it’s also a clear sign that the company recognizes that its days as an intriguing but fairly isolated social-media platform for techy insiders are long, long gone.

News site theregister.com offered this perspective on the Twitter achievement: “In the past, Twitter users might have expected to experience problems when the service is under such heavy load. Early in Twitter's existence, service outages were so common that the company's whimsical 'fail whale' error screen became a cultural icon for the Web 2.0 crowd.”

Whimsical or not, the Twitter fail-whale is now an icon of an adolescence that the company is eager to move past as the service has become a powerhouse medium for not only mega-events like Election Night conversations and debates but also for corporate marketing teams eager to tap into the sentiments of crowds and gain real-time insights and opportunities.

As a consequence, Rawashdeh wrote in his post, Twitter’s infrastructure has had to grow up rapidly as well—and Java’s playing a pivotal role in that:

“Last night’s numbers demonstrate that as Twitter usage patterns change, Twitter the service can remain resilient. Over time, we have been working to build an infrastructure that can withstand an ever-increasing load. For example, we’ve been steadily optimizing the Ruby runtime. And, as part of our ongoing migration away from Ruby, we’ve reconfigured the service so traffic from our mobile clients hits the Java Virtual Machine (JVM) stack, avoiding the Ruby stack altogether.”

What’s interesting about the scale-up and scale-out initiatives Twitter is undertaking is that as short-term traffic spikes are hitting unprecedented new levels—such as the 800,000+ Tweets per minute and 15,000 Tweets per second mentioned above—a parallel trend is that those high points are occurring amid long and more-sustained periods of intense traffic density.

And that phenomenon, Rawashdeh noted, is yet another sign that Twitter fully realizes it needs to settle for nothing short of industrial-strength infrastructure.

“Seeing a sustained peak over the course of an entire event is a change from the way people have previously turned to Twitter during live events,” he wrote.

As a result, according to theregister.com’s article, Java has taken on a much more strategic role within the Twitter tech stack:

Twitter's solution was to migrate some of its Ruby code to a new server stack running on the JVM. Initially, the company's development team avoided stock Java in favor of Scala, an alternative JVM language that combines aspects of object-oriented and functional programming. Today, Twitter's software is built from a mix of Scala and ordinary Java code.

A few Twitter services still run on Ruby, too, but according to Rawashdeh these are used increasingly less often. Notably, he says Twitter has now reconfigured its system so that traffic from mobile devices never touches any Ruby-based software at all.

Where Twitter does use Ruby, it deploys the code on a custom, highly optimized version of the Ruby runtime designed to manage memory more efficiently when executing long-running processes.

Oracle supports more than 9 million Java developers worldwide, and positions Java as “the foundation for virtually every type of networked application” and “the global standard for developing and delivering mobile applications, games, Web-based content, and enterprise software.”

For Twitter, it looks like they’re making the right move at the right time. Because while whimsy’s cool when the subject is how long to steam your asparagus, it’s not an even an option in the mission-critical realms to which Twitter aspires.