Introduction to Tornado
Modern Web Applications with Python
Publisher: O'Reilly Media
Final Release Date: March 2012
Pages: 138

Walk through the basics of Tornado, the high-performance web server known for its speed, simplicity, and scalability on projects large and small. With this hands-on guide, you’ll learn how to use Tornado’s acclaimed features by working with several example applications. You also get best practices for using Tornado in the real world.

Are you interested in creating a scalable social application, real-time analytics engine, or RESTful API—all with the power and simplicity of Python? This book shows you why Tornado is fantastic choice for writing powerful applications that are simple to create, extend, and deploy.

  • Learn how to use Tornado’s lightweight and flexible templating language
  • Extend templates to repurpose headers, footers, layout grids, and other content
  • Use persistent storage like MongoDB to store, serve, and edit dynamic content
  • Explore Tornado’s ability to make asynchronous web requests
  • Secure your application against cookie and request vulnerabilities
  • Authenticate with external services, using Tornado’s auth module
  • Adopt deployment strategies that help harden your application and increase request throughput
Table of Contents
Product Details
About the Author
Recommended for You
Customer Reviews

REVIEW SNAPSHOT®

by PowerReviews
oreillyIntroduction to Tornado
 
4.3

(based on 4 reviews)

Ratings Distribution

  • 5 Stars

     

    (2)

  • 4 Stars

     

    (1)

  • 3 Stars

     

    (1)

  • 2 Stars

     

    (0)

  • 1 Stars

     

    (0)

100%

of respondents would recommend this to a friend.

Pros

  • Easy to understand (4)
  • Concise (3)
  • Helpful examples (3)

