Design Patterns for Cloud Native Applications Flashcards
What are the characteristics of Cloud Native Applications?
- They consist of independent loosely coupled services. They are autonomously developed, deployed, and scaled independently
- They run on dynamic environments(public, private, hybrid, poly cloud)
- They are Observable, Resilient, Scaleable, Manageable
What are the characteristics of a Microservice architecture?
A collection of loosely coupled services that achieve business value. These services are developed, scaled, deployed independently
How do microservices communicate
They communicate over a light weight interservice communication. The pipes are considered dumb but the endpoints are are considered smart
How do Microservices execute as a cloud native application
They are packaged and executed as containers running on a container host
What are the characteristics of a container?
- It’s a running process that’s isolated from the host OS and other running processes in the system
- It interacts with it’s own private filesystem
- It shares the host OS with other containers and are much lighter weight then VM’s
- Are independent portable and have execution consistency across multiple environments
What is a container image?
It’s a binary that consists of everything you need to run an application:
- code
- dependencies
- runtime
Where are containers stored?
- In a container registry
What are the key features of a container orchestration system
- Automatic provisioning - takes care of provisioning container instances and deployment of containers
- High availability - auto provision container if other’s fail
- Scaling - based on demand automatically add/remove container instances
- Resource Management -
- Service interfaces and Load balancing - exposes containers to external systems and manages the load coming into containers
- Network interface abstractions
- Service discovery - name based discover is build in
- Control plane - a single place to manage an monitor
- Afinity - provision containers near or far away depending on availability and performancy needs
- rolling upgrades - coordinates upgrades for zero downtime
- Componentization & isolation - logical separations between application domains
What does automation mean in the context of cloud native applications?
Automating the manual tasks of the development lifecycle
- running integration tests
- builds
- releases
- configuration management
- infrastructure management
- continuous integration and continuos delivery
What is the difference between continuous delivery and continuous deployment?
With continuous delivery manual approval is needed to move to production
With continuous deployment the update to production happens automatically
What is a managed service/API
An API exposed through a gateway and a managment plane
What are the responsibilities of a managed Service API?
- Security
- Monetization
- Throttling
- Caching
- Versioning
In the context of developing an application how does an independent code base help?
- Lifecycle of the service can be completely independent from the rest of the system
- Able to explicitly import external dependencies and shouldn’t rely on any undeclared system wide dependencies
In the context of developing an application - what is the purpose of decoupled configuration
- The codebase of the service is environment agnostic
- The application run in multiple environments(e.g., dev, test, prod) without change
In the context of developing an application - what is the purpose of independent testing
- To have specific unit tests for the service to ensure it works
In the context of developing an application how does containerization help?
- Support for packaging up the service with runtimes(e.g. .Net Core, Python), dependencies(3rd party packages) and configuration is provided by containers
What are the key characteristics of the Request Response pattern
- Client sends a request and waits for a response
- Business logic of the client is blocked until a response is received or the max time to wait is exceeded
- Communication channel needs to be kept open until response is received
What is the most common messaging pattern used for comms between services in a cloud native environment
Request/Response
What are the common patterns are used in conjunction with Request/Response pattern
- Service Orchestration and API gateway
- Request/Reply - use an intermediary to implement similar style of communication using a queue
What are the synchronous message patterns
- Request/Response
- Remote Procedure Calls - services exposes business logic as a method and it’s invoked remotely by a consumer the resides in a different process
When is the RPC messaging pattern commonly used?
- For internal(not public facing) inter-service communication
When is the RPC messaging pattern not commonly used?
- When exposing public interface that needs to be used by web/mobile clients
When to use the request/response pattern in a microservice
- Services need real-time response
- Need to interoperate with many different consumers
- Service contracts need to be flexible
- Services are exposed to external consumers
When should the request/response pattern not be used by a microservice?
- Low latency and high throughput communication is required
- Strict contract first interactions are required.