00 Intro to Microservices - kimschles/schlesinger-knowledge GitHub Wiki

Modern Microservices: An Introduction

Daniel Williams: June 21, 2018 (https://github.com/kenzanlabs/modernmicroservices)

Platforms & Infrastructure

  • Must have an API
    • SSH is not an API (talking to you, Ansible)
  • Must be automatable
  • Must have software defined networking (SDN)
    • Virtual networking
    • Allows reconfiguration of the network via API control
    • Examples: AWS or GCP VPC
  • Service Meshes are good
    • Example: Istio
    • Advanced proxying system
    • Often handles load balancing, app request routing, circuit breaking
  • Storage
    • Generally block storage
    • Example:
      • Elastic Block Storage (EBS)
      • K8s: EKS, GKE, KOPS
      • Amazon EC2
      • GCC
      • OpenStack
      • Ubuntu's MAAS

Continuous Delivery Tools

  • Must have an API
  • Must be automatable
  • Must have triggers (for example, upon a successful build, deploy to to test env)
  • Pipeline Diagram
  • Must have service discovery
    • Allows a microservice to find other needed microservices
  • Must have health checks
    • Verifies the microservice is running and happy
    • Can be built into the microservice, or handled by a sidecar, or handled by an external service
  • Integration and canary testing happens here
  • Examples:
    • Spinnaker
    • Titus
    • AWS CodeDeploy, CodePipeline, CloudFormation
    • Eureka, consul, etcd, AWS LBs
    • Terraform
    • Ansible
    • Chef and Puppet

Continuous Integration Tools

  • Must have an API
  • Must be automatable
  • Must have triggers
  • Must have source storage (repos)
  • Artifact storage is nice to have and required for larger systems
  • Unit and component testing happens here
  • Pipline digram
  • Examples:
    • Github, GitLab, BitBucket, Git
    • Jenkins, TravisCI, GitLabCI, CircleCI
    • AWS and GCP Built Ins
    • Docker Repos
    • Code Analysis (a linter)

Applications: Data Layer

  • Databases
  • Deployments don't get cycled often
  • This is where the $$$ is
  • Disaster recovery testing happens here
  • Examples:

Applications: Microservices

  • Must have APIs
  • Logic happens here
  • Try to be event driven
  • The Unix Paradigm/SRP: Do only one thing, but do it very well
  • 12 Factor App
  • Use well defined interfaces; programming language shouldn't matter
  • Circuit breaker pattern (loopback, hystrix, etc)
  • Other patterns
    • Service discovery
    • Sidecar
    • No config in artifacts! Get configuration from the enviornment
  • Examples
    • Swagger (soon to be called OpenAPI spec)
    • Python + Flask
    • Node.js + Loopback
    • Go
  • Example of an app that uses multiple microservices:

Example App: Capstan