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

Revitalizing Aging Architectures with Microservices and the Reactive Platform

Kevin Webber
December 01, 2015

Revitalizing Aging Architectures with Microservices and the Reactive Platform

When you need to react quickly to competitive threats, but your existing architecture is anything but nimble, what do you do? You will hear the story of how Walmart Canada revitalized its aging architecture with a microservices model built for speed and performance - that efficiently leveraged its JVM infrastructure - to achieve major e-commerce success in just 12 months.

Results:

1. Conversions up 20%
2. Mobile orders up 98%
3. No downtime during Black Friday or Boxing Day

Kevin Webber

December 01, 2015
Tweet

More Decks by Kevin Webber

Other Decks in Programming

Transcript

  1. Revitalizing Aging
    Architectures with
    Microservices

    View Slide

  2. Typesafe
    Reactive
    Platform
    » Play - RESTful API
    framework
    » Akka - Distributed
    computing framework
    » Spark - General purpose in-
    memory compute engine
    » ConductR, Monitoring, and
    commercial features

    View Slide

  3. Why replatform?

    View Slide

  4. 2005 architecture

    View Slide

  5. 2015 architecture

    View Slide

  6. 2020 architecture

    View Slide

  7. Size of the internet today

    View Slide

  8. The world by 2020
    » 4 billion connected people
    » 25+ million apps
    » 25+ billion embedded systems
    » 40 zettabytes (40 trillion gigabytes)
    » 5,200 GB of data for every person on Earth

    View Slide

  9. Walmart Canada

    View Slide

  10. Business Impact

    View Slide

  11. The goal
    » ~100% availability ("nine nines")

    View Slide

  12. The goal
    » ~100% availability ("nine nines")
    » Consistent responsiveness under varying load
    conditions

    View Slide

  13. The goal
    » ~100% availability ("nine nines")
    » Consistent responsiveness under varying load
    conditions
    » Predictable spikes of traffic, e.g, Black Friday
    » Less predictable spikes of traffic, e.g,
    marketing campaign driving traffic

    View Slide

  14. The goal
    » ~100% availability ("nine nines")
    » Consistent responsiveness under varying load
    conditions
    » Predictable spikes of traffic, e.g, Black Friday
    » Less predictable spikes of traffic, e.g,
    marketing campaign driving traffic
    » Enable LOBs to rapidly adapt to market conditions

    View Slide

  15. A Revitalized Architecture

    View Slide

  16. Walmart's Business Uplift
    » Conversions up 20%
    » Mobile orders up 98%
    » No downtime Black Friday or Boxing Day

    View Slide

  17. Walmart's Operational Savings
    » Moved off expensive hardware
    » On cheap virtual x86 servers
    » 20% - 50% cost savings
    » ~ 40% compute cycles

    View Slide

  18. Where to begin?

    View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. asynchronous, non-blocking, real-time, highly-
    available, loosely coupled, scalable, fault-tolerant,
    concurrent, reactive, event-driven, push instead of
    pull, distributed, low latency, high throughput...

    View Slide

  24. asynchronous, non-blocking, real-time, highly-
    available, loosely coupled, scalable, fault-tolerant,
    concurrent, reactive, event-driven, push instead of
    pull, distributed, low latency, high throughput...
    Too complicated. We need a simple vocabulary.

    View Slide

  25. Reactive
    A maturity model for modern
    distributed systems.
    » Responsive
    » Resilient
    » Elastic
    » Message-driven

    View Slide

  26. Why, What, How
    Reactive (principles)
    » responsive, resilient,
    elastic, message-driven

    View Slide

  27. Why, What, How
    Reactive (principles)
    » responsive, resilient,
    elastic, message-driven
    Microservices (strategy)
    » bounded contexts (DDD),
    event sourcing, CQRS,
    eventual consistency

    View Slide

  28. Why, What, How
    Reactive (principles)
    » responsive, resilient,
    elastic, message-driven
    Microservices (strategy)
    » bounded contexts (DDD),
    event sourcing, CQRS,
    eventual consistency
    Tools (implementation)
    » Typesafe Reactive Platform
    (Play, Akka, Spark)

    View Slide

  29. Heritage system

    View Slide

  30. Future system

    View Slide

  31. Clustered
    microservices
    » responsive to events, load,
    failure, users
    » embrace new concepts and
    patterns
    » cluster computing
    » distribution of data
    » new patterns like
    circuit breakers

    View Slide

  32. Async boundary

    View Slide

  33. Async boundary

    View Slide

  34. Synchronous

    View Slide

  35. Asynchronous

    View Slide

  36. View Slide

  37. View Slide

  38. Microservices
    Ecosystem
    plus:
    » service registry
    » service discovery
    » architecture visualization
    » security

    View Slide

  39. Play

    View Slide

  40. Play Anatomy
    Stateless
    » Session is stored in the
    browser cookie
    Actions
    » User-defined functions that
    run in a different context
    than the request loop

    View Slide

  41. Play at its core
    » Familiar MVC paradigm
    » Embraces flows of data
    » WebSockets, SSE
    » Reactive Streams (experimental in Play 2.4)
    » File uploads
    » Integration with Akka
    » Distribute work via messaging

    View Slide

  42. Akka

    View Slide

  43. Actor model
    » Distribution
    » Location transparency
    » Isolation

    View Slide

  44. Supervision

    View Slide

  45. Typical error channel

    View Slide

  46. Dedicated error channel

    View Slide

  47. Validation errors

    View Slide

  48. Clustering

    View Slide

  49. Spark & Fast Data

    View Slide

  50. View Slide

  51. Streams?
    » A series of elements over time
    » Events, chunks of files
    » No beginning, no end

    View Slide

  52. Akka Streams
    » Per-event processing
    » Back-pressure
    » Not distributed
    » Reactive Streams compliant
    » Integrate with Spark
    Streaming

    View Slide

  53. What Typesafe
    offers

    View Slide

  54. Typesafe ConductR
    Manage Typesafe Reactive Platform applications across a cluster

    View Slide

  55. Typesafe Monitoring
    Know exactly what your Reactive system is doing

    View Slide

  56. Commercial features
    » Akka Split Brain Resolver
    » Akka 2.3 Cluster Support for Docker
    » Play User Quotas
    » Play SOAP

    View Slide

  57. Project Success Subscription
    » Certified build
    » Compatibility verifications
    » Security alerts
    » Binary updates
    » Long-term support
    » Legal protection

    View Slide

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

    View Slide