You are on page 1of 2

CS490-CLC Spring, 2021

Homework #5

Due Midnight EDT on Wednesday, April 7

1. Your company is moving all their IT to a cloud. An existing monolithic application con-
tains over 500.000 lines of code, and the application must be changed to use microservices.
Two teams have formed: one will disaggregate the existing code, and the other will start
from scratch to create the microservices version. Only the team with the best results will re-
ceive an annual bonus. If you are given a choice, which team will you join? Explain your
reasons.

2. A company moving to the cloud has a monolithic application, M, that consists of a main
program and five functions. The functions are called linearly. That is, each time a user runs
the application, main calls A, A calls B, B calls C, C calls D, and D calls E. Then, E returns
to D, D returns to C, C returns to B, B returns to A, and A returns to main, which displays
the results to the user. If application M is converted to a set of microservices, will it scale
better? Why or why not?

3. A team decides to disaggregate an application, and two team members make proposals. Pro-
posal 1 divides the application into ten microservices that each correspond to a major
module of the application. Proposal 2 divides the application into 284 microservices, one
for each function (i.e., method) in the code. The team member who made proposal 2 says
that using more microservices means that each container will be extremely small and there
will never be a part of the code running that is not needed. Which proposal do you support.
Explain your position.

4. You are planning an implementation of the disaggregated online shopping service described
in class, and need to estimate resource use. Specifically, you need to estimate the number of
containers that will run. You may ignore the user experience and customer database mi-
croservices, which only run for a trivial amount of time. Assume that an online shopping
container is created for each user, and remains running while the user shops. For purposes
of this question, assume all users spend the same time shopping. Assume 80% of the users
spend all the time browsing the catalog without making a purchase. Among users who do
make a purchase, assume that entering payment and shipping information each take 5% of
the user’s time. Now imagine 1000 users accessing the shopping applications. If the users
started at random times, estimate the number of each type of container that will be running.

5. Consider a microservice that searches the Purdue directory. A caller can specify a name,
department, or email address, and obtain information about students and faculty that match
the specification. Some requests return information about a single individual, but others re-
turn information about hundreds or thousands of individuals. When designing an API that
will be used to access such a microservice, what protocol would you choose? Explain your
choice.

6. A company offers a wearable biomedical device that continually injects a patient with medi-
cine. The device takes a measurement every 2 seconds, and uploads the measurement to an
application running in the cloud. The cloud application sends commands to the device either
to increase or decrease the rate of medicine the device is delivering to the patient. Suppose
the patient takes a trip to an area with very slow Internet connections, and describe how such
a system might behave in an unintended way.
7. A home owner who has a wireless thermostat notices that the thermostat takes too long to
respond — the room becomes uncomfortably cold before the heat comes on, and then con-
tinues to heat many degrees above the specified temperature. The owner changes the ther-
mostat to send a reading every five seconds instead of every two minutes. What is the
downside of the change?

8. Kubernetes allows one to write control loop software without planning a delay for the loop.
Explain the conceptual approach that is used.

9. What is the purpose of the Reconcile function in a Kubernetes control loop?

10. Explain the concept of reactive planning, and tell how it relates to a Kubernetes control
loop.

You might also like