Cons

    Best Uses

    • Novice (3)
      • Reviewer Profile:
      • Developer (4)

    Reviewed by 4 customers

    Sort by

    Displaying reviews 1-4

    Back to top

    (1 of 1 customers found this review helpful)

     
    5.0

    Nice short book to get you started with

    By Ivo Flipse

    from Netherlands

    About Me Developer

    Verified Reviewer

    Pros

    • Concise
    • Easy to understand
    • Helpful examples

    Cons

      Best Uses

      • Novice

      Comments about oreilly Introduction to Tornado:

      The book features several nice examples, like a shopping cart for a bookstore, asynchronously keeping tabs on how many items are remaining. A simple Twitter client displaying your latest tweets, a Facebook client showing your timeline, both dealing with authentication. Most examples worked pretty well, though I had some issues getting the Twitter client working, because of errors I made in the callback url on localhost. I didn't get the Facebook example working for the same reason, but its not a big issue.

      Overall, I found it a pretty useful book. While I was already somewhat familiar with Web Apps through Udacity and Coursera courses, it was good to get a bit more formal explanation about topics like routing, handlers and templates. I also liked the way they explained what each part of the code did, instead of assuming you had already figured it out. So while its a short read, I think its a nice introduction to Tornado to get you going.

      (3 of 3 customers found this review helpful)

       
      3.0

      A bit thin for the topic.

      By larryp

      from Eugene, OR

      About Me Developer, Sys Admin

      Verified Reviewer

      Pros

      • Easy to understand
      • Good Intro To Templates

      Cons

      • Not comprehensive enough
      • Too basic

      Best Uses

      • Novice

      Comments about oreilly Introduction to Tornado:

      This is a frustrating book. What there is of it is fairly good, but it skates over a number of features and overall feels like it's the first few chapters of a longer and more thorough book on the topic of event driven webservers in python and Tornado specifically.

      It also has a couple of specific missing features that should be addressed in the next edition; which should come soon. The lack of an index is galling, and by itself means that this book is below the usual high standards we've come to expect from O'Reilly. And in the introduction to the usage of the webserver it fails to mention logging, pretty much at all, and I may be strange in this but logging is how I understand what the server is doing in development, and what I need when failures occur in production. It's a fairly crucial part of understanding any web framework, and should be covered in even the most basic examples of how to set up the webserver to handle requests.

      The explanation of the template system is relatively thorough, and is the only part of the book that meets expectations.

      The section on databases is just bad. The only database covered in depth is MongoDB, MySQL is mentioned but just barely, and PostgreSQL, Redis, and other database systems are roundly ignored. Not only that, but the most salient fact about talking to any database from Tornado is not really examined, namely that since Tornado is a single threaded event-based server, you need to use non-blocking database calls else your application will be waiting on any slow queries. That's a crucial piece of information that someone coming from Django or PHP would not necessarily know about Tornado.

      The chapter on asynchronous calls focuses mostly on calls to external web services, which is important, but fails to make clear why it's important, and why most production Tornado code will be written with callbacks, explicit, or implicit as the default.

      The coverage of persistent browser connections (one of the main reasons you'd want to use Tornado) is reasonably broad, but moderately incomplete, although that may be due to the fact that this an area still in flux. The discussion of long polling is good, the discussion of websockets is less complete and has been superseded by developments since the release of the book ( take a look at https://github.com/mrjoes/tornadio2 for a socket.io implementation that includes multi-browser fallback implementations).
      Oddly enough Server Sent Events are completely absent from the discussion, although Tornado is well suited to providing them.

      The discussion of web security, while good is relatively generic to web development and not specific to Tornado, and should probably have been folded into the chapter on authentication and input validation.

      The deployment discussion again suffers in that it only discovers one deployment environment, and doesn't consider situations like running Tornado in an existing Django environment, or the use of virtualenvs to manage python dependencies in both production, development and test. It would also be nice to see a few paragraphs about the issues involved with running persistent connections through load balancers/reverse proxies.

      Missing chapters (in my opinion):
      a. Testing your tornado application
      b. long running external processes (using the multiprocessing module) or task queues like Celery, or Gearman.
      c. IPython notebook; as the most widely deployed Tornado application, and the source of much of the current interest in Tornado, it's a strange lacuna.
      d. Why and when to use Tornado in preference to another python webserver, this would be the chapter to discuss things like gunicorn, gevent, eventlets and other event based python servers.

      So, it really seems like this book was released at least one editorial cycle too early, and while the authors made a valiant effort and are to be congratulated on their work, I have to ask; what happened on the editorial side?

      (3 of 3 customers found this review helpful)

       
      4.0

      Overcome your Fear to Try Tornado

      By Eder Andrés Ávila Niño

      from Paipa, Colombia

      About Me Developer

      Verified Reviewer

      Pros

      • Concise
      • Easy to understand
      • Helpful examples

      Cons

        Best Uses

        • Novice
        • Student

        Comments about oreilly Introduction to Tornado:

        Introduction to Tornado is a rapid book for starting to get in touch with Tornado, an open source framework led by Facebook, Inc., for developing asynchronous web services in Python, covering topics like request handlers, forms, templates, MongoDB, initial authentication, OAuth, and Nginx.

        With Introduction to Tornado you can learn and practice the fundamentals of the capabilities given by the Tornado framework to build web services that support hundreds of asynchronous requests, user authentication via cookies and OAuth, MongoDB document storage and retrieval, and deployment in an Nginx server environment. That is, some of the top leading technologies today to provide to end consumers fast, scalable, secure web applications that follow the RESTful architecture.

        Without doubt, this book will help you overcome your fear to try this Python framework for starting to develop web applications, web services and web APIs that want to benefit of thousands of asynchronous accesses. And maybe, Tornado could be the technology you're looking for begin your startup business offering to your customers the same service quality provided by services like Twitter and Facebook.

        The reader should be warned about his/her expectations, however. As I said, this book is helpful for overcoming the fear to try the Tornado web server, but not to master it. In fact, as you can see Introduction to Tornado is a short book of 136 pages divided in 8 chapters that cover the foundation of each Tornado's feature ranging from small web services and ending with the final deployment. So, after reading this book you won't be a Tornado's master chief, but a Tornado's recruit, I mean enthusiast. Besides, you need to read more about RESTful architecture, user authentication, and Nginx developing by your own.

        But, I recommend Introduction to Tornado because each Tornado's feature is explained through a short, comprehensive application accompanied by a clear discussion which motivates the reader chapter by chapter and after finishing the book to continue exploring the different development possibilities by using Tornado as an asynchronous web server.

        Personally, I'm delighted with this book because it has explains a little more the rationale about some features like classes, callbacks and settings that other tutorials I found on-line. I hope in the future we can get more complements to the book's contents and more extras from the authors.

        Note: This review is in exchange for the O'Reilly Bloggers Review Program (http://oreilly.com/bloggers).

        (2 of 3 customers found this review helpful)

         
        5.0

        Highly recommended book for Tornado

        By yoonghm

        from Singapore

        About Me Designer, Developer, Educator

        Pros

        • Accurate
        • Concise
        • Easy to understand
        • Helpful examples
        • Well-written

        Cons

        • Too basic

        Best Uses

        • Expert
        • Intermediate

        Comments about oreilly Introduction to Tornado:

        It is the first book on Tornado.
        It covers a lot of useful information on using Tornado. Examples are provided to illustrate the concepts well.
        Can't wait to see "Learning Tornado".

        Displaying reviews 1-4

        Back to top

         
        Buy 2 Get 1 Free Free Shipping Guarantee
        Buying Options
        Immediate Access - Go Digital what's this?
        Ebook: $15.99
        Formats:  DAISY, ePub, Mobi, PDF
        Print & Ebook: $26.39
        Print: $23.99