Zhihu's overall website architecture is as follows: Zhihu is a website rarely developed using Python in China and is worth learning, from Zhihu, we can also learn some new WEB technologies. I. Python framework I currently use Tornado & nbsp; framework. Tornado is a Pytho
Zhihu's entire website architecture is as follows:
Zhihu is a website rarely developed using Python in China. it is also worth learning. Zhihu allows us to learn some new WEB technologies.
I. Python framework
Is Tornado currently used? Framework. Tornado is a Web Server and Web application framework written in Python. it is used by FriendFeed on its own website, FriendFeed, after being acquired by facebook, the framework will be open to the public in the form of open source software.
Reference: http://zh.wikipedia.org/wiki/Tornado
Learning documents: http://www.tornadoweb.cn/documentation
II. Database
Currently, MySQL is used as the primary storage, and SqlAlchemy is used? Model or map databases for ORM.
III. cache technology
Apsaradb for Redis is used for caching, queuing, counting, or tasks, and Redis-Py is used to connect to the client.
Redis reference: http://redis.readthedocs.org/en/latest/index.html
Redis-Py reference link: http://redis-py.readthedocs.org/en/latest/index.html
IV. Javascript framework
Zhihu uses Google's Closure Library as the front-end JavaScript framework.
5. load processing
Currently, nginx is used for reverse proxy, and nginx is used for static files and other large data volume I/O operations.
VI. image service
Zhihu's previously used Upyun has now been migrated to Zhihu's image service.
VII. email service
Zhihu's mail was initially sent using Amazon's SES. as SES does not meet requirements, it has been converted to Mailgun.
8. message system
Zhihu message system adopts the comet implementation, and comet is a "server push" technology based on http persistent connections.
IX. virtual environment
As a Python website, it is very likely that Virtualenv is used to solve Pure Package environment problems.
Chinese document address: http://virtualenv-chinese-docs.readthedocs.org/en/latest/index.html
10. code deployment
Common Python projects are basically deployed using Fabric. I don't know which one is actually used.
11. search implementation
Zhihu uses mmseg for Chinese word segmentation. the corresponding word root exists in redis as the key, and the database id as the value. each data item is a zset set. Find the corresponding value based on the key during the query.