Introduction - Running Containerized Microservices on AWS

Introduction

As modern, microservices-based applications gain popularity, containers are an attractive building block for creating agile, scalable, and efficient microservices architectures. Whether you are considering a legacy system or a greenfield application for containers, there are well-known, proven software design patterns that you can apply.

Microservices are an architectural and organizational approach to software development in which software is composed of small, independent services that communicate to each other. There are different ways microservices can communicate, but the two commonly used protocols are HTTP request/response over well-defined APIs, and lightweight asynchronous messaging. These services are owned by small, self-contained teams. Microservices architectures make applications easier to scale and faster to develop. This enables innovation and accelerates time-to-market for new features. Containers also provide isolation and packaging for software, and help you achieve more deployment velocity and resource density.

As proposed by Martin Fowler, the characteristics of a microservices architecture include the following:

  • Componentization via services

  • Organized around business capabilities

  • Products not projects

  • Smart endpoints and dumb pipes

  • Decentralized governance

  • Decentralized data management

  • Infrastructure automation

  • Design for failure

  • Evolutionary design

These characteristics tell us how a microservices architecture is supposed to behave. To help achieve these characteristics, many development teams have adopted the twelve-factor app pattern methodology. The twelve factors are a set of best practices for building modern applications that are optimized for cloud computing. The twelve factors cover four key areas: deployment, scale, portability, and architecture:

  1. Codebase - One codebase tracked in revision control, many deploys

  2. Dependencies - Explicitly declare and isolate dependencies

  3. Config - Store configurations in the environment

  4. Backing services - Treat backing services as attached resources

  5. Build, release, run - Strictly separate build and run stages

  6. Processes - Execute the app as one or more stateless processes

  7. Port binding - Export services via port binding

  8. Concurrency - Scale out via the process model

  9. Disposability - Maximize robustness with fast startup and graceful shutdown

  10. Dev/prod parity - Keep development, staging, and production as similar as possible

  11. Logs - Treat logs as event streams

  12. Admin processes - Run admin/management tasks as one-off processes

After reading this whitepaper, you will know how to map the microservices design characteristics to twelve-factor app patterns, down to the design pattern to be implemented.