building better software faster
TRANSCRIPT
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 1
@aahoogendoorn | www.ditisagile.nl
Buildingbettersoftwarefaster
Sander Hoogendoornditisagile.nl
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 2
Sander Hoogendoorn
MeDad, software architect, agile coach, programmer, trainer, speaker, writerBooks, articles, conferences, courses
WorkOwner ditisagile.nlCTO ANVAFormer CTO insurance companyFormer global agile thoughtleader Capgemini
Webwww.sanderhoogendoorn.comaahoogendoornaahoogendoorn [email protected]
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 4
As a project managerI would like to demo untested code so I embarrass myself
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 5
@aahoogendoorn | www.ditisagile.nl
The Times They Are a-Changin'
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 6
Moore’s LawThe number of transistors in a dense integrated circuit doubles approximately every two years.
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 10
@aahoogendoorn | www.ditisagile.nl
The Times They Are a-Changin'On our block
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 14
Too much, too soon Hard to deliver, harder to test, impossible to maintain
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 20
@aahoogendoorn | www.ditisagile.nl
MicroservicesA definition
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 21
MicroservicesIn short, the microservice architectural style is an approach to developing a single application as a suite of small services, each running in its own process and communicating with lightweight mechanisms, often an HTTP resource API.
These services are built around business capabilities and independently deployable by fully automated deployment machinery. There is a bare minimum of centralized managementof these services, which may be written in different programming languages and use different data storage technologies.
Martin Fowler
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 23
@aahoogendoorn | www.ditisagile.nl
From the trenchesMicroservices in real life
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 24
For the things we have to learn before we can do them, we learn by doing them
Aristotle
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 26
Microservices require an evolutionary software architecture
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 27
@aahoogendoorn | www.ditisagile.nl
Some guidingprinciplesBusiness processes first
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 28
We implement business processesWe move towards a systems landscape consisting of micro-applications and micro-componentsRequirements are modeled (in smart use cases)Micro-applications implement a single elementary business processMicro-applications and micro-components all have their own bounded contextMicro-applications do not have storage, and only talk to other micro-applications and micro-componentsMicro-components have their own storage (in MongoDB), and only talk to other micro-componentsCommunication uses a simple open protocol – JSON on REST We avoid transactions as much as possible
Some guiding principles
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 31
Presentation
Process
Domain
Services
Outside world
PagesGrids, Panels, Controls
Use casesFlow
Factories, RepositoriesEntities, Enums, Value objects
Gateways
ComponentsRelations Dossiers Intermediaries Accounts Rates
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 32
Service interface
Process
Domain
Data / Services
Outside world
ResourcesRepresentations
Use casesFlow
Factories, RepositoriesEntities, Enums, Value objects
Gateways
StorageRelations Dossiers Intermediaries MongoDB
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 33
@aahoogendoorn | www.ditisagile.nl
Designing microservicesModular design and bounded contexts
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 34
Doing big up-front design is dumb, doing no design up-front is even dumber
Dave Thomas
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 36
Single responsibility principleGroup together things that change togetherSeparate things that change for different reason
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 37
Bounded contextWhen you model larger domains, it becomes progressively harder to create this single unified model. Instead of creating a single unified model, you create several, all valid within their bounded context
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 38
The single unified domain modelOr more often the humongous data model
Product
Vendor
Stock
Order
Client
Delivery
Payment
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 39
Bounded contexts
Product
Vendor
Stock
Order
Client
Delivery
Payment
Product
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 44
@aahoogendoorn | www.ditisagile.nl
Testing microservicesFailing fast
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 45
Fail fast, fail often, fail forward
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 46
Manual tests
Scenario tests
Integration tests
Unit tests
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 47
Manual tests
Scenario tests
API tests
Unittests
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 48
A development lifecycleWhat to test?
Code Developer Test Test Integration
TestAcceptance
Test LivePrepareand Design
DevelopersUnit tests
DevelopersPeer review
TestersScenario’sAnd API’s
TestersScenario’sand API’s
Product ownerProduct
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 49
Even though you might have really brilliant testers…
ExploratoryTesting,anyone?
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 52
@aahoogendoorn | www.ditisagile.nl
Deploying microservicesContinuous integrationand build pipelines
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 53
How often do you deploy to production?
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 54
A typical build pipeline
Code Developer Test Test Integration
TestAcceptance
Test LivePrepare and Design
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 55
ProductionAcceptanceIntegrationTestDevelopment
A typical build pipelineTraditional (virtual) infrastructure
Code Developer Test Test Integration
TestAcceptance
Test LivePrepare and Design
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 56
ProductionProvisionedProvisionedProvisionedDevelopment
A typical build pipelineProvisioned infrastructure (on the fly)
Code Developer Test Test Integration
TestAcceptance
Test LivePrepare and Design
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 58
Microservices Building multiple deployment pipelines
Code Developer Test Test Acceptance
Test Acceptance Live
Code Developer Test Test Acceptance
Test Acceptance Live
Code Developer Test Test Acceptance
Test Acceptance Live
Code Developer Test Test Acceptance
Test Acceptance Live
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 60
@aahoogendoorn | www.ditisagile.nl
AgilebeyondScrumTowards continuously delivering software
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 64
Minimal viable productsThink small, deploy early and frequently
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 66
Roadmaps over plansWhile there is value in the items on the right, we value the items on the left more
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 68
Continuous delivery An approach in which teams ensure that every change to the system is releasable, and that we can release any version at the push of a button.
Aimed to make releases boring, so we can deliver frequently and get fast feedback on what users care about.Jez Humble
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 71
@aahoogendoorn | www.ditisagile.nl
In retrospectiveSome final thoughts
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 72
The times are a-changin’How are we going to keep up?
Towardsmicro-applications and microservices
Modelingrequirements
Focus oncore
technologies
Continuousdelivery
Minimal viableproducts
Rationalizeour legacy
Domain driven design
Leveragethe cloud
@aahoogendoorn | www.ditisagile.nlBuilding better software faster 74
@aahoogendoorn | www.ditisagile.nl
References and questions
www.sanderhoogendoorn.com
www.ditisagile.nl
aahoogendoorn
aahoogendoorn