0% found this document useful (0 votes)
11 views

2017 MSA Exam Ver1 Solution

Uploaded by

akramadel2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

2017 MSA Exam Ver1 Solution

Uploaded by

akramadel2001
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

German University in Cairo

Faculty of Media Engineering and Technology

Bar code

CSEN 1073: Architecture of Massively Scalable Apps


Exam Solution
Open Notes: Students are allowed to have lecture slides with them + 1 Aid Sheet A4/Standard size

Spring 2017 Semester


Dr. Wael Abouelsaadat
Date: May 25th, 2017
Duration: 3 hours

Major: DMET ___________ CSEN ___________

Do not turn this page until you have received the signal to start.
In the meantime, read the instructions below carefully.

This exam consists of 6 questions (numbered 1 to 6) on 11 pages (including this one), printed on one side
of the paper. When you receive the signal to start, please make sure that your copy of the examination is
complete. Answer each question directly on the examination paper, in the space provided, and use the reverse side
of the page for rough work. If you need more space for one of your solutions, use the reverse side of the page and
indicate clearly the part of your work that should be marked.

1. _________________ / 18 (Architecture Styles)


2. _________________ / 9 (Caching)
3. _________________ / 8 (Event-Based Architecture Concepts)
4. _________________ / 10 (Media Server)
5. _________________ / 9 (Scalability Testing)
6. _________________ / 16 (Takeaways)

_________________ / 70 TOTAL
Question 1: Architecture Styles [18 marks total]
For each of the following software, identify the best distributed system type for its backend.
Write only one answer (aka type) for each website/system. Justify your answer.

a) [3 marks] Flickr
Solution:
Event-based Architecture and Data-centered Architecture. Flickr is huge (biggest photo sharing website) with
comments on images. We need both event-based to manage the size and data-centered to store the images.

b) [3 marks] A school system for instructors to access student grades on campus and off campus
Solution:
Layered Architecture. It is layered to enable on and off campus access (object-based won’t pass easily
through firewalls – so it is not an acceptable answer).

c) [3 marks] A system for spies to deliver reports to their agency


Solution:
Data-centered Architecture. To share the reports without identifying the users.

d) [3 marks] A system in an aeroplane which allows the remote control of flying hardware systems
(engine, wings, etc…)
Solution:
Object-based Architecture. Different pieces of embedded software need to communicate with each
other. They do not reside in the same place (e.g. software in the engine, software in the wings, etc…).

e) [3 marks] A system for a hospital to allow doctors, nurses and patients to share medical records
Solution:
Layered Architecture (if we would support remote access) or Object-based Architecture (if we won’t).

f) [3 marks] WhatsApp Messenger


Solution:
Event-based Architecture. Size of traffic and number of users dictates that.

2/11
Question 2: Caching [9 marks total]

For each of the following software, identify the best caching strategy (centralized or distributed). Justify
your answer.

a) [3 marks] Flickr
Solution:
Distributed Caching

b) [3 marks] A local bank with 2 branches, running one system for all its employees (in all branches)
Solution:
Centralized Caching

c) [3 marks] Gmail
Solution:
Distributed Caching

3/11
Question 3: Event-Based Architecture Concepts [8 marks total]
a) [4 marks] Why would an active-record design pattern be challenging to implement in an event-
based architecture?

Solution:
Active-record maps all objects into tables providing crud functionality for the database tables. Since
objects in a program would refer to each to other using ids or otherwise, it would require to have all the
application code to run in one space to have active-record pattern work properly. Hence, dividing the
monolithic application to smaller ones (to run multiple of them as per need) cannot be done.

4/11
b) [4 marks] If you were to use a hypervisor in your course project, which parts of the project
would you have saved implementing. Label on the diagram below where would you put a
hypervisor and explain the savings it would have caused.

Solution:
A hypervisor would be put around each component in the system. This would have simplified the
controller coding a lot since the controller would communicate with the hypervisor instead of the apps
directly. Hypervisor could be used to start, stop, install, and configure each app with minimal coding
since they are designed to be containers of applications.

5/11
Question 4: Media Server [10 marks total]
YouTube decided to store its videos in haystack. Recall that haystack was originally designed to
store Facebook images (below are illustrations of the haystack architecture). What changes would
you make to haystack to have it store videos instead of images (hint: note that a video is nothing but
a series of images). Describe your solution in detail.

Haystack Filesystem:

Superblock:

Solution:
At least two changes need to be made:

1) In the needle, store all the frames of a video one after the other in the Data area.
2) Add a descriptor of the video content in the header part.

6/11
Question 5: Scalability Testing [9 marks total]
Below are charts documenting the results from doing a specific scalability test. Identify the scalability test
that was being performed (i.e. performance, capacity, stress, volume, or endurance testing) and what can
you learn about the application being tested from the chart (is it responding well? or does the graph shows a
problem in scalability). Service Response Time represents the amount of time it takes to receive a response
for a specific service (e.g. login request service). Concurrent Users per Second represents how many
concurrent users are being simulated to access the service at any point in time. Uploaded-data size
represents the size in Megabytes of a data file being uploaded to a service (e.g. email attachment).

a) [3 marks]

Solution:
Performance Testing

7/11
b) [3 marks]

Solution:
Endurance Testing

c) [3 marks]

Solution:
Volume Testing

8/11
Question 6: Takeaways [16 marks total]
List 8 course takeaways that you have implemented in your project.

Solution:
Any 8 of the following will do:
- In a massively scalable application, the application is divided into smaller
independent applications which in turn communicate with each other asynchronously
via messages using a set of message queue servers
- In a massively scalable application, the independent applications share data via a
shared Cache (centralized or distributed) which in turn must be synchronized with the
database content
- In a massively scalable application, each MSA app runs on top of a VM or Container
Framework to avoid the impact of changing underlying hardware
- In a MSA, the independent app is designed as a set of commands.
- In a massively scalable application, the independent application utilizes reflection in
creating objects and sometimes even calling methods.
- In a massively scalable application, the independent application always pool
resources (threads, database connections, etc…)
- In a massively scalable application, the independent application must support remote
control
- In a massively scalable application, both RDBMS and No-SQL coexist – each has its
own usage
- In a massively scalable application, design patterns are heavily used to decrease
coupling.
- In a massively scalable application, for storing media (images, audio, videos), a
custom simplified media server cluster is required
- General purpose file systems are too slow
- In a massively scalable application, client cache is heavily utilized to store media to
reduce traffic to backend media server

9/11
- A massively scalable application is evaluated using 5 different types of scalability
tests
- Each MSA app must be profiled thoroughly for performance enhancements

End of Exam

10/11

You might also like