This articles is taken from Michael Herman's testdrivenio
Ideally...
- All services are configured programmatically by an API.
- Events are the driving force (event-driven, pub/sub model, trigger/action)
- Documentation is a first-class citizen.
- Live and die with 12-factor
- Services should have a single purpose (do one thing and do it well), be loosely coupled (know little about each other), and have high cohesion (encapsulates all related functionality and data together).
APIs, events, and docs!
- Application
- Pipelines
- Platform
Where the services themselves live...
- APIs
- Storage
- Docs
- Powered by web frameworks (Java/Spring Boot, Python/Flask, Node/Express)
- Languages and frameworks don't matter as much as solid API contracts
- Single Responsibility (think
ls
, do one thing and do it well) - 12 Factor
- Immutability!!!
- Documentation is key - Swagger / OpenAPI spec
- How do you handle auth? Do service talk on each other or to a single API Gateway?
Tools:
- Databases (Mongo, Postgres, Redis)
- Task Queues
- Message Brokers (RabbitMQ, Kafka)
Issues:
- Storage is a hard problem.
- Containers are ephemeral, data is not.
- Do you have a database per service or a shared database?
- Disaster recovery? Testing?
Infrastructure management...
- Software defined networks
- Service discovery
- Health checks (side cars approach)
- Logging
- Monitoring
- Load balancing
- Path-based routing
- Circuit breaking
- Kubernetes
- Docker Swarm
- Mesos
- Nomad
- Fully-managed: EKS, GKE, ECS
- Ubuntus MAAS (metal as a service)
- OpenStack
Triggers:
- Commit to source repo, build and test project
- What else?
- Github, GitLab, Git
- Jenkins, Travis, Circle
- AWS, GCP, Azure
- Docker Repos
- Linters, static code analysis
Triggers:
- On successful build, deploy
- What else?
- Shell scripts (yuk!)
- Fabric (shell scripts on steroids)
- Terraform templates
- AWS (CodeDeploy, CodePipeline, CloudFormation), GCP, Azure
- Concourse
- Spinnaker
- Old school (Ansible, Chef, Puppet)