Facebook just announced that it has released Tornado, the real-time web framework that powers FriendFeed, as open source code. According to Facebook's David Recordon, Tornado is one of the core infrastructure pieces that power FriendFeed's real-time functionality. The framework, according to Recordon, is similar to other Python frameworks like Google's webapp or web.py, but is faster and able to handle more simultaneous traffic than its competitors. On his personal blog, Bret Taylor, one of the co-founders of FriendFeed, explains the technical details behind Tornado in more detail.

Tornado is available under the Apache open source license. A basic demo of Tornado showing the commenting feature is available here.

Developers will now be able to tap into one of the core infrastructure pieces that made FriendFeed tick so well. While other services (like Twitter) tend to have a lot of trouble to scale up when they grow, FriendFeed never ran into these problems and Tornado was surely one of the main reasons why the site managed to stay up and running even when demand spiked during major events.

Here is what developers will get when they implement Tornado according to Bret Taylor:

  • All the basic site building blocks - Tornado comes with built-in support for a lot of the most difficult and tedious aspects of web development, including templates, signed cookies, user authentication, localization, aggressive static file caching, cross-site request forgery protection, and third party authentication like Facebook Connect. You only need to use the features you want, and it is easy to mix and match Tornado with other frameworks.

  • Real-time services - Tornado supports large numbers of concurrent connections. It is easy to write real-time services via long polling or HTTP streaming with Tornado. Every active user of FriendFeed maintains an open connection to FriendFeed's servers.

  • High performance - Tornado is pretty fast relative to most Python web frameworks. We ran some simple load tests against some other popular Python frameworks, and Tornado's baseline throughput was over four times higher than the other frameworks