首页 > > 详细

COMP5112 Assignment 2

 COMP5112 Assignment 2

Question 1 (25 marks)
With reference to the YouTube Video “Scaling Instagram Infrastructure” (Available at 
https://www.youtube.com/watch?v=hnpzNAPiC0E). Explain, with appropriate diagrams, how the 
Instagram team improved the application performance and scalability by optimizing the database 
design and deployment.
Question 2 (25 marks)
Play the system scalability game at https://ssg.comp.polyu.edu.hk/ssg and reach round 25 of the game. 
a) [4 marks] Capture a screenshot at round 25 with your user account information.
b) [21 marks] The current game includes a number of options for improving the scalability and 
performance of the database applications. Discuss TWO types of game options (NOT currently included 
in the game) related to improving the scalability and availability of the database applications. Discuss, 
with proposed user interface, how the game can be extended to incorporate such game options.
Question 3 (20 marks)
Watch the presentation "Timelines at Scale" (Available at 
https://www.infoq.com/presentations/Twitter-Timeline-Scalability/). 
Suppose that a twitter user Tommy (non-celebrity) has n followers and is following m other non￾celebrity users. Explain the time-complexity for Tommy to 
a) Post a tweet;
b) Retreve from home timeline the recent tweets from the users he follows.
Question 4 (30 mark)
Consider a popular e-commerce website where users can generate orders to purchase different products.
The order data are continuously sent to a server-side application for processing and the metric data are 
stored in Redis for generating the business dashboard to support business decision making. To satisfy the 
business needs, the metrics should be computed and queried efficiently at real-time from Redis without 
accessing the databases at the backend. 
a) Suggest a Redis data structure to support the efficient query of the ID and titles of the top m most 
popular items (ordered by total quantity purchased by the customers). Provide pseudocode with Redis 
commands to show how the server-side application may process the sample order data (available in 
blackboard) and store the metric in Redis. State the time complexity of the Redis commands.
b) Explain, with screenshot(s) of the browser page in Redis Insights, how the metric from the sample 
order data in (a) are stored in Redis.
c) Suggest Redis commands to query the ID and Title of the top 5 popular products . Capture a screenshot 
of the result of your Redis command in the sample order data.
Additional information related to the question.
To run Redis Insights with your Redis Server at localhost, run the following docker commands.
docker network create my-network
docker run --name redis -d --net my-network -p 6379:6379 redis
docker run --net my-network -p 8001:8001 redislabs/redisinsight:latest
You may then access your Redis Insight Portal at http://localhost:8001
联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!