simple, battle proven microservices strategy
TRANSCRIPT
About microservicesdeveloping a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms … independently deployable by fully automated deployment machinery.
… each service also provides a firm module boundary, even allowing for different services to be written in different programming languages. They can also be managed by different teams …
...decomposed into multiple services, you can expect many single service changes to only require that service to be redeployed.
James Lewis, Martin Fowler - Microservices a definition of this new architectural term
About microservicesdeveloping a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms … independently deployable by fully automated deployment machinery.
… each service also provides a firm module boundary, even allowing for different services to be written in different programming languages. They can also be managed by different teams …
...decomposed into multiple services, you can expect many single service changes to only require that service to be redeployed.
HighFocus
Photo by Philippe Henry, available under a Creative Commons Attribution-Noncommercial license.
Limited Scope
IndependantPhoto by PEXELS, available under a CC0 license.
Simple
API
➔ Create a buffer layer for isolation.
➔ Also useful for caching, monitoring, error handling, mocking, etc`
ConsumeMy Special Service
Used by me
Using me
Produce
WhereLocal dev machine.WhatUnit, Component & Integration tests.
WhenBefore commit and as much as possible
ArtifactEasy checkout, change, and run
Local build
Centralized Build
Artifact Bake
Automated Staging
Production
Local build
Centralized Build
Artifact Bake
Automated Staging
ProductionWhereCI Server, Feature branchWhatUnit, Component & Integration tests.
WhenEach commit (PR)
Artifact“Mergability”
Local build
Centralized Build
Artifact Bake
Automated Staging
ProductionWhereCI Server, Master branchWhatUnit, Component & Integration tests.
WhenEach commit (Pull Request merge)
ArtifactNext Production (Immutable Infrastructure).
Local build
Centralized Build
Artifact Bake
Automated Staging
ProductionWhereCD Server,Dedicated testing envWhatDeploy next production, execute Smoke Test
WhenWhenever a new artifact is baked
ArtifactConfidence in next production
Local build
Centralized Build
Artifact Bake
Automated Staging
ProductionWhereCD Server,ProductionWhatGreen-Blue / Canary Execute relevant checks.
WhenAfter a baked artifact is verified in staging
Speed is Queen
Backward Compatibility is King
Photo by michael iCruz, available under a Creative Commons Attribution-Noncommercial license.
Backward CompatibilityDon’t➔ Couple
deployment of multiple services
➔ Big bang migrations, especially with down time
Photo by Pierre J., available under a CC Attribution-Noncommercial-ShareAlike 2.0 Generic license.
Backward CompatibilityDo➔ Many small
changes through
multiple services
➔ Decouple data
migration from
logic change
Backward Compatibility
API
Data
Logic
● Use ‘Data Only’ protocol (Json,
protobuf, etc’)
● Serialization tests
Backward Compatibility
API
Data
Logic
● Load and Save test - Keep old data
records for tests.
● Refresh staging data from
production.
○ Can be part of a ‘Smoke Test’
Backward Compatibility
API
Data
Logic
● What counts for broken
compatibility logic?
● Changing / removing Component
tests is a red signal.
● Prefer degraded service over broken
service
Melvin E. ConwayAny organization that designs a system … will produce a design whose structure is a copy of the organization's communication structure