Evaluation of Quora’s Design
Learn how the proposed design fulfills the non-functional requirements.
We'll cover the following...
Requirements compliance
We have used various techniques to fulfill our functional requirements. However, we need to determine if we have fulfilled the non-functional requirements. We’ll highlight some of the mechanisms we have utilized to address the non-functional requirements:
Scalability: Our system is highly scalable for several reasons. The updated design uses
. Quora uses powerful machines because service hosts use an in-memory cache, some level of queueing, maintain manager, worker, and routing library. The horizontal scaling of these service hosts is convenient because they are homogeneous.powerful and homogeneous service hosts Quora now uses Amazon EC2 instances with 32 cores, a shared 20 MB cache, and high network throughput.
On the database end, our design shards the MySQL databases vertically, which avoids issues in scalability because of overloaded MySQL servers. To reduce complexjoinqueries, tables anticipatingjoinoperations are placed in the same shard or partition.
Note: As mentioned earlier, vertical sharding may not be enough because each shard can grow large horizontally. For large MySQL tables, writing becomes a bottleneck. Therefore, our design may have to adhere to horizontal sharding, a well-known practice in database scaling.
Consistency: Due to the variety of functionalities offered by Quora, different consistency schemes may be selected for different types of data. For example, certain critical data like questions and answers should be stored synchronously. In this case, performance can take a hit because users don’t expect instantaneous responses to their questions. It means that a user may get a reply in five minutes, one hour, one day, or no response at all, depending on the user’s question and the availability of would-be respondents.
Other data like view counts may not necessarily be stored synchronously because it is not a goal of the Quora service to ensure that all users see the same number of views as soon as the question is posted. For such cases, eventual consistency is favored for improved performance.
Note: In general, our design is equipped with strong techniques to reduce the user-perceived latency as a whole.
Availability: Some of the main ideas to improve availability include isolation between different components, keeping redundant instances, using CDN, using configuration services like ZooKeeper, and load balancers to hide failures from users.