Tornado (web server)
   HOME

TheInfoList



OR:

Tornado is a scalable, non-blocking
web server A web server is computer software and underlying hardware that accepts requests via HTTP (the network protocol created to distribute web content) or its secure variant HTTPS. A user agent, commonly a web browser or web crawler, initia ...
and
web application framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build an ...
written in Python. It was developed for use by FriendFeed; the company was acquired by
Facebook Facebook is an online social media and social networking service owned by American company Meta Platforms. Founded in 2004 by Mark Zuckerberg with fellow Harvard College students and roommates Eduardo Saverin, Andrew McCollum, Dust ...
in 2009 and Tornado was open-sourced soon after.


Performance

Tornado is noted for its high performance. Its design enables handling a large number of concurrent connections (i.e., tries to solve the "
C10k problem The C10k problem is the problem of optimizing network sockets to handle a large number of clients at the same time. The name C10k is a numeronym for concurrently handling ten thousand connections. Handling many concurrent connections is a differ ...
").


Modules

* An asynchronous
MongoDB MongoDB is a source-available cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. MongoDB is developed by MongoDB Inc. and licensed under the S ...
driver called Motor. *
CouchDB Apache CouchDB is an open-source document-oriented NoSQL database, implemented in Erlang. CouchDB uses multiple formats and protocols to store, transfer, and process its data. It uses JSON to store data, JavaScript as its query language using ...
drivers called corduroy and trombi. * Asynchronous driver for
PostgreSQL PostgreSQL (, ), also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. It was originally named POSTGRES, referring to its origins as a successor to the ...
wrapping psycopg called Momoko


Example

The following code shows a simple web application that displays " Hello World!" when visited: import asyncio import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello, world") def make_app(): return tornado.web.Application( r"/", MainHandler), async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__

"__main__": asyncio.run(main())


See also

*
Django (web framework) Django ( ; sometimes stylized as django) is a free and open-source, Python-based web framework that follows the model–template–views (MTV) architectural pattern. It is maintained by the Django Software Foundation (DSF), an independent o ...
* FastAPI * Flask (web framework) * Pylons project *
Web2py Web2py is an open-source web application framework written in the Python programming language. Web2py allows web developers to program dynamic web content using Python. Web2py is designed to help reduce tedious web development tasks, such a ...
* Comparison of web server software


References


External links

* {{Meta Platforms Facebook software Free software programmed in Python Free web server software Python (programming language) web frameworks Web server software for Linux