SlideShare ist ein Scribd-Unternehmen logo
1 von 77
Migrating to Cloud Native with Microservices 
Adrian Cockcroft @adrianco June 2014
Watch the video with slide 
synchronization on InfoQ.com! 
http://www.infoq.com/presentations 
/migration-cloud-microservices 
InfoQ.com: News & Community Site 
• 750,000 unique visitors/month 
• Published in 4 languages (English, Chinese, Japanese and Brazilian 
Portuguese) 
• Post content from our QCon conferences 
• News 15-20 / week 
• Articles 3-4 / week 
• Presentations (videos) 12-15 / week 
• Interviews 2-3 / week 
• Books 1 / month
Presented at QCon New York 
www.qconnewyork.com 
Purpose of QCon 
- to empower software development by facilitating the spread of 
knowledge and innovation 
Strategy 
- practitioner-driven conference designed for YOU: influencers of 
change and innovation in your teams 
- speakers and topics driving the evolution and innovation 
- connecting and catalyzing the influencers and innovators 
Highlights 
- attended by more than 12,000 delegates since 2007 
- held in 9 cities worldwide
‹#› | Battery Ventures
‹#› | Battery Ventures 
Typical reactions to my Netflix talks… 
“You guys are 
crazy! Can’t 
believe it” 
– 2009 
“What Netflix is doing 
won’t work” 
– 2010 It only works for 
‘Unicorns’ like 
Netflix” 
– 2011 
“We’d like to do 
that but can’t” 
– 2012 
“We’re on our way using 
Netflix OSS code” 
– 2013
‹#› | Battery Ventures 
What I learned from my time at Netflix 
● Speed wins in the marketplace 
● Remove friction from product development 
● High trust, low process, no hand-offs between teams 
● Freedom and responsibility culture 
● Don’t do your own undifferentiated heavy lifting 
● Use simple patterns automated by tooling 
● Self service cloud makes impossible things instant
‹#› | Battery Ventures 
Enterprise IT Adoption of Cloud 
By Simon Wardley http://enterpriseitadoption.com/ 
Now 
%*&!”
‹#› | Battery Ventures 
Speed 
Innovation 
New Ideas 
New Products
What separates 
incumbents from 
disruptors? 
‹#› | Battery Ventures
‹#› | Battery Ventures 
Assumptions
‹#› | Battery Ventures 
Optimizations
“It isn't what we don't know 
that gives us trouble, it's 
what we know that ain't so.” 
‹#› | Battery Ventures 
Will Rogers 
http://www.brainyquote.com/quotes/quotes/w/willrogers385286.html
‹#› | Battery Ventures 
Incumbents 
follow the $$$ 
Market size lags disruption because high price products are replaced by low priced products
‹#› | Battery Ventures 
Disruptors 
Take what used to be expensive 
learn to “waste” them 
to save money elsewhere
‹#› | Battery Ventures 
Examples
Solid State Disk 
‹#› | Battery Ventures 
Example
Storage systems 
assume random 
reads are expensive 
‹#› | Battery Ventures 
Decades of filesystems and storage array development based on spinning rust
‹#› | Battery Ventures 
RR is free 
Immutable writes 
Log-merge 
SSD works best for random reads and sequential writes. Bad for updates.
SSD packaging 
as disk, as PCI card 
now as memory DIMM 
‹#› | Battery Ventures 
Each generation reduces overhead and improves price/performance
‹#› | Battery Ventures 
Disclosure: Diablo Technologies is a Battery Ventures Portfolio Company 
See www.battery.com for a list of portfolio investments
‹#› | Battery Ventures 
Traditional vs. Cloud Native Storage Architectures 
Business 
Logic 
Database 
Master 
Fabric 
Storage 
Arrays 
Database 
Slave 
Fabric 
Storage 
Arrays 
Business 
Logic 
Cassandra 
Zone A nodes 
Cassandra 
Zone B nodes 
Cassandra 
Zone C nodes 
Cloud Object 
Store Backups 
SSDs inside 
ephemeral 
instances 
disrupt an 
entire industry 
SSDs inside 
arrays disrupt 
incumbent 
suppliers
‹#› | Battery Ventures 
How to Scale Storage Beyond Ludicrous 
● Cassandra scalability 
● Linear scale up benchmarked and seen in production 
● Hundreds of nodes per cluster in common use today 
● Thousands of nodes per cluster actively being tested and used 
● Cassandra scale using high end AWS storage instances 
● EC2 i2.8xlarge - over 300,000 iops read or write, 6.4TB of SSD 
● 100 nodes = 30 million iops and 640 TB - Ludicrous 
● 1000 nodes = 300 million iops and 6.4 PB - Plaid! 
http://techblog.netflix.com/2011/11/benchmarking-cassandra-scalability-on.html
‹#› | Battery Ventures 
Disruptor 
Cassandra 
Perfect match for SSD, no write amplification, no updates, scales to plaid
‹#› | Battery Ventures 
Product 
Development 
Another disruptive example
Assumption: 
Process prevents 
‹#› | Battery Ventures 
problems 
Another disruptive example
Hardware provisioning is undifferentiated heavy lifting – replace it with IaaS 
‹#› | Battery Ventures 
Non-Cloud Product Development 
Months before you find out whether the product meets the need 
Business 
Need 
• Documents 
• Weeks 
Approval 
Process 
• Meetings 
• Weeks 
Hardware 
Purchase 
• Negotiations 
• Weeks 
Software 
Development 
• Specifications 
• Weeks 
Deployment and 
Testing 
• Reports 
• Weeks 
Customer 
Feedback 
• It sucks! 
• Weeks 
IaaS 
Cloud
Process Hand-Off Steps for Product Development on IaaS 
‹#› | Battery Ventures 
Product Manager 
Development Team 
QA Integration Team 
Operations Deploy 
Team 
BI Analytics Team
Software provisioning is undifferentiated heavy lifting – replace it with PaaS 
‹#› | Battery Ventures 
IaaS Based Product Development 
Weeks before you find out whether the product meets the need 
Business Need 
• Documents 
• Weeks 
Software Development 
• Specifications 
• Weeks 
Deployment and Testing 
• Reports 
• Days 
Customer Feedback 
• It sucks! 
• Days 
PaaS 
Cloud 
etc…
Process Hand-Off Steps for Feature Development on PaaS 
‹#› | Battery Ventures 
Product Manager 
Developer 
BI Analytics Team
Business Need 
• Discussions 
• Days 
Software Development 
• Code 
• Days 
Building your own business apps is undifferentiated heavy lifting – use SaaS 
‹#› | Battery Ventures 
PaaS Based Product Feature Development 
Days before you find out whether the feature meets the need 
Customer Feedback 
• Fix this Bit! 
• Hours 
SaaS/ 
BPaaS 
Cloud 
etc…
and thousands more… 
‹#› | Battery Ventures 
SaaS Based Business App Development 
Business Need 
•GUI Builder 
•Hours 
Hours before you find out whether the feature meets the need 
Customer Feedback 
•Fix this bit! 
•Seconds
‹#› | Battery Ventures 
What Happened? 
Rate of change 
increased 
Cost and size and 
risk of change 
reduced
BIG DATA 
‹#› | Battery Ventures 
Land grab 
opportunity Competitive 
Observe 
Orient 
Decide 
Measure 
Customers 
Act 
Move 
Customer Pain 
Point 
Analysis 
Plan 
Response 
JFDI 
Share Plans 
Launch AB 
Test 
Automatic 
Deploy 
Incremental 
Features 
Model 
Hypotheses 
INNOVATION 
CULTURE 
CLOUD 
Continuous 
Delivery on 
Cloud
Monolithic development model has a coordination bottleneck and replacement risk ‹#› | Battery Ventures 
Release Plan 
Developer 
Developer 
Developer 
Developer 
Developer 
QA Release 
Integration 
Ops 
Replace Old 
With New
Developer 
Feature Plan 
Developer 
Deploy 
Feature to 
Production 
Microservices based continuous delivery scales with large development teams and is nondestructive ‹#› | Battery Ventures 
Feature Plan 
Deploy 
Feature to 
Production 
Stable 
Components 
In Use 
Old Unused 
Components
‹#› | Battery Ventures 
Non-Destructive Production Updates 
● “Immutable Code” Service Pattern 
● Existing services are unchanged, old code remains in service 
● New code deploys as a new service group 
● No impact to production until traffic routing changes 
● A|B Tests, Feature Flags and Version Routing control traffic 
● First users in the test cell are the developer and test engineers 
● A cohort of users is added looking for measurable improvement 
● Finally make default for everyone, keeping old code for a while
‹#› | Battery Ventures 
Disruptor 
Continuous Delivery 
Compute capacity is an ephemeral commodity, learn to waste it to save time and get agility
‹#› | Battery Ventures 
Development and 
Operations 
Another disruptive example, if you assume they don’t mix…
Developers make code 
‹#› | Battery Ventures
Operations run code 
‹#› | Battery Ventures
It can take weeks to get 
a VM after a developer 
‹#› | Battery Ventures 
files a ticket…
But if operations is a 
self service API… 
‹#› | Battery Ventures
Developers run their 
‹#› | Battery Ventures 
own code
Developers are on call 
‹#› | Battery Ventures
‹#› | Battery Ventures 
Developers have 
freedom
‹#› | Battery Ventures 
Developers have 
incentives to be 
responsible 
Avoids the externalities of over-dependence on operations to fix everything
‹#› | Battery Ventures 
Less down time 
With the right incentives and tooling developers write code that scales and doesn't break
‹#› | Battery Ventures 
No meetings 
Developers end up spending more time developing than when they had to keep explaining their code to ops
DevOps is a re-org, not 
a new team to hire 
‹#› | Battery Ventures 
For most companies, the cultural transformation needed to do DevOps is the blocker
‹#› | Battery Ventures 
Disruptor 
High Trust Culture 
DevOps 
Give up central coordination and control, to get speed and align incentives
‹#› | Battery Ventures 
It’s what you know that isn’t so… 
● Make your assumptions explicit 
● Extrapolate trends to the limit 
● Listen to non-customers 
● Follow developer adoption, not IT spend 
● Map evolution of products to services to utilities 
● Re-organize your teams for speed of execution
How do we get there? 
‹#› | Battery Ventures
"This is the IT swamp draining manual for anyone who is neck deep in alligators.” 
‹#› | Battery Ventures
‹#› | Battery Ventures 
Once you’re out of the swamp, read this…
‹#› | Battery Ventures 
Open Source Ecosystems 
● The most advanced, scalable and stable code you can get is OSS 
● No procurement cycle, fix and extend it yourself 
● Github is a developer’s online resume 
● Github is also your company’s online resume! 
● Extensible platforms create ecosystems 
● Give up control to get ubiquity – Apache license 
Innovate, Leverage and Commoditize
‹#› | Battery Ventures 
Cloud Native for High Availability 
● Business logic isolation in stateless micro-services 
● Immutable code with instant rollback 
● Auto-scaled capacity and deployment updates 
● Distributed across availability zones and regions 
● De-normalized single function NoSQL data stores 
● See over 40 NetflixOSS projects at netflix.github.com 
● Get “Technical Indigestion” trying to keep up with techblog.netflix.com
‹#› | Battery Ventures 
A Microservice Definition 
Loosely coupled service oriented 
architecture with bounded contexts 
See http://en.wikipedia.org/wiki/Domain-driven_design for discussion of bounded contexts
‹#› | Battery Ventures 
Scaling Continuous Delivery Models 
Monolithic Microservices 
● Devs book a train ticket 
● Everyone runs the monolith 
● Queue for the next train 
● Coordination chat session 
● Need to learn deploy process 
● Copy code to existing servers 
● Few concurrent versions 
● Tens of monolithic updates/day maximum 
● Roll-forward only 
● “Done” is released to prod 
● Everyone has their own build 
● Dev runs their own microservice 
● No waiting, no meetings 
● API call to update prod timeline 
● Automated hands-off deploy 
● Immutable code on new servers 
● Unlimited concurrent versions 
● 100s of independent updates 
● Roll-back in seconds 
● “Done” is retired from prod
Separate Concerns Using Micro-services 
● Invert Conway’s Law – teams own service groups and backend stores 
● One “verb” per single function micro-service, size doesn’t matter 
● One developer independently produces a micro-service 
● Each micro-service is it’s own build, avoids trunk conflicts 
● Deploy in a container: Tomcat, AMI or Docker, whatever… 
● Stateless business logic. Cattle, not pets. 
● Stateful cached data access layer can use ephemeral instances 
‹#› | Battery Ventures 
http://en.wikipedia.org/wiki/Conway's_law
‹#› | Battery Ventures 
Microservices Development Architecture 
● Client libraries 
Even if you start with a raw protocol, a client side driver is the end-state 
Best strategy is to own your own client libraries from the start 
● Multithreading and Non-blocking Calls 
Reactive model RxJava uses Observable to hide concurrency cleanly 
Netty can be used to get non-blocking I/O speedup over Tomcat container 
● Circuit Breakers – See Fluxcapacitor.com for code 
NetflixOSS Hystrix, Turbine, Latency Monkey, Ribbon/Karyon 
Also look at Finagle/Zipkin from Twitter
‹#› | Battery Ventures 
Microservice Datastores 
● Book: Refactoring Databases 
SchemaSpy to examine schema structure 
Denormalization into one datasource per table or materialized view 
● Polyglot Persistence 
Use a mixture of database technologies, behind REST data access layers 
See NetflixOSS Storage Tier as a Service HTTP (staash.com) for MySQL and C* 
● CAP – Consistent or Available when Partitioned 
Look at Jepsen torture tests for common systems aphyr.com/tags/jepsen 
There is no such thing as a consistent distributed system, get over it…
‹#› | Battery Ventures 
Strategies for impatient product managers 
● Carrot 
“This new feature you want will be ready faster as a microservice” 
● Stick 
“This new feature you want will only be implemented in the new 
microservice based system” 
● Shiny Object 
“Why don’t you concentrate on some other part of the system while we get 
the transition done?”
‹#› | Battery Ventures 
Monitoring and 
Microservices
‹#› | Battery Ventures 
Issues with Continuous Delivery and Microservices 
● High rate of change 
Code pushes can cause floods of new instances and metrics 
Short baseline for alert threshold analysis – everything looks unusual 
● Ephemeral Configurations 
Short lifetimes make it hard to aggregate historical views 
Hand tweaked monitoring tools take too much work to keep running 
● Microservices with complex calling patterns 
End-to-end request flow measurements are very important 
Request flow visualizations get overwhelmed
‹#› | Battery Ventures 
Microservice Based Architectures 
From a Gilt Groupe Presentation 
See http://www.slideshare.net/LappleApple/gilt-from-monolith-ruby-app-to-micro-service-scala-service-architecture
Netflix Gilt Groupe (12 of 450) Twitter 
‹#› | Battery Ventures 
“Death Star” Architecture Diagrams 
As visualized by Appdynamics, Boundary.com and Twitter internal tools
Continuous Delivery and DevOps Implications 
●Changes are smaller but more frequent 
● Individual changes are more likely to be broken 
●Changes are normally deployed by developers 
● Feature flags are used to enable new code 
● Instant detection and rollback matters much more 
‹#› | Battery Ventures
1st high metric 
processed 
(maybe) 
Three datapoints on 
user graph so looks 
bad at 8m00. 
1st high metric 
seen on graph 
‹#› | Battery Ventures 
What’s wrong with measuring in minutes? 
Takes too long to see a problem 
5 
4 
3 
2 
1 
0 
1st high metric arrives at 
monitoring system 
Metric Threshold 
Something broke 
at 2m20 
40s of failure 
didn’t trigger 
1st high metric 
seen at agent on 
instance 
Minute 1 Minute 2 Minute 3 Minute 4 Minute 5 Minute 6 Minute 7
Whoops! I didn’t mean that! Reverting… 
Not cool if it takes 5 minutes to see it failed and 5 more to see a fix 
No-one notices if it only takes 5 seconds to detect and 5 to see a fix 
‹#› | Battery Ventures
1st high metric 
processed 
Three datapoints on 
user graph so looks 
bad at 2m25. 
1st high metric 
seen on graph 
‹#› | Battery Ventures 
Try that again by the second 
More confidence more quickly 
1st high metric arrives at 
monitoring system 
Threshold 
5 
4 
3 
2 
1 
0 
Something broke 
at 2m20 
Measurable in 
1s 
1st high metric 
seen at agent on 
instance 
Minute 1 Minute 2 Minute 3 Minute 4 Minute 5 Minute 6 Minute 7
NetflixOSS Hystrix / Turbine Circuit Breaker Monitoring 
Streaming metrics directly from services to a web browser each second 
‹#› | Battery Ventures 
http://techblog.netflix.com/2012/12/hystrix-dashboard-and-turbine.html
‹#› | Battery Ventures 
Latest SaaS Based Monitoring Products 
Seeing Problems In Seconds 
www.vividcortex.com and www.boundary.com
Metric to display latency needs to be 
less than human attention span (~10s) 
‹#› | Battery Ventures
‹#› | Battery Ventures 
Summary 
● Speed wins in the marketplace 
● Remove friction from product development 
● High trust, low process 
● Freedom and responsibility culture 
● Don’t do your own undifferentiated heavy lifting 
● Simple patterns automated by tooling 
● Microservices for speed and availability
Separation of Concerns 
Bounded Contexts 
‹#› | Battery Ventures
‹#› | Battery Ventures 
Any Questions? 
● Battery Ventures http://www.battery.com 
● Adrian’s Blog http://perfcap.blogspot.com 
● Slideshare http://slideshare.com/adriancockcroft 
● Monitorama Opening Keynote Portland OR - May 7th, 2014 
● GOTO Chicago Opening Keynote May 20th, 2014 
● Qcon New York – June 11th, 2014 
● GOTO Copenhagen/Aarhus – Denmark – Sept 25th, 2014 
● DevOps Enterprise Summit - San Francisco - Oct 21-23rd, 2014 
Disclosure: some of the companies mentioned are Battery Ventures Portfolio Companies 
See www.battery.com for a list of portfolio investments
Watch the video with slide synchronization on 
InfoQ.com! 
http://www.infoq.com/presentations/migration 
-cloud-microservices

