Week 2 Flashcards
(25 cards)
What is a monolith?
A large single entity. Where products are programs formed from a collection of modules and run by a single process. All communication between modules is by procedure calls.
Advantages of monolith style
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 easily be deployed from version control automatically.
Why are monoliths considered bad
Synonymous with legacy applications
Overcomplicated, messy etc.
What is the 2 pizza rule?
Every internal team would be small enough that it could be adequately fed with two pizzas
What is microservices?
Architectural style where products are applications formed from a collection of microservices, each a separate program run by a separate process. All communication is by message passing.
Advantages of the microservice style
Deployed independently
More fault resistant
Scaling easily
Development is easy, as each microservice can use a different language
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 orgs communication structure e.g. 4 departments, 4 microservices.
What do enterprises do in Conways Law?
Do it in reverse, make our microservices, then make the company structure reflect this.
What are two approaches to building a software product MVP
Microservices late
Microservices early
What is microservices late?
Begin making a monolith then make microservices from it later. Much easier to make changes now than if we had proper structure.
Enter the marker with a poor product to learn from customer.
What is the Strangler pattern?
Manages migrations by putting an intermediary facade in front of the monolith, initially, this provides access to modules. As modules are replaced by microservices, the monolith is slowly strangled by microservices, killing it.
What is microservices early?
Build straight into microservices. Enters the market with a better structured product, but later. Not as flexible to rethink.
What do the best microservice designs have
High cohesion
Loose coupling
What does high cohesion mean
Related functionality is found in one component, unrelated functionality is in another.
Easier to change.
What does loose coupling mean?
Services should be independent of one another. Changing one microservice does not necessitate changing others. They dont share much.
What connects microservices?
A microservice bus connects them with an open, pluggable framework.
What is the microservice bus protocol
HTTP, JSON, REST.
What is HTTP
Synchronous protocol, the client sends a request and then blocks until a server sends back a response.
POST GET PUT DELETE
Issues with JSON for microservices
It does not support binary content, such as audio or video.
What are the 4 archetypes
Documents
Collections
Stores
Controller
What are documents
Describes operations on file-like resources
GET reads the file
PUT updates the file
DELETE deletes the file
What are collections
Describes operations on directory like resources
GET returns a list of the resources
POST creates a new resource in the directory with given contents, choosing resource name and returning it.
What are stores
Describes operations on directory-like resources
GET reads the directory-like resources
GET reads the directory and returns a list of the resources
PUT creates a new resource using the given resource name, or updates one.
What are controllers
Describes operations on external resources
POST causes the external resource to carry out some task and returns any result.