AWS Cloud Developer: Microservices Design Principles Flashcards
Benefits of Microservices
Scale
Lean applications that are able to tailor their logic and infrastructure to their specific business needs. More-easily architected for horizontally-scaling.
Development in Parallel
Teams can develop and deploy their own codebases.
Cost Effectiveness
Utilize resources only for what is necessary for the specific microservice.
Flexibility Choose technologies that make the most sense for the team and business.
When in doubt about which architecture to use, which one should you choose?
monolith
it is much easier to refactor a monolith than what it is to refactor microservices
Technical Properties of microservices
Communication
Services communicate through a network
REST is currently the most-commonly used network interface
Independently Deployed
Deployment to one service should not affect another
Fault tolerant
Diligence in writing code that can anticipate when another microservice isn’t working
Fault Tollerance
The ability to continue operating in the event of a failure
REST
Architectural style of communication across a network
Vertical Scaling
Scaling by increasing the capacity of existing machines
Horizontal Scaling
Scaling by adding more machines
Alternatives to REST
Publish-Subscribe Queues gRPC SOAP GraphQL
Steps in Refactoring a Monolith
- Map dependencies using a dependency graph
- Start with components that have the least dependencies or downstream effects
- Use the strangler patttern to migrate code
dependency Graph
A diagram that maps out the relationships between components to understand which parts of the system rely on the other
Module
Program that is logically grouped together to execute a specific functionality
Strangler Pattern
Strategy of refactoring code by incrementally replacing components of the codebase
Incrementally replace specific pieces of functionality with new applications and services.
Create a façade that intercepts requests going to the backend legacy system. The façade routes these requests either to the legacy application or the new services. Existing features can be migrated to the new system gradually, and consumers can continue using the same interface, unaware that any migration has taken place.
Technical Debt
The concept of choosing an easier implementation of software that will need to be reworked
2 important consideration before refactoring architecture
- Trade-offs: Cost, Time, Technical debt
2. Scope
Request/Response Model
In the request-response model, a client computer or software requests data or services, and a server computer or software responds to the request by providing the data or service.