About

Welcome to Panela, Matt Harrison's take on mostly Open Source, Linux, Python, innovation in those areas, other buzzwords and Dick Proenneke. It comes complete with the illustrations as needed. Note the opinions expressed here are merely my opinions and not the opinions of my employer.

about Matt

Calendar

««Nov 2009»»
SMTWTFS
1234567
8910
11
12
1314
151617
18
192021
22232425262728
2930

Mailing List

My RSS Feeds








Tornado: Another Python web framework

posted 2009.09.10 Thu

It's cool that Facebook is open sourcing a Python webframework as part of the FriendFeed acquisition. I've blogged about the ease of developing a web framework in Python before. (Apparently FriendFeed (coming from the Google world) liked Python but not the Googly/Guido/AppEngine Django stuff enough to continue with Django). Tornado is an part of an effort to open source some Facebook technologies (ala Cassandra?).

What does Tornado buy you that isn't already available in the many Python frameworks? The main feature is asynchronous, non-blocking support. Why not just use Twisted? According to co-founder Bret Taylor, they tried Twisted, but "Twisted is very chaotic (see http://twistedmatrix.com/trac/wiki/WebDevelopme... - even they acknowledge this). In general, it seems like Twisted is full of demo-quality stuff, but most of the protocols have tons of bugs." The Tornado docs claim 4X performance increases over standard (blocking) servers on quad cpu machines (lacking any Twisted benchmarks).

I haven't messed with Tornado, just reviewed the documentation. Looks pretty straightforward, similar to Pylons in that it has no ORM builtin. There also seems to be much attention placed on security, with easy support for secure cookies and XSRF. Also the auth mechanism seems to be well thought out with support for Google, Facebook, Yahoo, Twitter. All of these features are somewhat obvious considering the roots in social networking.

In short it looks like a great start. Also it's good to know that it has been around that block in that it's been driving FriendFeed. Hopefully this will kick WSGI 2 to have some support for asynchronous servers. If you are looking for non-blocking support in Python it looks like Tornado should be a top contender.

tags:            

links: digg this    del.icio.us    reddit




1. Graham Dumpleton left...
2009.09.11 Fri 1:10 am :: http://blog.dscpl.com.au

WSGI is in practice only suitable for blocking, threaded or multiprocess web server implementations. WSGI 2.0 is not going to change that. People should stop hoping that WSGI will somehow magically be made to work on single threaded event driven systems and should come up with a distinct purpose built, but standardised, API for event driven systems for Python instead.