Weitere ähnliche Inhalte

Andere mochten auch

Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Felix Gessert
 

Andere mochten auch (17)

Triangle Node Meetup : APIs in Minutes with Node.js
Triangle Node Meetup :  APIs in Minutes with Node.jsTriangle Node Meetup :  APIs in Minutes with Node.js
Triangle Node Meetup : APIs in Minutes with Node.js
 
Lessons Learned on Uber's Journey into Microservices
Lessons Learned on Uber's Journey into MicroservicesLessons Learned on Uber's Journey into Microservices
Lessons Learned on Uber's Journey into Microservices
 
Microservices for the rest of us
Microservices for the rest of usMicroservices for the rest of us
Microservices for the rest of us
 
新浪微博Feed服务架构
新浪微博Feed服务架构新浪微博Feed服务架构
新浪微博Feed服务架构
 
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
Building a Global-Scale Multi-Tenant Cloud Platform on AWS and Docker: Lesson...
 
Intro to Netflix's Chaos Monkey
Intro to Netflix's Chaos MonkeyIntro to Netflix's Chaos Monkey
Intro to Netflix's Chaos Monkey
 
Microservices Architecture
Microservices ArchitectureMicroservices Architecture
Microservices Architecture
 
Goto Berlin - Migrating to Microservices (Fast Delivery)
Goto Berlin - Migrating to Microservices (Fast Delivery)Goto Berlin - Migrating to Microservices (Fast Delivery)
Goto Berlin - Migrating to Microservices (Fast Delivery)
 
