L6 - Monolithic vs. Microservice Application Architecture Flashcards

1
Q

What is a monolithic architecture?

A

Design of a software program which is one piece

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

A typical server-side application has a layered structure with the following components:

A
  • database which consists of many tables in a Relational Database Management System (RDBMS)
  • client-side user interface (consisting of HTML pages and/or JavaScript running in a browser)
  • a server-side application
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

client side vs. server side

A

Client-side means that the processing takes place on the user’s computer. It requires browsers to run the scripts on the client machine without involving any processing on the server.

Server-side means that the processing takes place on a web server. (e.g. authentication)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Benefits of Monolithic Architecture

A
  • easy to develop (everything is handled in the same place)
  • simple to test (end-to-end testing can be implemented by launching the application and testing the UI with the desired outputs)
  • simple to deploy (copy the package application to a server for deployment)
  • easy horizontal scaling (simple to scale horizontally by running multiple copies of the complete application behind a load balancer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Drawbacks of a monolithic architecture

A
  • limitations in size and complexity (you cannot make continuous additions to previous code)
  • too large and complex (difficult to make changes fast and correct)
  • slow start time (start time depends on size of application)
  • re-deployment of the complete application on update (entire application must be re-deployed which increases the downtime)
  • reliability (a bug in any module can break down the entire process)
  • barriers to adopting new tech and difficult to scale
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Microservices Architecture?

A
  • split the application into a set of smaller and interconnected services
    each service:
  • communicates with a common communication protocol like REST web service with JSON
  • runs individually
  • services can be present in a single machine or different ones
  • may have own databases
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Can a single programmer implement, design, deploy, and maintain a microservice?

A

Yes

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Is the data independent of other services in microservices?

A

Yes the data is in a single bounded context.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

How are services in the Microservices Architecture addressable?

A

Through the Service Discovery System

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

How do operations take place on Microservices?

A

Operations are stateless. Everything the services need to know is supplied on the request and once the request is complete they forget it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Benefits of Microservice Architecture

A
  • easier to understand and maintain
  • independence of services
  • no barriers on adopting new technologies
  • independent service deployment (continuous deployment is possible for complex applications)
  • each service can scale independently
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Drawbacks of Microservices

A
  • complexity of creating a distributed system
  • deployment complexity
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Why is there a complexity of creating a distributed system?

A
  • developer tools/IDEs are oriented on building monolithic applications
  • testing is more difficult
  • implementation of inter-process communication is necessary
  • implementing use cases that span across multiple services without using distributed transactions is difficult
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Why is there deployment complexity for Microservices?

A
  • each service will have multiple runtime instances
  • each instance needs to be configured, deployed, scaled, and monitored
  • you need to implement a service discovery mechanism
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a Service Mesh

A
  • configurable, low-latency infrastructure layer
  • designed to handle a high volume of network-based interprocess communication among application infrastructure services using application programming interfaces (APIs)
  • ensure that the communication among containerized and other application infrastructure services is fast, reliable, and secure
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Example of a service Mesh provider

A

Istio

17
Q

Microservice Application Framework Components

A

API Gateway (Service Discovery, Service Registry)
Resilience
Deployment Strategies
Rolling Updates

18
Q

What is an API Gateway?

A

Server that is the single-entry point into the system. Encapsulates the internal system architecture and provides an API that is tailored to each client.

19
Q

Do you need a Gateway more for monolithic applications or for microservices?

A

More for microservices. For Microservices because the client must otherwise query every service individually.

20
Q

What is backends for frontend patterns?

A

It defines a separate API gateway for each kind of client. It is a design pattern created with not only the developer but, more importantly, the user and their experience in mind. It is the answer to the ever-growing adoption of applications to meet, interact, and serve customers, ensuring consistency while still meeting their diverse and evolving needs.

Web app has Web API gateway
Mobile app has Mobile API gateway
Others have a public API gateway

21
Q

What is a service registry?

A
  • database containing the network location of service instances
  • it needs to be highly available and up to date
22
Q

Examples of service registries

A
  • Netflix Eureka: provides REST APIs for registering and querying service instances
  • etcd: key-value store used by Kubernetes and Cloud Foundry
23
Q

Why is the a problem with finding the service location?

A
  • API Gateway and other services (called Service Clients) require to know the network location (IP address and port) of service instances
  • in a microservice application each service instance is assigned an IP address dynamically because of autoscaling, failures, and upgrades
24
Q

Client-Side Service Discovery

A
  • client (API Gateway or other services called service clients) are responsible for determining the network location of available service instances
  • the client queries a service registry, which is a database of available service instances
  • the client then uses a load-balancing algorithm to select one of the available service instances and makes a request
25
Q

Pros of client-Side Service Discovery

A
  • straightforward and, except for service registry, there are no other moving parts
  • client can make intelligent, application-specific load-balancing decisions as it knows about the available service instances