25
The View from the Peak of Inflated Expectations Saul Caganoff CTO, Sixtree @scaganoff Melbourne Microservices Meetup

Microservices: The View from the Peak of Expectations

Embed Size (px)

Citation preview

Page 1: Microservices: The View from the Peak of Expectations

The View from the Peak of Inflated Expectations

Saul CaganoffCTO, Sixtree@scaganoff

MelbourneMicroservicesMeetup

Page 2: Microservices: The View from the Peak of Expectations
Page 3: Microservices: The View from the Peak of Expectations

The 2015 Hype Cycle

Page 4: Microservices: The View from the Peak of Expectations

§ Get away from the “Big Ball of Mud”

§ To go faster

§ Scale Better§ Infinite scalability (beware scale envy)§ Differential scalability

§ Organizing & scaling teams

§ Open up new capabilities§ Evolutionary architectures§ Try new ideas

Core Tenets: Culture Architecture Automation

Page 5: Microservices: The View from the Peak of Expectations

§ Depending on: Somebody else§ siloed teams: front-ends, back-ends, QA, operations

§ Shared infrastructure§ Shared database creates schema dependencies§ Shared architecture layers – message queues & orchestration§ Other people’s services

§ Shared code – shared libraries, packages, dependency management

§ Expert knowledge – no-one understands the whole system

§ Permission – centralised governance

Page 6: Microservices: The View from the Peak of Expectations

§ Small Cross-Functional Teams – give the team all they need to deliver business value – two pizza rule

§ Vertical partitioning – partition systems along vertical lines –eschew the horizontally layered architecture

§ Keep services small – so they fit in your head

§ Self-contained code – “a single unix process” (but containers)

§ Loose coupling – choreography vs orchestration

§ Standardise at the interfaces – governance only where its needed

Result: Ownership & Autonomy

Page 7: Microservices: The View from the Peak of Expectations
Page 8: Microservices: The View from the Peak of Expectations

§ Collaboration§ Shared Responsibility§ Autonomy§ Quality§ Feedback§ Automation

§ Small Teams§ Segmented on business domain, not technology§ Cross-functional§ Autonomous§ No hand-offs, no blame-shifting

Page 9: Microservices: The View from the Peak of Expectations

Domain SYSTEM ORGANIZATION

Page 10: Microservices: The View from the Peak of Expectations

Domain SYSTEM ORGANIZATION

Page 11: Microservices: The View from the Peak of Expectations
Page 12: Microservices: The View from the Peak of Expectations

Finance

Sales

Fulfilment

Product

§ Bounded Contexts are areas of cohesion in your domain model§ Boundaries appear where domain

concepts “break”

§ Bounded Contexts are the handle for organizing your§ Application§ Teams§ Runtime services

Page 13: Microservices: The View from the Peak of Expectations

§ Understand your application’s Bounded Contexts

§ Carve off a small domain (ideally non-transactional)

§ Run as microservices§ Autonomy§ Choreography with rest of the monolith§ Automation: CI/CD

§ Iterate

DON’T§ Still understand your application’s Bounded Contexts

§ But carving up a monolith adds complexity – Stefan Tilkov

Page 14: Microservices: The View from the Peak of Expectations

§ Security

§ Data Integration & Duplication

§ Monitoring

§ Deployment & Management

§ Service Registration & Discovery

§ Developer Tooling

§ Partitioning

§ (No) Transactions

§ Reporting

§ Data Migration

§ Protocols & Standards

§ Distributed Tracing & Error Handling

§ Failure & Resiliency

Page 15: Microservices: The View from the Peak of Expectations
Page 16: Microservices: The View from the Peak of Expectations

§ Standardise all the Interfaces

§ Standard API: REST (ish) or RPC – use a contract!

§ Configuration: Environment Variables

§ Logging: common format to stdout/stderr

§ Monitoring endpoints: /stats or /health

§ Events: publish standard event structures

Page 17: Microservices: The View from the Peak of Expectations

§ Configuration: environment management

§ Log correlation & tracing: § Shipping and

storage/analytics§ Dapper & Zipkin

§ Monitoring:§ Infrastructure monitoring is

not enough§ End-user experience§ Synthetic transactions

§ Event processing:§ Choreography, CQRS for

reporting

§ Service registration & discovery:§ Load-balancing, failover

§ Orchestration:§ Canary deployments§ Blue/Green Deployments

Page 18: Microservices: The View from the Peak of Expectations

§ Testing:§ Continuous integration§ Consumer-Driven Contracts

§ Resilience:§ Bulkheads§ Circuit Breakers§ Partial Failure

§ Anti-fragility: extremely difficult to test for emergent behaviours§ Failure Injection§ Simian Army

Page 19: Microservices: The View from the Peak of Expectations
Page 20: Microservices: The View from the Peak of Expectations
Page 21: Microservices: The View from the Peak of Expectations

§ All inclusive or

§ Assemble your own ”best of breed”

Page 22: Microservices: The View from the Peak of Expectations
Page 23: Microservices: The View from the Peak of Expectations

Build Test Package Docker Build

DockerRegistry

AnsibleDeploy

K8s Schedule K8s Run Docker Pull K8s

Orchestrate

§ Dozens of Services§ Project setup§ Build & Test§ Artefacts§ Deployment

§ CI and CD are important pre-requisites for microservices

Page 24: Microservices: The View from the Peak of Expectations

§ Microservices architecture adoption is growing

§ Be judicious in deciding if it’s right for you§ Architecture maturity§ DevOps and automation§ Team size

§ Infrastructure will become easier and more common

§ Culture is the harder thing to change

§ Microservices might just be the new de facto cloud-nativearchitecture ?§ And what about serverless?

Page 25: Microservices: The View from the Peak of Expectations

§ http://martinfowler.com/microservices/

§ http://microservices.io/patterns/

§ https://www.infoq.com/news/2015/06/monolith-vs-microservices

§ https://eng.uber.com/soa/

§ https://yow.eventer.com/yow-2014-1222/the-odyssey-from-monoliths-to-microservices-at-realestate-com-au-by-beth-skurrie-and-evan-bottcher-and-jon-eaves-1751

§ https://github.com/realestate-com-au/pact

§ https://www.youtube.com/channel/UCeRQROVrFDzKNq4e02ko4cw

§ http://www.meetup.com/Melbourne-Microservices/