Compare CherryPy and Tornado

CherryPy allows developers to build web applications in much the same way they would build any other object-oriented Python program. CherryPy has built-in tools for sessions, static files, cookies, file uploads, caching, encoding, authorization, compression, and many more.

Tornado is a Python web framework and asynchronous networking library developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user. It is great for use cases that are I/O intensive (e.g., proxies) but not ideal for compute-intensive use cases.

Let's see how CherryPy and Tornado compare on various factors and features and which to choose when.

CherryPy

Tornado

Overall

Type

Type
A minimalist, object-oriented and popular web framework for Python.
Type
Python web framework and asynchronous networking library, which does non-blocking I/O.

Author

Author

Release Date

Release Date
2002
Release Date
2009

License

License
License

Website

Website
Adoption and Ease of Use

Popularity [?]

Popularity [?]
1 Star
Used by 6,600 projects.
Popularity [?]
5 Stars
Used by 145,000 projects.

Used by

Used by
Used in production services at Netflix and Hulu
Used by
FriendFeed, Turntable.fm, Fantamaster.it

Jobs [?]

Jobs [?]
0.5 Star
16 job openings which list CherryPy in the job description.
Jobs [?]
2.5 Stars
300 job openings which list Tornado as a requirement.

Performance [?]

Performance [?]
5 Stars
Very fast. Extensions could impact performance adversely.
Performance [?]
5 Stars
Excellent performance.

Flexibility

Flexibility
5 Stars
Very flexible and simple. Doesn't force anything on developers.
Flexibility
5 Stars
Tornado is simple and flexible.

Ease of Learning

Ease of Learning
5 Stars
Straightforward and easy to learn. Being around for almost 20 years, it has a good amount of tutorials online.
Ease of Learning
4 Stars
Tornado is not difficult to learn if the user is familiar with asynchronous and non-blocking I/O. The online resources, courses, and tutorials are not as plentiful compared to Flask or Django.
Database Support

RDBMS Support

RDBMS Support
Through Plugins or Extensions
Through Plugins or Extensions
No built-in ORM framework. Leaves it up to developers to choose their own such as SQLAlchemy.
RDBMS Support
Through Plugins or Extensions
Through Plugins or Extensions
Being an asynchronous framework, Tornado doesn't play well with ORM frameworks. See this stackoverflow answer for more details. It doesn't come with a built-in ORM framework, but 3rd party libraries that can be used. Such as tornado-sqlalchemy, Tornado-MySQL (experimental), etc.

NoSQL Support

NoSQL Support
No built-in support for NoSQL databases but developers can use libraries to talk to MongoDB, DynamoDB etc.
NoSQL Support
No built-in support for NoSQL databases, but 3rd party libraries support asynchronous, non-blocking access. Motor is one such library from the makers of MongoDB. However, a lot of client libraries like DynamoDB appear to have been deprecated or not actively maintained.
Web & Core Features

Admin Dashboard

Admin Dashboard
Through Plugins or Extensions
Through Plugins or Extensions
No built-in admin panel.
Admin Dashboard
No or Limited Support
No or Limited Support
No built-in admin panel. No well-known 3rd party tools either.

REST Support

REST Support
No built-in support but can be implemented easily. Read this guide to implement.
REST Support
No built-in support for REST API, but users can implement REST APIs manually.

Security

Security
No built-in protection. Must be handled by developers themselves or by using 3rd party extensions.
Security
Built-in security mechanisms such as secure cookies, XSRF, DNS Rebinding and etc. Has been used in production for many years so security is generally decent.

Templating Library

Templating Library
Doesn't come with a built-in templating language or package. Developers can use Jinja2, Mako. See full list here
Templating Library
Tornado uses custom templating library out of the box.

Web Forms

Web Forms
No built-in support. Developers can use formencode or any other solution.
Web Forms
No built-in support.

Authentication

Authentication
Built-in implementation of HTTP Basic Access Authentication.
Authentication
Provides user authentication and also supports 3rd party authentication and authorization systems like Google, Twitter, Facebook, etc.

Testing

Testing
Using WebTest and Nose.
Testing
Built-in support using Python's unittest framework.

If you found this useful, please help us grow by sharing this article with your followers using the sharing icons. Every share or call out will help. Thank you.

Similar Comparisons

Speak Your Mind