Tuesday, 27 August 2013

Twitter migrating to JVM related coding.

Twitter is one of the top 10 most visited sites on the internet. Unregistered users can read Tweets, and registered users can post them via the Web, SMS, or apps for mobile devices. Part of what makes Twitter attractive is its user-friendly functionality. Hashtags, trending topics, following, @replying, and retweeting all contribute to its ease of use and popularity. Engineers at Twitter admit that while the company has always cared deeply about the quality of its service, delivering on that has been challenging in the face of such explosive growth. Most longtime Twitter users are familiar with the fail whale error message. The whale illustration, created by Chinese-Australian artist Yiying Lu, pops up to inform users that Twitter is over capacity .But service outages on Twitter have been noticeably less frequent since late2010. That’s no coincidence. Benson says that Twitter’s engineers have been doing a lot of thinking about Twitter’s architecture and the challenge of handling so many requests every second. Years of constantly refining their approach have brought them to a solution that uses the JVM to build systems that can handle that load easily by scaling horizontally.“We don’t want to depend upon machines getting taller and taller or the resources in those individual boxes increasing,” Benson says. “We want computers that can handle requests in parallel. The JVM is a managed language runtime that can deal with concurrency in a very efficient way. It can handle these types of workloads. A great deal of our datacenter was dedicated to handling the API traffic of our customers. That can now be managed with far fewer machines on the JVM while delivering huge boosts in performance.”The Twitter team has moved many of the company’s most critical systems to a set of services written in Java and Scala running on the JVM. The service is now a worldwide presence that can capably handle sustained peak levels during major events like the Super Bowl and the US presidential election without an appearance from the fail whale. Users enjoy a very fast system that enables them to get information within seconds about events taking place all over the world. Benson says the migration to the JVM not only delivers performance wins; it also provides something he likes to call observability. “Running a service of this scale, things go wrong all the time, either because of runtime issues or because software is being deployed every hour,” he says. “We want to be sure we understand why those failures happen. With the JVM, it is a lot easier for us to examine those events in a robust way than it was with other runtimes we have used in the past.”Finally, one of the critical factors in moving to the JVM was the Open JDK open source project. “As the guy who needs to think strategically about how my organization can work, not only inside the building but also externally, the open source nature of the JVM is very important to me because we can seethe source on which we’re building the core infrastructure,” Benson says. “We hire engineers to work with that codebase and community to improve the runtime so that we can build faster and more predictable services on top of the JVM. These are the kinds of things that made the choice of migrating to the JVM easy.”

No comments:

Post a Comment