Summary of recently attempted web technologies

Source: Internet
Author: User

Recently, we started to build a simple server with the core function of data exchange and storage for small mobile games. Since this experience is almost zero, it starts from the HTTP service.

The server platform is Linux (Ubuntu 11 ).

1. HTTP Server:
Apache, a well-known Apache, is widely used, but is increasingly criticized for being lightweight. The server load testing tool AB that comes with Apache is worth using.
Lighttpd and Apache provide HTTP services with fewer functions and higher efficiency.

2. cgi and wsgi
The main function of the HTTP server is to provide underlying functions such as connection and static services. All dynamic functions need to be forwarded to the "dynamic server" through an interface, also known as Web applications. The standard used for intermediate interaction is CGI. Both Lighttpd and Apache have more than one CGI implementation. You can modify the configuration to activate it. One of the implementations is FastCGI, which has good performance.
Wsgi can be seen as a bridge between CGI and Python applications and is also a standard rather than an implementation. Because of wsgi's success and Python's high development efficiency, the current Python web framework is rampant.
Flup is a specific application and a specific wsgiserver. Flup is currently a mainstream server implementation in the python field. Many Web frameworks are implemented based on it to achieve better concurrency performance.

3. dbalchemy
ORM (Object relationship ing) is a framework that maps tables and records in a database into classes and objects in a programming language. Dbalchemy is an implementation of ORM in the python field, and its design becomes the standard of ORM in the python field.
Dbalchemy can be directly used as a database.

Server framework:

Client <-- HTTP --> Lighttpd (or Apache) <-- FastCGI module --> flup + dbalchemy <----> DB

As shown above, the client exchanges data with the server over HTTP, and all the data obtained by the server is forwarded to the flup server (IP address Forwarding is currently used ), the flup server responds and calls the dbalchemy interface. Dbalchemy is only a database, not a service. Maybe the flup + dbalchemy server should be called the Save server.

I just found that the flup server can be used independently without HTTP server forwarding, but it may be difficult to process the data format.

Reference: Relationship between wsgi, flup, FastCGI, and Web. py

Http://www.douban.com/note/13508388/

Simple Server construction process:

1. Run dB. py to build the database.

2. Run simple. py (the flup server) and specify a port of the local machine in the Code, such as 3333.

3. Configure the Lighttpd service, enable the FastCGI module, and locate it on port 3333 of the local machine. In this way, the Lighttpd and flup are connected.

4. It is super simple to write an HTTP client in Python. You can test it using the URL module.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.