L6 - Monolithic vs. Microservice Application Architecture Flashcards
What is a monolithic architecture?
Design of a software program which is one piece
A typical server-side application has a layered structure with the following components:
- 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
client side vs. server side
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)
Benefits of Monolithic Architecture
- 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
Drawbacks of a monolithic architecture
- 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
What is Microservices Architecture?
- 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
Can a single programmer implement, design, deploy, and maintain a microservice?
Yes
Is the data independent of other services in microservices?
Yes the data is in a single bounded context.
How are services in the Microservices Architecture addressable?
Through the Service Discovery System
How do operations take place on Microservices?
Operations are stateless. Everything the services need to know is supplied on the request and once the request is complete they forget it.
Benefits of Microservice Architecture
- 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
Drawbacks of Microservices
- complexity of creating a distributed system
- deployment complexity
Why is there a complexity of creating a distributed system?
- 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
Why is there deployment complexity for Microservices?
- 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
What is a Service Mesh
- 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