Enterprise Architecture Case in PHP (MUZIK Online)
Enterprise Architecture Case in PHP (MUZIK Online)Enterprise Architecture Case in PHP (MUZIK Online)
Enterprise Architecture Case in PHP (MUZIK Online)
 
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
Lessons Learned from Migrating Legacy Enterprise Applications to MicroservicesLessons Learned from Migrating Legacy Enterprise Applications to Microservices
Lessons Learned from Migrating Legacy Enterprise Applications to Microservices
 
CloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 GamingCloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
CloudWatch 성능 모니터링과 신속한 대응을 위한 노하우 - 박선용 솔루션즈 아키텍트:: AWS Cloud Track 3 Gaming
 
Netflix vs HBO v3 (2 17-14)
Netflix vs HBO v3 (2 17-14)Netflix vs HBO v3 (2 17-14)
Netflix vs HBO v3 (2 17-14)
 
Cassandra Performance and Scalability on AWS
Cassandra Performance and Scalability on AWSCassandra Performance and Scalability on AWS
Cassandra Performance and Scalability on AWS
 
Delivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards SophisticationDelivering with Microservices - How to Iterate Towards Sophistication
Delivering with Microservices - How to Iterate Towards Sophistication
 
AWS로 사용자 천만명 서비스 만들기 - 윤석찬 (AWS 테크에반젤리스트) :: AWS 웨비나 시리즈 2015
AWS로 사용자 천만명 서비스 만들기 - 윤석찬 (AWS 테크에반젤리스트) :: AWS 웨비나 시리즈 2015AWS로 사용자 천만명 서비스 만들기 - 윤석찬 (AWS 테크에반젤리스트) :: AWS 웨비나 시리즈 2015
AWS로 사용자 천만명 서비스 만들기 - 윤석찬 (AWS 테크에반젤리스트) :: AWS 웨비나 시리즈 2015
 
