Week 2 - Monoliths, Microservices and Communication Flashcards
What is a monolith?
Where products are programs from a collection of modules, run by a single process. All communication is by procedural calls.
Name 3 advantages of monoliths.
Modules can be made to correspond directly to business functions identified by domain-driven design.
Modules can be developed by teams working to agreed interfaces through permissionless innovation.
The program as a whole can be easily deployed from version control automatically.
What is the microservice architectural style?
Where products are applications from a collection of microservices, each a separate program run by a separate process. All communication between microservices is by message passing.
What is Conway’s Law?
Any organisation that designs a system (defined more broadly here than just information systems) will inevitably produce a design whose structure is a copy of the organisation’s communication structure.
What are the two approaches to building a software product MVP?
Microservices early and microservices late.
What is the microservices late approach?
When building a system, first build a single large monolith before (if successful) migrating to many small microservices.
What is the idea of microservices late?
To enter the marketplace early with a (perhaps poorly-structured) product, ready to learn from the customer.
What is the microservices early approach?
To begin with microservices when building a system.
What is the idea of microservices early?
To enter the marketplace later with a better-structured product, ready to make the customer segment pivot.
What do the best microservice designs have?
High cohesion and loose coupling.
What is high cohesion and how does it help microservice design?
Related functionality is to be found in one component, while unrelated functionality is to be found in others.
This helps because, should functionality need changing, only one component needs changing.
What is loose coupling and how does it help microservice design?
Changing one component does not necessitate changing others.
This helps because, should the functionality of one component be changed, no other components need changing.
What are advantages of microservices?
Development is easier because each microservice can use whatever technology is best for it.
Deployment is easier because each microservice can be released just when it is ready.
Robustness is increased because the failure of one microservice doesn’t cause the failure of another.
Scaling is improved because the resources for one microservice don’t need to be the same as those for another.
How does the Strangler pattern manage migrations from monoliths to microservices?
The Strangler pattern manages migrations by putting an intermediary facade in front of the monolith.
Initially, the facade provides access to modules.
As modules are replaced by microservices behind the facade, it provides access to them instead.
In this way, the monolith is slowly “strangled” by microservices, which eventually kill it.
What does the the Least Knowledge principle say?
Components should only know about the structure of components they deal with directly.