10. Monolith vs Microservices Flashcards
1, 10, 11
what is a monolithic enterprise application architecture
enterprise application built as a single unit with a single logical executable
main parts of a Monolithic Enterprise Application Architecture
- Client-side UI
- database
- server-side application that handles : HTTP logic, executes business logic, retrieve and update data from database, select and populate HTML, etc –> usually deployed as a single package (monolith/monolithic application)
characteristics of a monolith
- has a single code base implementing all functions needed for various business processes -> may become large and complex, difficult to understand and maintain
- typically developed in one programming language on one platform: easier for different parts of the application to be compatible, less flexible for the choices of technologies, less suitable for heterogeneous environments
- deployment is all or none: due to dependencies
- scale entire application, not just a function
what does single unit/package mean?
- does not mean the monolith only has one function, module or database.
- can have multiple module, connected to multiple dbs
- modules are bundled/packaged together –> maybe too big/complex and interface may be ad-hoc and not standardised enough to be called service interfaces
whats a microservice
- a single unit that implements only one or few (instead of many) functionality(ies)
- can be invoked by other applications/microservices over the network in a standard interface that is independent of programming languages and platforms
why are microservices “loosely coupled”
- implemented in a programming language of its own
- can be deployed and run on a platform of its own
- has its own datastore
- scaled independently
- implementation can be changed independently (interface for invocation remains the same)
what is the purpose of an adaptor /wrapper
provide easier interfaces to an app so that it’d be easier for other apps to use the functionalities of this app
whats an adaptor/wrapper service
interfaces that are language-/platform-agnostic and can be used by other apps across networks
adaptor vs wrapper
“adapters” may often be used when they are provided by the third-party software vendors and have more complex internals; “wrappers” may often be used when they are built by our organization for third-party software and have simpler internals
types of microservices (2)
atomic/simple
composite/complex
what is an atomic (micro)service
- provides functionality related to one kind of entity of a business concern
- implementation is independent of others
- self-contained, without depending on monolith / other microservices
- may depend on others as a “wrapper” to expose some functionality in a monolith or external API
- may not directly communicate to other microservices BUT may send reply data
what is a composite (micro)service
- provides functionality related to more than 1 entity
- functionality provided consists of a set/sequence of activities (including direct/indirect communication with others) for a business process, which are dependent on others
- microservice may depend on other (micro)services but should not directly depend on a monolith
- service may depend on monolith and (micro)services but not recommended (increases coupling, harder to deploy/scale independently)
- needs to know interfaces of all others it communicates with
who do composite microservices communicate with
- can directly communicate with another composite (micro)service and atomic (micro)service
- CANNOT communicate with IT systems/monoliths