마이크로서비스 아키텍처와 DevOps 기술 - Amazon 사례를 중심으로 (윤석찬)
마이크로서비스 아키텍처와 DevOps 기술 - Amazon 사례를 중심으로 (윤석찬)마이크로서비스 아키텍처와 DevOps 기술 - Amazon 사례를 중심으로 (윤석찬)
마이크로서비스 아키텍처와 DevOps 기술 - Amazon 사례를 중심으로 (윤석찬)
 
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
Cgroups, namespaces, and beyond: what are containers made from? (DockerCon Eu...
 

Mehr von C4Media

Mehr von C4Media (20)

Streaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live VideoStreaming a Million Likes/Second: Real-Time Interactions on Live Video
Streaming a Million Likes/Second: Real-Time Interactions on Live Video
 
Next Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy MobileNext Generation Client APIs in Envoy Mobile
Next Generation Client APIs in Envoy Mobile
 
Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020Software Teams and Teamwork Trends Report Q1 2020
Software Teams and Teamwork Trends Report Q1 2020
 
Understand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java ApplicationsUnderstand the Trade-offs Using Compilers for Java Applications
Understand the Trade-offs Using Compilers for Java Applications
 
Kafka Needs No Keeper
Kafka Needs No KeeperKafka Needs No Keeper
Kafka Needs No Keeper
 
High Performing Teams Act Like Owners
High Performing Teams Act Like OwnersHigh Performing Teams Act Like Owners
High Performing Teams Act Like Owners
 
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to JavaDoes Java Need Inline Types? What Project Valhalla Can Bring to Java
Does Java Need Inline Types? What Project Valhalla Can Bring to Java
 
Service Meshes- The Ultimate Guide
Service Meshes- The Ultimate GuideService Meshes- The Ultimate Guide
Service Meshes- The Ultimate Guide
 
Shifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CDShifting Left with Cloud Native CI/CD
Shifting Left with Cloud Native CI/CD
 
CI/CD for Machine Learning
CI/CD for Machine LearningCI/CD for Machine Learning
CI/CD for Machine Learning
 
Fault Tolerance at Speed
Fault Tolerance at SpeedFault Tolerance at Speed
Fault Tolerance at Speed
 
Architectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep SystemsArchitectures That Scale Deep - Regaining Control in Deep Systems
Architectures That Scale Deep - Regaining Control in Deep Systems
 
ML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.jsML in the Browser: Interactive Experiences with Tensorflow.js
ML in the Browser: Interactive Experiences with Tensorflow.js
 
Build Your Own WebAssembly Compiler
Build Your Own WebAssembly CompilerBuild Your Own WebAssembly Compiler
Build Your Own WebAssembly Compiler
 
User & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix ScaleUser & Device Identity for Microservices @ Netflix Scale
User & Device Identity for Microservices @ Netflix Scale
 
Scaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's EdgeScaling Patterns for Netflix's Edge
Scaling Patterns for Netflix's Edge
 
Make Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home EverywhereMake Your Electron App Feel at Home Everywhere
Make Your Electron App Feel at Home Everywhere
 
The Talk You've Been Await-ing For
The Talk You've Been Await-ing ForThe Talk You've Been Await-ing For
The Talk You've Been Await-ing For
 
Future of Data Engineering
Future of Data EngineeringFuture of Data Engineering
Future of Data Engineering
 
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and MoreAutomated Testing for Terraform, Docker, Packer, Kubernetes, and More
Automated Testing for Terraform, Docker, Packer, Kubernetes, and More
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Migrating to Cloud Native with Microservices

  • 1. Migrating to Cloud Native with Microservices Adrian Cockcroft @adrianco June 2014
  • 2. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations /migration-cloud-microservices InfoQ.com: News & Community Site • 750,000 unique visitors/month • Published in 4 languages (English, Chinese, Japanese and Brazilian Portuguese) • Post content from our QCon conferences • News 15-20 / week • Articles 3-4 / week • Presentations (videos) 12-15 / week • Interviews 2-3 / week • Books 1 / month
  • 3. Presented at QCon New York www.qconnewyork.com Purpose of QCon - to empower software development by facilitating the spread of knowledge and innovation Strategy - practitioner-driven conference designed for YOU: influencers of change and innovation in your teams - speakers and topics driving the evolution and innovation - connecting and catalyzing the influencers and innovators Highlights - attended by more than 12,000 delegates since 2007 - held in 9 cities worldwide
  • 4. ‹#› | Battery Ventures
  • 5. ‹#› | Battery Ventures Typical reactions to my Netflix talks… “You guys are crazy! Can’t believe it” – 2009 “What Netflix is doing won’t work” – 2010 It only works for ‘Unicorns’ like Netflix” – 2011 “We’d like to do that but can’t” – 2012 “We’re on our way using Netflix OSS code” – 2013
  • 6. ‹#› | Battery Ventures What I learned from my time at Netflix ● Speed wins in the marketplace ● Remove friction from product development ● High trust, low process, no hand-offs between teams ● Freedom and responsibility culture ● Don’t do your own undifferentiated heavy lifting ● Use simple patterns automated by tooling ● Self service cloud makes impossible things instant
  • 7. ‹#› | Battery Ventures Enterprise IT Adoption of Cloud By Simon Wardley http://enterpriseitadoption.com/ Now %*&!”
  • 8. ‹#› | Battery Ventures Speed Innovation New Ideas New Products
  • 9. What separates incumbents from disruptors? ‹#› | Battery Ventures
  • 10. ‹#› | Battery Ventures Assumptions
  • 11. ‹#› | Battery Ventures Optimizations
  • 12. “It isn't what we don't know that gives us trouble, it's what we know that ain't so.” ‹#› | Battery Ventures Will Rogers http://www.brainyquote.com/quotes/quotes/w/willrogers385286.html
  • 13. ‹#› | Battery Ventures Incumbents follow the $$$ Market size lags disruption because high price products are replaced by low priced products
  • 14. ‹#› | Battery Ventures Disruptors Take what used to be expensive learn to “waste” them to save money elsewhere
  • 15. ‹#› | Battery Ventures Examples
  • 16. Solid State Disk ‹#› | Battery Ventures Example
  • 17. Storage systems assume random reads are expensive ‹#› | Battery Ventures Decades of filesystems and storage array development based on spinning rust
  • 18. ‹#› | Battery Ventures RR is free Immutable writes Log-merge SSD works best for random reads and sequential writes. Bad for updates.
  • 19. SSD packaging as disk, as PCI card now as memory DIMM ‹#› | Battery Ventures Each generation reduces overhead and improves price/performance
  • 20. ‹#› | Battery Ventures Disclosure: Diablo Technologies is a Battery Ventures Portfolio Company See www.battery.com for a list of portfolio investments
  • 21. ‹#› | Battery Ventures Traditional vs. Cloud Native Storage Architectures Business Logic Database Master Fabric Storage Arrays Database Slave Fabric Storage Arrays Business Logic Cassandra Zone A nodes Cassandra Zone B nodes Cassandra Zone C nodes Cloud Object Store Backups SSDs inside ephemeral instances disrupt an entire industry SSDs inside arrays disrupt incumbent suppliers
  • 22. ‹#› | Battery Ventures How to Scale Storage Beyond Ludicrous ● Cassandra scalability ● Linear scale up benchmarked and seen in production ● Hundreds of nodes per cluster in common use today ● Thousands of nodes per cluster actively being tested and used ● Cassandra scale using high end AWS storage instances ● EC2 i2.8xlarge - over 300,000 iops read or write, 6.4TB of SSD ● 100 nodes = 30 million iops and 640 TB - Ludicrous ● 1000 nodes = 300 million iops and 6.4 PB - Plaid! http://techblog.netflix.com/2011/11/benchmarking-cassandra-scalability-on.html
  • 23. ‹#› | Battery Ventures Disruptor Cassandra Perfect match for SSD, no write amplification, no updates, scales to plaid
  • 24. ‹#› | Battery Ventures Product Development Another disruptive example
  • 25. Assumption: Process prevents ‹#› | Battery Ventures problems Another disruptive example
  • 26. Hardware provisioning is undifferentiated heavy lifting – replace it with IaaS ‹#› | Battery Ventures Non-Cloud Product Development Months before you find out whether the product meets the need Business Need • Documents • Weeks Approval Process • Meetings • Weeks Hardware Purchase • Negotiations • Weeks Software Development • Specifications • Weeks Deployment and Testing • Reports • Weeks Customer Feedback • It sucks! • Weeks IaaS Cloud
  • 27. Process Hand-Off Steps for Product Development on IaaS ‹#› | Battery Ventures Product Manager Development Team QA Integration Team Operations Deploy Team BI Analytics Team
  • 28. Software provisioning is undifferentiated heavy lifting – replace it with PaaS ‹#› | Battery Ventures IaaS Based Product Development Weeks before you find out whether the product meets the need Business Need • Documents • Weeks Software Development • Specifications • Weeks Deployment and Testing • Reports • Days Customer Feedback • It sucks! • Days PaaS Cloud etc…
  • 29. Process Hand-Off Steps for Feature Development on PaaS ‹#› | Battery Ventures Product Manager Developer BI Analytics Team
  • 30. Business Need • Discussions • Days Software Development • Code • Days Building your own business apps is undifferentiated heavy lifting – use SaaS ‹#› | Battery Ventures PaaS Based Product Feature Development Days before you find out whether the feature meets the need Customer Feedback • Fix this Bit! • Hours SaaS/ BPaaS Cloud etc…
  • 31. and thousands more… ‹#› | Battery Ventures SaaS Based Business App Development Business Need •GUI Builder •Hours Hours before you find out whether the feature meets the need Customer Feedback •Fix this bit! •Seconds
  • 32. ‹#› | Battery Ventures What Happened? Rate of change increased Cost and size and risk of change reduced
  • 33. BIG DATA ‹#› | Battery Ventures Land grab opportunity Competitive Observe Orient Decide Measure Customers Act Move Customer Pain Point Analysis Plan Response JFDI Share Plans Launch AB Test Automatic Deploy Incremental Features Model Hypotheses INNOVATION CULTURE CLOUD Continuous Delivery on Cloud
  • 34. Monolithic development model has a coordination bottleneck and replacement risk ‹#› | Battery Ventures Release Plan Developer Developer Developer Developer Developer QA Release Integration Ops Replace Old With New
  • 35. Developer Feature Plan Developer Deploy Feature to Production Microservices based continuous delivery scales with large development teams and is nondestructive ‹#› | Battery Ventures Feature Plan Deploy Feature to Production Stable Components In Use Old Unused Components
  • 36. ‹#› | Battery Ventures Non-Destructive Production Updates ● “Immutable Code” Service Pattern ● Existing services are unchanged, old code remains in service ● New code deploys as a new service group ● No impact to production until traffic routing changes ● A|B Tests, Feature Flags and Version Routing control traffic ● First users in the test cell are the developer and test engineers ● A cohort of users is added looking for measurable improvement ● Finally make default for everyone, keeping old code for a while
  • 37. ‹#› | Battery Ventures Disruptor Continuous Delivery Compute capacity is an ephemeral commodity, learn to waste it to save time and get agility
  • 38. ‹#› | Battery Ventures Development and Operations Another disruptive example, if you assume they don’t mix…
  • 39. Developers make code ‹#› | Battery Ventures
  • 40. Operations run code ‹#› | Battery Ventures
  • 41. It can take weeks to get a VM after a developer ‹#› | Battery Ventures files a ticket…
  • 42. But if operations is a self service API… ‹#› | Battery Ventures
  • 43. Developers run their ‹#› | Battery Ventures own code
  • 44. Developers are on call ‹#› | Battery Ventures
  • 45. ‹#› | Battery Ventures Developers have freedom
  • 46. ‹#› | Battery Ventures Developers have incentives to be responsible Avoids the externalities of over-dependence on operations to fix everything
  • 47. ‹#› | Battery Ventures Less down time With the right incentives and tooling developers write code that scales and doesn't break
  • 48. ‹#› | Battery Ventures No meetings Developers end up spending more time developing than when they had to keep explaining their code to ops
  • 49. DevOps is a re-org, not a new team to hire ‹#› | Battery Ventures For most companies, the cultural transformation needed to do DevOps is the blocker
  • 50. ‹#› | Battery Ventures Disruptor High Trust Culture DevOps Give up central coordination and control, to get speed and align incentives
  • 51. ‹#› | Battery Ventures It’s what you know that isn’t so… ● Make your assumptions explicit ● Extrapolate trends to the limit ● Listen to non-customers ● Follow developer adoption, not IT spend ● Map evolution of products to services to utilities ● Re-organize your teams for speed of execution
  • 52. How do we get there? ‹#› | Battery Ventures
  • 53. "This is the IT swamp draining manual for anyone who is neck deep in alligators.” ‹#› | Battery Ventures
  • 54. ‹#› | Battery Ventures Once you’re out of the swamp, read this…
  • 55. ‹#› | Battery Ventures Open Source Ecosystems ● The most advanced, scalable and stable code you can get is OSS ● No procurement cycle, fix and extend it yourself ● Github is a developer’s online resume ● Github is also your company’s online resume! ● Extensible platforms create ecosystems ● Give up control to get ubiquity – Apache license Innovate, Leverage and Commoditize
  • 56. ‹#› | Battery Ventures Cloud Native for High Availability ● Business logic isolation in stateless micro-services ● Immutable code with instant rollback ● Auto-scaled capacity and deployment updates ● Distributed across availability zones and regions ● De-normalized single function NoSQL data stores ● See over 40 NetflixOSS projects at netflix.github.com ● Get “Technical Indigestion” trying to keep up with techblog.netflix.com
  • 57. ‹#› | Battery Ventures A Microservice Definition Loosely coupled service oriented architecture with bounded contexts See http://en.wikipedia.org/wiki/Domain-driven_design for discussion of bounded contexts
  • 58. ‹#› | Battery Ventures Scaling Continuous Delivery Models Monolithic Microservices ● Devs book a train ticket ● Everyone runs the monolith ● Queue for the next train ● Coordination chat session ● Need to learn deploy process ● Copy code to existing servers ● Few concurrent versions ● Tens of monolithic updates/day maximum ● Roll-forward only ● “Done” is released to prod ● Everyone has their own build ● Dev runs their own microservice ● No waiting, no meetings ● API call to update prod timeline ● Automated hands-off deploy ● Immutable code on new servers ● Unlimited concurrent versions ● 100s of independent updates ● Roll-back in seconds ● “Done” is retired from prod
  • 59. Separate Concerns Using Micro-services ● Invert Conway’s Law – teams own service groups and backend stores ● One “verb” per single function micro-service, size doesn’t matter ● One developer independently produces a micro-service ● Each micro-service is it’s own build, avoids trunk conflicts ● Deploy in a container: Tomcat, AMI or Docker, whatever… ● Stateless business logic. Cattle, not pets. ● Stateful cached data access layer can use ephemeral instances ‹#› | Battery Ventures http://en.wikipedia.org/wiki/Conway's_law
  • 60. ‹#› | Battery Ventures Microservices Development Architecture ● Client libraries Even if you start with a raw protocol, a client side driver is the end-state Best strategy is to own your own client libraries from the start ● Multithreading and Non-blocking Calls Reactive model RxJava uses Observable to hide concurrency cleanly Netty can be used to get non-blocking I/O speedup over Tomcat container ● Circuit Breakers – See Fluxcapacitor.com for code NetflixOSS Hystrix, Turbine, Latency Monkey, Ribbon/Karyon Also look at Finagle/Zipkin from Twitter
  • 61. ‹#› | Battery Ventures Microservice Datastores ● Book: Refactoring Databases SchemaSpy to examine schema structure Denormalization into one datasource per table or materialized view ● Polyglot Persistence Use a mixture of database technologies, behind REST data access layers See NetflixOSS Storage Tier as a Service HTTP (staash.com) for MySQL and C* ● CAP – Consistent or Available when Partitioned Look at Jepsen torture tests for common systems aphyr.com/tags/jepsen There is no such thing as a consistent distributed system, get over it…
  • 62. ‹#› | Battery Ventures Strategies for impatient product managers ● Carrot “This new feature you want will be ready faster as a microservice” ● Stick “This new feature you want will only be implemented in the new microservice based system” ● Shiny Object “Why don’t you concentrate on some other part of the system while we get the transition done?”
  • 63. ‹#› | Battery Ventures Monitoring and Microservices
  • 64. ‹#› | Battery Ventures Issues with Continuous Delivery and Microservices ● High rate of change Code pushes can cause floods of new instances and metrics Short baseline for alert threshold analysis – everything looks unusual ● Ephemeral Configurations Short lifetimes make it hard to aggregate historical views Hand tweaked monitoring tools take too much work to keep running ● Microservices with complex calling patterns End-to-end request flow measurements are very important Request flow visualizations get overwhelmed
  • 65. ‹#› | Battery Ventures Microservice Based Architectures From a Gilt Groupe Presentation See http://www.slideshare.net/LappleApple/gilt-from-monolith-ruby-app-to-micro-service-scala-service-architecture
  • 66. Netflix Gilt Groupe (12 of 450) Twitter ‹#› | Battery Ventures “Death Star” Architecture Diagrams As visualized by Appdynamics, Boundary.com and Twitter internal tools
  • 67. Continuous Delivery and DevOps Implications ●Changes are smaller but more frequent ● Individual changes are more likely to be broken ●Changes are normally deployed by developers ● Feature flags are used to enable new code ● Instant detection and rollback matters much more ‹#› | Battery Ventures
  • 68. 1st high metric processed (maybe) Three datapoints on user graph so looks bad at 8m00. 1st high metric seen on graph ‹#› | Battery Ventures What’s wrong with measuring in minutes? Takes too long to see a problem 5 4 3 2 1 0 1st high metric arrives at monitoring system Metric Threshold Something broke at 2m20 40s of failure didn’t trigger 1st high metric seen at agent on instance Minute 1 Minute 2 Minute 3 Minute 4 Minute 5 Minute 6 Minute 7
  • 69. Whoops! I didn’t mean that! Reverting… Not cool if it takes 5 minutes to see it failed and 5 more to see a fix No-one notices if it only takes 5 seconds to detect and 5 to see a fix ‹#› | Battery Ventures
  • 70. 1st high metric processed Three datapoints on user graph so looks bad at 2m25. 1st high metric seen on graph ‹#› | Battery Ventures Try that again by the second More confidence more quickly 1st high metric arrives at monitoring system Threshold 5 4 3 2 1 0 Something broke at 2m20 Measurable in 1s 1st high metric seen at agent on instance Minute 1 Minute 2 Minute 3 Minute 4 Minute 5 Minute 6 Minute 7
  • 71. NetflixOSS Hystrix / Turbine Circuit Breaker Monitoring Streaming metrics directly from services to a web browser each second ‹#› | Battery Ventures http://techblog.netflix.com/2012/12/hystrix-dashboard-and-turbine.html
  • 72. ‹#› | Battery Ventures Latest SaaS Based Monitoring Products Seeing Problems In Seconds www.vividcortex.com and www.boundary.com
  • 73. Metric to display latency needs to be less than human attention span (~10s) ‹#› | Battery Ventures
  • 74. ‹#› | Battery Ventures Summary ● Speed wins in the marketplace ● Remove friction from product development ● High trust, low process ● Freedom and responsibility culture ● Don’t do your own undifferentiated heavy lifting ● Simple patterns automated by tooling ● Microservices for speed and availability
  • 75. Separation of Concerns Bounded Contexts ‹#› | Battery Ventures
  • 76. ‹#› | Battery Ventures Any Questions? ● Battery Ventures http://www.battery.com ● Adrian’s Blog http://perfcap.blogspot.com ● Slideshare http://slideshare.com/adriancockcroft ● Monitorama Opening Keynote Portland OR - May 7th, 2014 ● GOTO Chicago Opening Keynote May 20th, 2014 ● Qcon New York – June 11th, 2014 ● GOTO Copenhagen/Aarhus – Denmark – Sept 25th, 2014 ● DevOps Enterprise Summit - San Francisco - Oct 21-23rd, 2014 Disclosure: some of the companies mentioned are Battery Ventures Portfolio Companies See www.battery.com for a list of portfolio investments
  • 77. Watch the video with slide synchronization on InfoQ.com! http://www.infoq.com/presentations/migration -cloud-microservices