REL 3: How do you design your workload service architecture?
Build highly scalable and reliable workloads using a service-oriented architecture (SOA) or a microservices architecture. Service-oriented architecture (SOA) is the practice of making software components reusable via service interfaces. Microservices architecture goes further to make components smaller and simpler.
Resources
Amazon API Gateway: Configuring a REST API Using OpenAPI
Implementing Microservices on AWS
Microservices on AWS
Microservices - a definition of this new architectural term
Microservice Trade-Offs
Bounded Context (a central pattern in Domain-Driven Design)
Best Practices:
-
Choose how to segment your workload: Monolithic architecture should be avoided. Instead, you should choose between SOA and microservices. When making each choice, balance the benefits against the complexities—what is right for a new product racing to first launch is different than what a workload built to scale from the start needs. The benefits of using smaller segments include greater agility, organizational flexibility, and scalability. Complexities include possible increased latency, more complex debugging, and increased operational burden
-
Build services focused on specific business domains and functionality: SOA builds services with well-delineated functions defined by business needs. Microservices use domain models and bounded context to limit this further so that each service does just one thing. Focusing on specific functionality enables you to differentiate the reliability requirements of different services, and target investments more specifically. A concise business problem and having a small team associated with each service also enables easier organizational scaling.
-
Provide service contracts per API: Service contracts are documented agreements between teams on service integration and include a machine-readable API definition, rate limits, and performance expectations. A versioning strategy allows clients to continue using the existing API and migrate their applications to the newer API when they are ready. Deployment can happen anytime, as long as the contract is not violated. The service provider team can use the technology stack of their choice to satisfy the API contract. Similarly, the service consumer can use their own technology.
Improvement Plan
Choose how to segment your workload
- SOA and microservices offer respectively smaller segmentation, which is preferred as a modern scalable and reliable architecture. However, if you have a good reason to choose a monolithic architecture, then you must ensure it’s modular and has the ability to ultimately evolve to SOA or microservices as your product scales with user adoption.
- SOA can be a good compromise for achieving smaller segmentation while avoiding some
of the complexities of microservices.
Microservice Trade-Offs - If your workload is amenable to it, and your organization can support it, you should use a microservices
architecture to achieve the best agility and reliability.
Implementing Microservices on AWS - AWS App Mesh can be used with service-oriented architectures to provide reliable discovery and access of services.
What is AWS App Mesh?
Build services focused on specific business domains and functionality
- Perform Domain Analysis to map out a domain-driven design (DDD) for your workload. Then you can choose an architecture type to meet your workload’s needs
How to break a Monolith into Microservices
Getting Started with DDD when Surrounded by Legacy Systems
Eric Evans “Domain-Driven Design: Tackling Complexity in the Heart of Software”
Implementing Microservices on AWS
- Define the API for the workload and its design goals, limits, and any other considerations
for use.
- Define the API.
- The API definition should allow for growth and additional parameters.
- Define the designed availabilities.
- Your API may have multiple design goals for different features.
- Establish limits
- Use testing to define the limits of your workload capabilities.
- Define the API.
Provide service contracts per API
Amazon API Gateway: Configuring a REST API Using OpenAPI
- A versioning strategy allows clients to continue using the existing API and migrate their applications to the newer API when they are ready.
- Amazon API Gateway is a fully managed service that makes it easy for developers to create APIs at any scale. Using the OpenAPI Specification (OAS), formerly known as the Swagger Specification, you can define your API contract and import it intro API Gateway. With API Gateway, you can then version and deploy the APIs.