Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MicroServices Challenges - Fred George - Agile ...

MicroServices Challenges - Fred George - Agile SG 2016

Presented in Agile Singapore 2016 conference

Agile Singapore

October 07, 2016
Tweet

More Decks by Agile Singapore

Other Decks in Technology

Transcript

  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
  2. 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
  3. 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
  4. How Fast Can You Go? Copyright © 2015 by Fred

    George. All rights reserved. 5 Deployment to Production Every 3.5 minutes
  5. 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
  6. 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
  7. 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?
  8. 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
  9. 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
  10. 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
  11. 0MQ 0MQ 0MQ 0MQ 0MQ 0MQ High-Performance Event Bus Copyright

    © 2015 by Fred George. All rights reserved. 15 Kafka Service
  12. 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
  13. 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 ? ? ?
  14. 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
  15. Copyright © 2015 by Fred George. All rights reserved. 19

    Rental offers Car rent Legacy server Brand offers Location offers Segmentation Membership CarRent.com Login ? ? ?
  16. 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
  17. 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
  18. 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
  19. 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
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. •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
  28. 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
  29. 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
  30. Fred Brooks’ Design Approach Copyright © 2016 by Fred George.

    All rights reserved. 36 Get the data structures correct, and the code will write itself
  31. 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
  32. ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ ~~~~~~~~ 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
  33. 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 ~~~~~~~~ ~~~~~~~~ ~~~~~~~~
  34. •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
  35. 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 ? ? ?
  36. 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
  37. 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
  38. 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
  39. No Design Patterns Book Yet Challenge 6 Copyright © 2015

    by Fred George. All rights reserved. 51
  40. 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
  41. What is a MicroService? Challenge 8-n Copyright © 2015 by

    Fred George. All rights reserved. 55
  42. •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
  43. 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
  44. 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