Share
Embed
MicroServices Challenges - Fred George - Agile SG 2016
Presented in Agile Singapore 2016 conference
Agile Singapore
October 07, 2016
Transcript
59 slides
-
MicroService Challenges Fred George [email protected] @fgeorge52 Copyright © 2015 by
Fred George. All rights reserved. 1 -
Fred George Copyright © 2015 by Fred George. All rights
reserved. 2 • Technologist • Computer networks – 70’s • Token Ring LAN – 80’s • GUI’s – late 80’s • OO – late 80’s • Agile – late 90’s • MicroServices – mid-2000’s • Programmer • Since 1968 (Basic) • 65,000 hours experience • 70+ languages • Computer Science Degree 1973 • Manager • 17 years IBM • Business degree, MIT Sloan School 1986 • Product Owner, IBM • VP, ThoughtWorks • Co-founder, Outpace (Silicon Valley) • Senior Advisor to 3 tech companies -
Fred George Copyright © 2015 by Fred George. All rights
reserved. 3 Consulting Roles • Change Agent • Disruptor • “Hand grenade I am throwing into development” • CTO describing Fred to his Vice President -
Industry Trends… Copyright © 2015 by Fred George. All rights
reserved. 4 MicroServices Cloud Docker Dev/Ops Full-stack developer Agile Lean startup Cassandra Event bus MVP (minimum viable product Programmer anarchy No-SQL One Hacker Way -
How Fast Can You Go? Copyright © 2015 by Fred
George. All rights reserved. 5 Deployment to Production Every 3.5 minutes -
Why: New Problem Domains: The Cynefin Framework Copyright © 2015
by Fred George. All rights reserved. 6 Simple Complicated Complex Chaotic Cause a Effect Cause aaa Effect Effect? Cause? Cause ? Effect Disorder -
Why: Competition is coming Copyright © 2015 by Fred George.
All rights reserved. 7 • Enablement through technologies • Cloud computing • Ubiquitous, high bandwidth • Languages (and supporting frameworks) • Recognition of business opportunities • Silicon Valley innovators as role models • Accelerating business needs • Few inhibitors for global competitors • Reduction of entry barriers for niche competitors -
Hardware Lead Times Copyright © 2015 by Fred George. All
rights reserved. 8 6 mo. 1990 1995 2005 30 min. 1 week 1 day 2015 1 mo. 2000 2010 5 min. 5 sec. Order lead times (log) Data Center Virtual Machines Docker Commercial Cloud Capacity planning? Dedicated ops team? -
Copyright © 2015 by Fred George. All rights reserved. 9
10 1 1000 100 100,000 1 10 100 1000 10,000 Size (loc) Number of Services MicroServices Rails / Java Zone SOA Workshop Forward Netflix Services Impact -
Summary Principles of MicroServices Copyright © 2015 by Fred George.
All rights reserved. 10 • Very, very small • Team size of one to develop/maintain • Loosely coupled (including flow) • Multiple versions acceptable (encouraged?) • Self-monitoring of each service • Publish interesting “stuff” (w/o explicit requirements) • “Application” seems to be a poor conceptualization -
Common Theme of All Challenges: Inexperience! Copyright © 2015 by
Fred George. All rights reserved. 11 -
Synchronous or Asynchronous Challenge 1 Copyright © 2015 by Fred
George. All rights reserved. 12 -
Chad Fowler vs. Fred George •Chad: Use Synchronous as default
• Algorithms typically described serially • Programmer understanding / productivity •Fred: Use Asynchronous as default • Robustness should be primary goal • Supports better de-coupling • Teach the programmers! Copyright © 2015 by Fred George. All rights reserved. 13 -
Rapids, Rivers, and Ponds Copyright © 2015 by Fred George.
All rights reserved. 14 -
0MQ 0MQ 0MQ 0MQ 0MQ 0MQ High-Performance Event Bus Copyright
© 2015 by Fred George. All rights reserved. 15 Kafka Service -
Asynchronous Services Copyright © 2015 by Fred George. All rights
reserved. 16 Bus Service Service Service Need Need Need Sol’n’s Sol’n •Variants easy •Graceful degradation ChooseS ol’n -
Asynchronous Services Example Copyright © 2015 by Fred George. All
rights reserved. 17 Bus Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login ? ? ? -
Copyright © 2015 by Fred George. All rights reserved. 18
Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login ? ? ? Web page served -
Copyright © 2015 by Fred George. All rights reserved. 19
Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login ? ? ? -
Copyright © 2015 by Fred George. All rights reserved. 20
Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login ? ? ? A A B B -
B A Copyright © 2015 by Fred George. All rights
reserved. 21 Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login ? ? ? A B -
A B Copyright © 2015 by Fred George. All rights
reserved. 22 Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login ? ? ? A B A B A B -
B Copyright © 2015 by Fred George. All rights reserved.
23 Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login Sally A A B Sally logs in as Member -
B Copyright © 2015 by Fred George. All rights reserved.
24 Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login Sally A A B Sally logs in as Member -
B Copyright © 2015 by Fred George. All rights reserved.
25 Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login Sally A A B C D C D -
B Copyright © 2015 by Fred George. All rights reserved.
26 Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login Sally A A B C D C D C D -
B Copyright © 2015 by Fred George. All rights reserved.
27 Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login Sally A A B C D C D -
B Copyright © 2015 by Fred George. All rights reserved.
28 Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login Sally A A B C D C D -
B Copyright © 2015 by Fred George. All rights reserved.
29 Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login Sally A A B C D C D F E -
Channel Interfaces Service Taxonomy Channel Interfaces Copyright © 2015 by
Fred George. All rights reserved. 30 Need Processing Enrichment Services Solution Services Client Biases Solution Blockers Solution Selection Logging / Monitoring / KPI’s -
Deconstructing the Databases Challenge 2 Copyright © 2015 by Fred
George. All rights reserved. 31 -
•Fortune 100 view: • Entity-oriented; consistency essential • As few
as possible •MicroService view: • DB per MicroService (if persistence needed) • Poly-glot (various NoSQL, SQL) + event buses • Few (10%) writable; even fewer transactional How Many Databases? Copyright © 2015 by Fred George. All rights reserved. 32 -
Copyright © 2015 by Fred George. All rights reserved. 33
Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login Sally A B Rental offers Event publishing Solution collecting 300ms responder Redis -
Copyright © 2015 by Fred George. All rights reserved. 34
Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login Sally A B Membership enrichment ETL Key-value -
Entity MicroService Trap Challenge 3 Copyright © 2015 by Fred
George. All rights reserved. 35 -
Fred Brooks’ Design Approach Copyright © 2016 by Fred George.
All rights reserved. 36 Get the data structures correct, and the code will write itself -
70’s Design Approach Copyright © 2016 by Fred George. All
rights reserved. 37 ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz -
~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ 90’s Design
Approach Copyright © 2016 by Fred George. All rights reserved. 38 Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ Operational Reporting -
Design Approach Copyright © 2016 by Fred George. All rights
reserved. 39 … but you can’t change the data structure without making all the code “suspect” Corollary ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz Zzzzzzzz Zzzz Zzzzzz Zzz zzzzzz ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ -
MicroServices or Clojure Challenge 4 Copyright © 2015 by Fred
George. All rights reserved. 40 -
•Conceptualization (Job) • Every service has one job • If
two jobs, make two services •Communication • Minimize messages (whether RESTful or Events) •Encapsulate • Service has its own persistence • If sharing persistence, just one logical service MicroServices Like OO Copyright © 2015 by Fred George. All rights reserved. 41 -
Clojure Loves Shared Data Copyright © 2015 by Fred George.
All rights reserved. 42 X f o r m X f o r m X f o r m X f o r m ? ? ? -
3 Companies – 3 Variants Copyright © 2015 by Fred
George. All rights reserved. 43 -
3 Companies – 3 Variants Copyright © 2015 by Fred
George. All rights reserved. 44 300+ Ruby, Node.js, Clojure, R, … DB w cron, RESTful, Kafka bus -
3 Companies – 3 Variants Copyright © 2015 by Fred
George. All rights reserved. 45 300+ 3 + dozens Ruby, Node.js, Clojure, R, … Clojure,Node.js DB w cron, RESTful, Kafka bus RabbitMQ -
3 Companies – 3 Variants Copyright © 2015 by Fred
George. All rights reserved. 46 300+ 3 + dozens 25 Ruby, Node.js, Clojure, R, … Clojure,Node.js Clojure DB w cron, RESTful, Kafka bus RabbitMQ Orchestration, RabbitMQ -
A New Hope… Copyright © 2015 by Fred George. All
rights reserved. 47 -
Choosing Architectures and Frameworks Challenge 5 Copyright © 2015 by
Fred George. All rights reserved. 48 -
Open Source Frameworks Copyright © 2015 by Fred George. All
rights reserved. 49 -
Node.js Very Active Copyright © 2015 by Fred George. All
rights reserved. 50 -
No Design Patterns Book Yet Challenge 6 Copyright © 2015
by Fred George. All rights reserved. 51 -
Conferences / Meetups Starting… Copyright © 2015 by Fred George.
All rights reserved. 52 -
Just Doing MicroServices Fails Challenge 7 Copyright © 2015 by
Fred George. All rights reserved. 53 -
Copyright © 2015 by Fred George. All rights reserved. 54
MicroServices Cloud Docker Dev/Ops Full-stack developer Agile Lean startup Cassandra Event bus MVP (minimum viable product Programmer anarchy No-SQL -
What is a MicroService? Challenge 8-n Copyright © 2015 by
Fred George. All rights reserved. 55 -
•Synchronicity degree • Primary API access to services •Ratio of
number of services and average size • Zones for clarity •DB / service ratio • Expose potential DB hindrances to rapid deployment Taxonomy May be Useful (before it’s too late) Copyright © 2015 by Fred George. All rights reserved. 56 -
Count / Size Ratio Copyright © 2015 by Fred George.
All rights reserved. 57 10 1 1000 100 100,000 1 10 100 1000 10,000 Size (loc) Number of Services MicroServices Rails / Java Zone SOA Animation Forward Netflix -
More Information… •Google: • MicroService Architecture for videos • MicroXchg
2015 conference •Complementary topic: • Google for Programmer Anarchy Copyright © 2015 by Fred George. All rights reserved. 58 -
MicroService Challenges Fred George [email protected] @fgeorge52 Copyright © 2015 by
Fred George. All rights reserved. 59