Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Building Microservices with the 12 Factor App Pattern on AWS

Nathan Peck
December 13, 2017

Building Microservices with the 12 Factor App Pattern on AWS

The 12 factor app pattern is a set of principles for building a modern, scalable application that operates reliably and integrates well with other applications.

Microservices are an architectural approach that allows an organization to build complex infrastructure out of smaller, more simple distributed application components that enable parallelization of development effort.

Combining 12 factor principles with microservices allows an organization to create a massively scaleable software solution that will operate well.

Nathan Peck

December 13, 2017
Tweet

More Decks by Nathan Peck

Other Decks in Technology

Transcript

  1. Compute Evolved Week Building Microservices with the 12 Factor App

    Pattern on AWS Nathan Peck Developer Advocate, Container Services
  2. Dependency Isolation Never depend on the host to have your

    dependency. Application deployments should carry all their dependencies with them.
  3. AWS S3 PostgreSQL app1 Host app2 3rd party service Treat

    local services just like remote third party ones
  4. Stateful container stores state in local disk or local memory.

    Workload ends up tied to a specific host that has state data.
  5. Stateful container stores state in local disk or local memory.

    Workload ends up tied to a specific host that has state data. ANTIPATTERN
  6. Fast Launch Minimize the startup time of processes: - Scale

    up faster in response to spikes - Ability to move processes to another host as needed - Replace crashed processes faster
  7. Treat logs as an event stream, and keep the logic

    for routing and processing logs separate from the application itself.
  8. Logging Library Application Code Process Some logs get lost if

    they haven’t fully flushed ANTIPATTERN
  9. Processes Logging Agent Application Code Logs go to an agent

    which handles exporting them off the host
  10. Admin / management processes are inevitable: - Migrate database -

    Repair some broken data - Once a week move database records older than X to cold storage - Every day email a report to this person
  11. Each component is a 12 factor application. Fast Launch Dependencies

    Configuration Port Binding Codebase Concurrent Graceful stop Log stream Stateless
  12. Example: User Signup Signup API HTTP User Metadata Service Password

    Service Email Verification Service Friend Discovery Service Asynchronous Broadcast
  13. Automate the provisioning of the servers that host microservice containers:

    Terraform, Ansible, Amazon CloudFormation Automate the placement of containerized service processes onto hosts: Amazon Elastic Container Service, Kubernetes, Docker Swarm
  14. Developers Version Control Repository Test & Deployment Manager Image Build

    Service Infrastructure Provisioning Container Scheduling & Orchestration Container Image Repository
  15. 12 factor application principles Fast Launch Dependencies Configuration Port Binding

    Codebase Concurrent Graceful stop Log stream Stateless