Need advice about which tool to choose?Ask the StackShare community!


+ 1

+ 1
Add tool

AIOHTTP vs Tornado: What are the differences?


In this article, we will discuss the key differences between AIOHTTP and Tornado, which are both popular Python web frameworks. By understanding these differences, developers can choose the framework that best suits their needs and requirements.

  1. Concurrency Model: AIOHTTP is built on top of asyncio, which is a library for asynchronous programming in Python. It utilizes coroutines and event loops to achieve high concurrency, allowing multiple tasks to be executed concurrently. On the other hand, Tornado follows a traditional "single-threaded with event loop" model, where it uses non-blocking I/O to handle multiple connections simultaneously.

  2. Performance: Due to its asynchronous nature, AIOHTTP can handle a large number of concurrent connections efficiently. It is well-suited for applications that require high performance and scalability. Tornado also offers good performance but is more suitable for applications that require long-lived connections or streaming data.

  3. Ease of Use: AIOHTTP provides a simple and intuitive API for building web applications. It supports both server-side and client-side programming, making it versatile for various use cases. Tornado, on the other hand, has a more complex API and requires a thorough understanding of its asynchronous nature. It may have a steeper learning curve for developers who are new to asynchronous programming.

  4. Middleware and Plugins: AIOHTTP has a middleware system that allows developers to add custom logic to the request/response processing pipeline. It also has a variety of plugins available for easy integration with third-party services. Tornado, on the other hand, follows a different approach by using Mixins and Decorators to add functionality to request handlers.

  5. Community and Ecosystem: AIOHTTP has gained popularity in recent years and has a growing community of developers. It has an active ecosystem with numerous libraries and tools available for various use cases. Tornado, on the other hand, has been around for a longer time and has a mature ecosystem with a wide range of community-contributed modules and libraries.

  6. Compatibility: AIOHTTP is a pure Python library and can run on various platforms and Python versions. It supports Python 3.6 and above. Tornado, on the other hand, also supports Python 3.x versions but has limited compatibility with Python 2.x.

In summary, AIOHTTP and Tornado are both powerful web frameworks with different approaches to handling concurrency and asynchronous programming. AIOHTTP is well-suited for applications that require high performance and scalability, while Tornado is more suitable for long-lived connections and streaming data. Developers should consider their specific requirements and skillset when choosing between these frameworks.

Get Advice from developers at your company using StackShare Enterprise. Sign up for StackShare Enterprise.
Learn More
Pros of Tornado
    Be the first to leave a pro
    • 37
      Open source
    • 31
      So fast
    • 27
      Great for microservices architecture
    • 20
    • 17
    • 14
    • 11
    • 7
    • 3
      Handles well persistent connexions

    Sign up to add or upvote prosMake informed product decisions

    Cons of AIOHTTP
    Cons of Tornado
      Be the first to leave a con
      • 2
        Event loop is complicated

      Sign up to add or upvote consMake informed product decisions

      What is AIOHTTP?

      It is an Async http client/server framework. It supports both client and server Web-Sockets out-of-the-box and avoids Callback. It provides Web-server with middlewares and pluggable routing.

      What is Tornado?

      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.

      Need advice about which tool to choose?Ask the StackShare community!

      Jobs that mention AIOHTTP and Tornado as a desired skillset
      What companies use AIOHTTP?
      What companies use Tornado?
      See which teams inside your own company are using AIOHTTP or Tornado.
      Sign up for StackShare EnterpriseLearn More

      Sign up to get full access to all the companiesMake informed product decisions

      What tools integrate with AIOHTTP?
      What tools integrate with Tornado?

      Sign up to get full access to all the tool integrationsMake informed product decisions

      Blog Posts

      What are some alternatives to AIOHTTP and Tornado?
      GraphQL is a data query language and runtime designed and used at Facebook to request and deliver data to mobile and web apps since 2012.
      Sanic is a Flask-like Python 3.5+ web server that's written to go fast. It's based on the work done by the amazing folks at magicstack. On top of being Flask-like, Sanic supports async request handlers.
      Flask is intended for getting started very quickly and was developed with best intentions in mind.
      Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.
      This module provides infrastructure for writing single-threaded concurrent code using coroutines, multiplexing I/O access over sockets and other resources, running network clients and servers, and other related primitives.
      See all alternatives