Quora

Quora has taken the world by storm with a unique system that works so fluidly you would wonder why anyone is making a big deal about it. It’s a powerful tool that simple lets you ask and answer questions. What makes this tool so unique is the super fast auto complete search box, which also doubles as a method for adding new questions. The site is developed by some of the co-founders Facebook.

Fast Queries

The search box is very, very fast, but why is this? The queries are sent over AJAX as a GET request. The response then comes in as JSON with the rendered HTML embedded inside the JSON. Quora uses a persistent connection, meaning the HTTP connection is established when you start typing in the search box.

Webnode2 and Livenode

Webnode2 and Livenode are some of Quora’s internal systems, which are for managing content. Webnode2 generates HTML, CSS and JavaScript, which is paired with LiveNode, which manages the display of the content on the page. They would like to open source LiveNode however that would be too much work at the time.

Amazon Web Services

Amazon EC2 and S3 are used for the hosting; it’s perfectly designed for fast growing companies. Quora also uses Ubuntu Linux as its OS, since it’s easy to deploy and manage on Amazon EC2. For serving up static content Quora uses Amazon’s distributed content delivery network Cloudfront.

HAProxy Load-Balancing

Quora uses HAProxy at the front end, which load balances on the distributed Nginx servers. Behind the load balancer sits Nginx, which is used a reverse proxy server onto the web servers. Pylons, which is a lightweight web framework, is used as their main webserver behind the Nginx. With the Pylons template they scooped out the insides and added their own technologies. Which is where the LiveNode and webnode2 reside. Python was chosen as the language for the site over PHP and JavaScript. The reason Python was chosen over Java was because its more expressive and quicker to write code then Java. Thrift is used for communications between the backend systems. The Thrift is written in C++. Finally the Tornado web framework is used for live updating. This is their Comet server, which handles the large volumes of open connections used for pushing updates to the browser.

Long Polling

Quora does not just serve up static web pages. The pages are updated with new content when others submit it. Long polling puts the server in control by making the client wait for a request. The server waits to respond to the client’s request until they have something new to serve to the page. The benefit of long polling is there is less back and forth between the server and client.

MySQL

Quora uses MySQL as a distributed data store. They used MySQL instead of NoSQL because for social sites you should not use NoSQL until you have at least one million users. Memcached is used as a caching layer in front of MySQL. Finally they use Git for the version control system. Further look upon Quora’s source code its apparent that all the JavaScript is placed at the end of the page. It creates the feeling of a quicker loading page since all the content is loaded before the JavaScript is seen.

References:

"Quora." Why Did Choose Python for Its Development? -. N.p., n.d. Web. 24 Feb. 2015. http://www.quora.com/Why-did-Quora-choose-Python-for-its-development

Whelan, Phil. "Quora’s Technology Examined." Big Fast Blog. N.p., 31 Feb. 2011. Web. 24 Feb. 2015. http://www.bigfastblog.com/quoras-technology-examined