<aside>
<img src="/icons/map-pin_gray.svg" alt="/icons/map-pin_gray.svg" width="40px" /> Final exam contents similar to exam review, question will be a little different.
- Similar topics to the sample final will be covered and format
- Closed-book, in-person
</aside>
Question 1
Comparison between monolithic and microservice. Figure out different software quality attributes
- ACID database transaction.
- Think about the whole data — in a monolithic architecture, all data is stored in a central database.
- The DBMS can handle consistency very strongly.
- However, in microservices, requests may be dispatched to different databases, which can lead to conflicts and inconsistencies.
- In monolithic, they are all dispatched at one, central database, which can cancel a request if there’s a conflict.
- Adaptability to new middleware technology.
- Microservice architecture allows for easier adaptation to new technology because only the affected service needs to be updated, rather than the entire project.
- In a monolithic architecture, any update to the middleware technology requires updating the entire project.
- Since microservices send textual data, they can be developed and deployed independently, which allows for the deployment of separate services without affecting others.
Question 2
Refactor monolithic architecture to microservice architecture. Be able to figure out how this monolithic design can be decomposed to multiple microservices.
- Draw deployment diagram and each component should be explained.
-
One possible design:

There should also be a REST API connection from Frontend to Rental management.
-
There are three services: Car Repair Management, Car Management, and Rental Management.
- Car Repair Management handles all requests related to repairs, including car repair.
- Car Management handles requests related to the cars themselves.
- Rental Management handles requests related to renting cars to users, including dates, prices, and other relevant information.
- Specify how microservices communicate — synchronous (REST API), asynchronous (messaging), HTTP connection.
- Synchronous REST API:
- Car management has a connection REST API for handling and connecting to database for CRUD operations — JDBC through REST API.
- Likewise same for Car Repair management. Need information about car in Cars database to fill information about car repair in Car Repairs database.
- Rental management need information about the car rentals in Car Rentals database
- Asynchronous messaging:
- When a repair is finished in the Car Repair Management service, it can send a message to the Car Management service to inform it about the repair.
- When a car is deleted in the Car Management service, it can send a message to the Rental Management service to inform it that the car is no longer available.
- Explain how authentication — such as cookies, etc.
- Which nodes require authentication:
-
Authentication is required at the frontend, which is responsible for handling user sign-ins and generating JWT tokens.
-
When a user signs in, their username and password are stored securely on the frontend and checks if the user is authorized by looking at a table of authorized users.
-
If the user is authorized, the frontend creates a JWT token using a secret string and encodes the user's information in the token.
-
The frontend then sets the JWT token to a cookie, which is sent with subsequent requests. Other microservices that require authentication can decode the cookie and check if it matches the JWT token generated by the frontend.
-
The other microservices must have access to the same secret string used by the frontend to encode and decode the JWT token.

Question 3
The main idea of event-processing architecture is messaging — 11 More on Kubernetes. For a given description, create an event-processing architecture and use KubeMQ.
-
Design a container-based stream-processing architecture using KubeMQ.
- All transaction will be sent to KubeMQ.

Not fully completed as the one done during in-class
-
Explain about producers, consumers, and their connections to KubeMQ.
Question 4
You will be given a YAML file and be able to comprehend every line.
- Draw a Kubernetes cluster with three nodes.
-
One such configuration — my interpretation of it. I am unsure of how detailed you must be.

-
There should be three nodes in total as stated. She mentions that we consider the master node as one, so then we’ll have two worker nodes.
-
There should be four replicas (pod) in total. Kubernetes automatically distributes the replicas across the worker nodes, so I assume you can place it randomly.
- These pod replicas should have the label
MS1
, which is used by the Load Balancer to determine where to route connection.
- Inside each pod, we have a container named
MS1
, which expose port 8080
as noted by the containerPort
.
-
Recall the Load Balancer exposes the service externally, so it is typically outside of the cluster.
- The Load Balancer is named
MS1_service
and will accept connections on port 80
.
- The arrows might not be accurate, but it should route each connection to (
targetPort
) port 8080
— which in this case, is all of them.
- I added the red rectangle at the top, to represent the
selector
, to specify which pods the service should forward traffic to — app: MS1
.
- How to scale down from 4 to 2 replications? You don’t need to know the commands word-for-word, but be able to at least explain how to do it.
- Change the
replicas
to 2
in YAML file.
- We use
kubectl
to communicate with Kubernetes and update the YAML file.
- The master node will then be responsible to reduce the number of replications.