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

Reusable patterns for scalable APIs running on Docker

Reusable patterns for scalable APIs running on Docker

The shipping containers were introduced around 1830s and since then they play a crucial role in the modern society by providing efficient packaging, storage and transportation. Today we see the same revolution happening in the DevOps world with the adoption of container technologies like Docker. They allow us to package, distribute and run software in a scalable and efficient way. In this talk we’ll see how we can abstract the common problem we solve everyday when building scalable Java APIs with Docker into design patterns to create reusable solutions. We’ll explore the good practices of writing Java applications with Docker. Then we’ll see how each design pattern can be applied in real scenarios that address different concerns that a large system creates. We’ll see some real life implementations of those patterns and how they help us solve problems in scalable systems. By the end of the talk we’ll have a very powerful abstraction to tackle the everyday problems we face in building big and impactful systems.

Nikolay Stoitsev

October 18, 2017
Tweet

More Decks by Nikolay Stoitsev

Other Decks in Programming

Transcript

  1. View Slide

  2. View Slide

  3. Containers

    View Slide

  4. View Slide

  5. cgroups

    View Slide

  6. namespaces

    View Slide

  7. Copy-on-write

    View Slide

  8. Stackable Image Layers

    View Slide

  9. bootfs

    View Slide

  10. bootfs
    Base image - (ubuntu, debian)

    View Slide

  11. bootfs
    Base image - (ubuntu, debian)
    Add JRE

    View Slide

  12. bootfs
    Base image - (ubuntu, debian)
    Add JRE
    Add git

    View Slide

  13. View Slide

  14. https://store.docker.com/images/alpine

    View Slide

  15. https://www.dockerbook.com/

    View Slide

  16. Class
    Object
    Image
    Container

    View Slide

  17. View Slide

  18. Map/Reduce

    View Slide

  19. https://www.usenix.org/node/196347

    View Slide

  20. Single-node, multi-container
    Application patterns

    View Slide

  21. Sidecar
    Web server Log server
    File System

    View Slide

  22. Sidecar
    Application Instance
    Translations
    Downloader
    File System

    View Slide

  23. Resource Isolation
    Separate development
    Easy and flexible composition
    Failure containment

    View Slide

  24. Ambassador
    Web Server Ambasador
    External App
    External App
    External App

    View Slide

  25. Ambassador example
    Application Hyperbahn Instance
    Hyperbahn Instance
    Hyperbahn Instance
    Hyperbahn Instance
    https://github.com/uber-archive/hyperbahn

    View Slide

  26. Easy to reason about
    Easy to test
    Reusable

    View Slide

  27. Adapter
    Application Monitoring Adapter
    Centralized
    monitoring system

    View Slide

  28. Multi-node application patterns

    View Slide

  29. Leader election
    App
    Leader
    election
    container
    App
    Leader
    election
    container
    App
    Leader
    election
    container
    App
    Leader
    election
    container

    View Slide

  30. Simplifies the problem
    Easy testing

    View Slide

  31. Distributed Transactions
    App
    Transaction
    manager
    container
    App
    Transaction
    manager
    container
    App
    Transaction
    manager
    container
    App
    Transaction
    manager
    container

    View Slide

  32. Work queue
    Worker
    Work
    Execution
    Worker
    Work
    Execution
    Work Coordinator

    View Slide

  33. Simplification

    View Slide

  34. Scatter/gather
    Merge
    Execution
    Work
    Execution
    Work
    Execution
    Root
    Work
    Execution

    View Slide

  35. Sharded Service
    Shard
    Function
    Distributor
    Worker
    Shard 1
    Worker
    Shard 2
    Worker
    Shard 3

    View Slide

  36. http://enterpriseintegrationpatterns.com

    View Slide

  37. Messaging endpoints

    View Slide

  38. Idempotent Receiver
    App
    Idempotent
    Receiver

    View Slide

  39. Message Routing

    View Slide

  40. Dynamic Router
    App
    Consumer
    App
    Consumer
    App
    Consumer
    Dynamic
    Router
    Output Channel
    Controll Channel

    View Slide

  41. View Slide

  42. Thanks!

    View Slide