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

MicroServices Challenges - Fred George - Agile SG 2016

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. MicroService
    Challenges
    Fred George
    [email protected]
    @fgeorge52
    Copyright © 2015 by Fred George. All rights reserved. 1

    View Slide

  2. 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

    View Slide

  3. 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

    View Slide

  4. 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

    View Slide

  5. How Fast Can You Go?
    Copyright © 2015 by Fred George. All rights reserved. 5
    Deployment to Production Every 3.5 minutes

    View Slide

  6. 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

    View Slide

  7. 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

    View Slide

  8. 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?

    View Slide

  9. 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

    View Slide

  10. 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

    View Slide

  11. Common Theme of All
    Challenges:
    Inexperience!
    Copyright © 2015 by Fred George. All rights reserved. 11

    View Slide

  12. Synchronous or
    Asynchronous
    Challenge 1
    Copyright © 2015 by Fred George. All rights reserved. 12

    View Slide

  13. 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

    View Slide

  14. Rapids, Rivers, and Ponds
    Copyright © 2015 by Fred George. All rights reserved. 14

    View Slide

  15. 0MQ
    0MQ 0MQ
    0MQ 0MQ 0MQ
    High-Performance Event Bus
    Copyright © 2015 by Fred George. All rights reserved.
    15
    Kafka
    Service

    View Slide

  16. 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

    View Slide

  17. 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
    ? ?
    ?

    View Slide

  18. 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

    View Slide

  19. Copyright © 2015 by Fred George. All rights reserved. 19
    Rental
    offers
    Car
    rent
    Legacy
    server
    Brand
    offers
    Location
    offers
    Segmentation
    Membership
    CarRent.com Login
    ? ?
    ?

    View Slide

  20. 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

    View Slide

  21. 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

    View Slide

  22. 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

    View Slide

  23. 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

    View Slide

  24. 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

    View Slide

  25. 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

    View Slide

  26. 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

    View Slide

  27. 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

    View Slide

  28. 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

    View Slide

  29. 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

    View Slide

  30. 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

    View Slide

  31. Deconstructing the
    Databases
    Challenge 2
    Copyright © 2015 by Fred George. All rights reserved. 31

    View Slide

  32. •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

    View Slide

  33. 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

    View Slide

  34. 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

    View Slide

  35. Entity MicroService Trap
    Challenge 3
    Copyright © 2015 by Fred George. All rights reserved. 35

    View Slide

  36. Fred Brooks’ Design Approach
    Copyright © 2016 by Fred George. All rights reserved. 36
    Get the data
    structures
    correct, and
    the code will
    write itself

    View Slide

  37. 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

    View Slide

  38. ~~~~~~~~
    ~~~~~~~~
    ~~~~~~~~
    ~~~~~~~~
    ~~~~~~~~
    ~~~~~~~~
    ~~~~~~~~
    ~~~~~~~~
    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

    View Slide

  39. 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
    ~~~~~~~~
    ~~~~~~~~
    ~~~~~~~~

    View Slide

  40. MicroServices or Clojure
    Challenge 4
    Copyright © 2015 by Fred George. All rights reserved. 40

    View Slide

  41. •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

    View Slide

  42. 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
    ? ? ?

    View Slide

  43. 3 Companies – 3 Variants
    Copyright © 2015 by Fred George. All rights reserved. 43

    View Slide

  44. 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

    View Slide

  45. 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

    View Slide

  46. 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

    View Slide

  47. A New Hope…
    Copyright © 2015 by Fred George. All rights reserved. 47

    View Slide

  48. Choosing Architectures and
    Frameworks
    Challenge 5
    Copyright © 2015 by Fred George. All rights reserved. 48

    View Slide

  49. Open Source Frameworks
    Copyright © 2015 by Fred George. All rights reserved. 49

    View Slide

  50. Node.js Very Active
    Copyright © 2015 by Fred George. All rights reserved. 50

    View Slide

  51. No Design Patterns Book
    Yet
    Challenge 6
    Copyright © 2015 by Fred George. All rights reserved. 51

    View Slide

  52. Conferences / Meetups Starting…
    Copyright © 2015 by Fred George. All rights reserved. 52

    View Slide

  53. Just Doing MicroServices
    Fails
    Challenge 7
    Copyright © 2015 by Fred George. All rights reserved. 53

    View Slide

  54. 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

    View Slide

  55. What is a MicroService?
    Challenge 8-n
    Copyright © 2015 by Fred George. All rights reserved. 55

    View Slide

  56. •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

    View Slide

  57. 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

    View Slide

  58. 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

    View Slide

  59. MicroService
    Challenges
    Fred George
    [email protected]
    @fgeorge52
    Copyright © 2015 by Fred George. All rights reserved. 59

    View Slide