Last year at this conference we learned from Mark Richards that modern software has almost completed its evolution toward component-based architectures—seen in the mainstream embrace of self-contained systems (SCS), microservices, and serverless architecture. We all know the benefits of component-based architectures, but there are also many challenges to delivering such applications in a continuous, safe, and rapid fashion. Daniel Bryant shares a series of patterns to help you identify and implement solutions for continuous delivery of contemporary service-based architectures.
Topics include:
- The core stages in the component delivery lifecycle: Develop, test, deploy, operate, and observe
- How contemporary architectures impact continuous delivery and how to ensure that this is factored into the design
- Modifying the build pipeline to support testability and deployability of components (with a hat tip to Jez Humble’s and Dave Farley’s seminal work)
- Commonality between delivery of SCS, microservices, and serverless components
- Continuous delivery, service contracts, and end-to-end validation: The good, the bad, and the ugly
- Validating NFRs within a service pipeline
Lessons learned in the trenches
3. tl;dr
• We are moving from complicated systems to complex systems
• Architecture is becoming more about technical leadership
• We must encode all requirements into a continuous delivery pipeline
28/02/2018 @danielbryantuk
4. @danielbryantuk
• Independent Technical Consultant
• Architecture, DevOps, Java, microservices, cloud, containers
• Continuous Delivery (CI/CD) advocate
• Leading change through technology and teams
28/02/2018 @danielbryantuk
bit.ly/2jWDSF7
7. Velocity (with stability) is key to business success
28/02/2018 @danielbryantuk
Adrian Cockcroft (2015) www.slideshare.net/Indicee/cloud-trends-2015-pdf
8. Continuous Delivery
• Produce valuable and robust software in short cycles
• Optimising for feedback and learning
• Not (necessarily) Continuous Deployment
28/02/2018 @danielbryantuk
9. Velocity (with stability) is key to business success
“Continuous delivery is achieved when stability and
speed can satisfy business demand.
Discontinuous delivery occurs when stability and speed
are insufficient.”
- Steve Smith (@SteveSmithCD)
28/02/2018 @danielbryantuk
19. 28/02/2018 @danielbryantuk
Simple
(Sense, Categorise, Respond)
Complicated
(Sense, Analyse, Respond)
Complex
(Probe, Sense, Respond)
1990s
Monoliths
Single language
In-house hardware (servers, SAN, networks)
Manual config and scripting
Optimise for Stability (MTBF)
Specialist staff/departments
2010s
Microservices, functions, SaaS-all-the-things
Polyglot languages
Cloud and containers (Datacenter as a Computer)
Software-Defined Everything
Optimise for innovation (and MTTR)
Business teams (“FinDev”, SRE and Platform Team)
2000s
Monoliths, Coarse-grained SOA, SaaS
Frontend/backend language
“Co-lo” or private datacenters
Configuration management
Optimise for Recovery (MTTR)
Generalist teams (Full Stack and “DevOps”)
Chaotic
(Act, Sense, Respond)
20. Architecture fundamentals
• Coupling
• ”Degree to which components have knowledge of other components”
• Interfaces
• Schema
• Cohesion
• “Degree to which the elements within a component belong together”
• Single reason to change
• Separation of concerns
28/02/2018 @danielbryantuk
21. Coupling, Cohesion and Continuous Delivery
• Design
• Cohesion makes reasoning easy
• Loose coupling reduces impact
• Build, unit and integration
• Cohesion limits dependencies
• Loose coupling allows simulation
• End-to-end tests
• Cohesion/coupling orchestration
• Deployment
• Cohesion minimises number of
components in play
• Coupling leads to “monoliths”
• Observability
• Cohesive is easier to understand
• High coupling typically leads to
large blast radius and “murder
mystery” style debugging
28/02/2018 @danielbryantuk
22. From monolith to…
28/02/2018 @danielbryantuk
UI / Biz / Repo
Monolith
Domains
Modules, components,
frameworks, libraries
http://scs-architecture.org/
24. 28/02/2018 @danielbryantuk
Monoliths SOA Microservices / SCS FaaS / Serverless
Scope Project Enterprise Product Feature (or glue?)
Focus Swiss Army Knife Reuse, governance,
control
Domain modelling,
SRP, evolution
Function (in/out),
rapid evolution
Organisation Implemented and
maintained (typically) by
single team
Implemented by
different org units.
Maintenance done
elsewhere
Services implemented
and owned by product
teams
Implemented by
pioneers (hipsters?)
Deployment Monolithic deployment Monolithic
orchestration of
multiple services
Services deployed
individually
Functions deployed
individually
Management None Centralised Distributed Chaotic / Orchestrated
Inter-process
communication
None RPC or messaging,
typically via
middleware (ESB/MQ)
RPC via dumb pipes
and smart endpoints,
messaging/events
Events
Pioneers /
stewards
Organisations,
community or individuals
Enterprises and
Vendors
Community and high
perf organisations
Vendors/community
Core Architectural
Constraints
Language and framework Canonical domain
model, standards
Interoperability Cost (Gbs/ms)
25. 28/02/2018 @danielbryantuk
Monoliths SOA Microservices / SCS FaaS / Serverless
Scope Project Enterprise Product Feature (or glue?)
Focus Swiss Army Knife Reuse, governance,
control
Domain modelling,
SRP, evolution
Function (in/out),
rapid evolution
Organisation Implemented and
maintained (typically) by
single team
Implemented by
different org units.
Maintenance done
elsewhere
Services implemented
and owned by product
teams
Implemented by
pioneers (hipsters?)
Deployment Monolithic deployment Monolithic
orchestration of
multiple services
Services deployed
individually
Functions deployed
individually
Management None Centralised Distributed Chaotic / Orchestrated
Inter-process
communication
None RPC or messaging,
typically via
middleware (ESB/MQ)
RPC via dumb pipes
and smart endpoints,
messaging/events
Events
Pioneers /
stewards
Organisations,
community or individuals
Enterprises and
Vendors
Community and high
perf organisations
Vendors/community
Core Architectural
Constraints
Language and framework Canonical domain
model, standards
Interoperability Cost (Gbs/ms)
35. Talking of (service) contracts…
• APIs are service contracts
• Consumer-driven Contracts
• martinfowler.com/articles/consumerDrivenContracts.html
28/02/2018 @danielbryantuk
36. Talking of (service) contracts…
28/02/2018 @danielbryantuk
docs.pact.io
cloud.spring.io/spring-cloud-contract
github.com/spring-cloud-samples/spring-cloud-contract-samples
37. Talking of (messaging) contracts…
• What about messaging?
• Message schema are an API
• www.infoq.com/presentations/contracts-streaming-microservices
28/02/2018 @danielbryantuk
38. Talking of (messaging) contracts…
28/02/2018 @danielbryantuk
www.infoq.com/presentations/contracts-streaming-microservices
docs.confluent.io/current/schema-registry/docs/maven-plugin.html
39. Contract verification
• Is it worth the cost?
• Tradeoff: Trust/comms vs time
• Startups / SMEs
• Enterprises…
• My (anecdotal) experience
• Choreography vs orchestration
28/02/2018 @danielbryantuk
48. Serverless security
“Since the OS is unreachable,
attackers will shift their attention
to the areas that remain exposed
– and first amongst those would
be the application itself.”
• Responsibility for addressing
vulnerable app libraries falls to
you – the function developer.
28/02/2018 @danielbryantuk
https://www.infoq.com/articles/serverless-security
50. Delaying NFRs to the ‘Last Responsible Moment’
Newsflash!
Sometimes the
last responsible moment
is up-front
Modern architectures don’t
necessarily make this easier
28/02/2018 @danielbryantuk
52. 28/02/2018 @danielbryantuk
Simple
(Sense, Categorise, Respond)
Complicated
(Sense, Analyse, Respond)
Complex
(Probe, Sense, Respond)
1990s
Monoliths
Single language
In-house hardware (servers, SAN, networks)
Manual config and scripting
Optimise for Stability (MTBF)
Specialist staff/departments
2010s
Microservices, functions, SaaS-all-the-things
Polyglot languages
Cloud and containers (Datacenter as a Computer)
Software-Defined Everything
Optimise for innovation (and MTTR)
Business teams (“FinDev”, SRE and Platform Team)
2000s
Monoliths, Coarse-grained SOA, SaaS
Frontend/backend language
“Co-lo” or private datacenters
Configuration management
Optimise for Recovery (MTTR)
Generalist teams (Full Stack and “DevOps”)
Chaotic
(Act, Sense, Respond)
53. 28/02/2018 @danielbryantuk
Monoliths SOA Microservices / SCS FaaS / Serverless
Scope Project Enterprise Product Feature (or glue?)
Focus Swiss Army Knife Reuse, governance,
control
Domain modelling,
SRP, evolution
Function (in/out),
rapid evolution
Organisation Implemented and
maintained (typically) by
single team
Implemented by
different org units.
Maintenance done
elsewhere
Services implemented
and owned by product
teams
Implemented by
pioneers (hipsters?)
Deployment Monolithic deployment Monolithic
orchestration of
multiple services
Services deployed
individually
Functions deployed
individually
Management None Centralised Distributed Chaotic / Orchestrated
Inter-process
communication
None RPC or messaging,
typically via
middleware (ESB/MQ)
RPC via dumb
pipes/smart
endpoints,
messaging/events
Events
Pioneers /
stewards
Organisations,
community or individuals
Enterprises and
Vendors
Community and high
perf organisations
Vendors/community
Core Architectural
Constraints
Language and framework Canonical domain
model, standards
Interoperability Cost
54. 28/02/2018 @danielbryantuk
Monoliths SOA Microservices / SCS FaaS / Serverless
Cohesion and coupling
enforced at modules
CD focuses on unit and
end-to-end
functionality
Provide goals and “best
practice” examples
Cohesion and
coupling enforced at
service level
CD focuses on
service integrity
Provide objectives
and standards
Cohesion and
coupling enforced at
service API level
CD focuses on
service interaction
Provide principles,
guidelines and
“good practice”
Cohesion and
coupling enforced at
function API level
CD focuses on service
orchestration+output
Provide principles,
guidelines and “good
practice”
55. In conclusion…
• We are moving from complicated systems to complex systems
• Design and test with coupling and cohesion in mind
• Architecture is becoming more about technical leadership
• Recognise your situation and influence accordingly
• We must encode all requirements into a continuous delivery pipeline
• Both functional and nonfunctional requirements
28/02/2018 @danielbryantuk
56. Thanks for listening…
Twitter: @danielbryantuk
Email: daniel.bryant@tai-dev.co.uk
Writing: https://www.infoq.com/profile/Daniel-Bryant
Talks: https://www.youtube.com/playlist?list=PLoVYf_0qOYNeBmrpjuBOOAqJnQb3QAEtM
28/02/2018 @danielbryantuk
Early Access edition
book signing at the
O’Reilly booth now!