$30 off During Our Annual Pro Sale. View Details »

Microservices: Architecture for the Real-time Organization

Kevin Webber
February 11, 2016

Microservices: Architecture for the Real-time Organization

The real-time organization is responsive to change. Real-time organizations architect their systems to evolve naturally as they adapt to the competitive landscape around them. At the core of real-time organizations are microservices. The microservice architecture (MSA) empowers independent teams within large organizations to move at the pace of startups, freeing them from the constraints of “design by committee” and other architectural anti-patterns that ground productivity within the enterprise to a halt.

We explore all of the relevant patterns of microservices architecture including domain-driven design (DDD), circuit breaker, data pump, saga pattern, distributed transaction, async messaging, etc.

Kevin Webber

February 11, 2016
Tweet

More Decks by Kevin Webber

Other Decks in Programming

Transcript

  1. Microservices:
    Architecture for the
    Real-time
    Organization

    View Slide

  2. Why microservices?

    View Slide

  3. View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. heritage
    architecture
    » Single points of failure
    » Impossible to scale out
    (shared mutable state, etc)
    » Different non-functional
    requirements (reads,
    writes, compute)
    » Optimized for none!
    » Long, risky release cycles

    View Slide

  14. What are microservices?

    View Slide

  15. View Slide

  16. View Slide

  17. View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. Microservices
    » Ubiquitous language
    » Well defined models &
    boundaries
    » Single responsibility
    » Independantly deployable,
    scalable, resilient
    » Communicate via async
    messaging
    » Own their data
    » Don't expose a public API

    View Slide

  26. Approach?
    Principles
    » responsive, resilient,
    elastic, message-driven

    View Slide

  27. Approach?
    Principles
    » responsive, resilient,
    elastic, message-driven
    Concepts
    » bounded contexts (DDD),
    event sourcing, CQRS, CAP
    (eventual consistency)

    View Slide

  28. Approach?
    Principles
    » responsive, resilient,
    elastic, message-driven
    Concepts
    » bounded contexts (DDD),
    event sourcing, CQRS, CAP
    (eventual consistency)
    Tools
    » Typesafe Reactive Platform
    (Play, Akka, Spark)

    View Slide

  29. Concepts and patterns
    We will cover:
    » Domain Driven Design (DDD)
    » Async messaging
    » API management
    » Dependency management
    » CQRS & event sourcing
    » Transactions & ordering

    View Slide

  30. Domain Driven Design

    View Slide

  31. View Slide

  32. View Slide

  33. View Slide

  34. View Slide

  35. View Slide

  36. Going async

    View Slide

  37. View Slide

  38. View Slide

  39. View Slide

  40. View Slide

  41. Async Benefits
    » Not wasting resources
    » Memory, CPU, threads
    » Embracing failure
    » Not expecting a return
    from a remote service
    » Designing for all
    scenarios

    View Slide

  42. Akka Actors
    » Message driven architecture
    » Distribution
    » Location transparency
    » Isolation

    View Slide

  43. API management

    View Slide

  44. View Slide

  45. View Slide

  46. View Slide

  47. View Slide

  48. View Slide

  49. View Slide

  50. View Slide

  51. View Slide

  52. View Slide

  53. View Slide

  54. View Slide

  55. API mgmt.
    » Messaging patterns
    » Pub/sub, point-to-point,
    streaming
    » API gateway
    » Routing, aggregation,
    protocol translation
    » Discovery
    » Service discovery,
    registry, versioning

    View Slide

  56. Dependency management

    View Slide

  57. View Slide

  58. View Slide

  59. View Slide

  60. View Slide

  61. View Slide

  62. View Slide

  63. CQRS & event sourcing

    View Slide

  64. View Slide

  65. View Slide

  66. View Slide

  67. View Slide

  68. View Slide

  69. View Slide

  70. View Slide

  71. View Slide

  72. Transactions and
    ordering

    View Slide

  73. Considerations
    » ACID doesn't work across location/trust boundaries
    » No 2-Phase commits (2PC)
    » No holding locks for the duration of work
    » In distributed systems we need to compensate for
    for failure rather than prevent failure

    View Slide

  74. View Slide

  75. View Slide

  76. What next?

    View Slide

  77. View Slide

  78. View Slide

  79. View Slide

  80. View Slide

  81. View Slide

  82. Microservices
    with Typesafe
    » Play for API gateway
    » Akka for core microservices
    (DDD, CQRS, event sourcing)
    » ConductR for cluster
    management (service
    registry, discovery,
    architecture visualization,
    security)

    View Slide

  83. Thank you!
    Visit https://www.typesafe.com/products/typesafe-
    reactive-platform to get started
    Contact info
    » Twitter: @kvnwbbr
    » Email: [email protected]

    View Slide