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

Three Billy Goats Gruff
: from a monolith to containers to functions

Three Billy Goats Gruff
: from a monolith to containers to functions

Talk at GopherCon UK, see https://www.gophercon.co.uk

Michael Hausenblas

August 02, 2018
Tweet

More Decks by Michael Hausenblas

Other Decks in Technology

Transcript

  1. Three Billy Goats Gruff

    A developer's tale: from a monolith to containers to functions
    Michael Hausenblas

    @mhausenblas

    Developer Advocate, Red Hat

    2018-08-02, GopherCon UK, London

    View Slide

  2. Hit me up on Twitter: @mhausenblas
    2
    • Developer Advocate @ Red Hat (Go, Kubernetes, OpenShift)
    • Developer Advocate @ Mesosphere
    • Chief Data Engineer @ MapR
    • Applied research (IE/AT)
    • Nowadays mainly Go (Python, Node, Java, C++)
    • Dev turned ops
    $ whois mhausenblas

    View Slide

  3. Hit me up on Twitter: @mhausenblas
    3
    admin
    SRE
    developer
    info sec
    architect
    PM
    PHB

    View Slide

  4. https://unsplash.com/photos/m0wptz8vYpw
    motivation

    View Slide

  5. Hit me up on Twitter: @mhausenblas
    5
    https://www.pexels.com/photo/people-running-during-daytime-33703/
    out-perform competition

    View Slide

  6. Hit me up on Twitter: @mhausenblas
    6
    https://pixabay.com/en/logistics-stock-transport-shipping-852936/
    ship around the clock!

    View Slide

  7. Hit me up on Twitter: @mhausenblas
    7
    togetherness

    View Slide

  8. The app …

    View Slide

  9. Hit me up on Twitter: @mhausenblas

    View Slide

  10. Hit me up on Twitter: @mhausenblas

    View Slide

  11. Hit me up on Twitter: @mhausenblas

    View Slide

  12. Hit me up on Twitter: @mhausenblas

    View Slide

  13. Hit me up on Twitter: @mhausenblas

    View Slide

  14. Meet the three billy goats …

    View Slide

  15. Hit me up on Twitter: @mhausenblas
    M C F

    View Slide

  16. Hit me up on Twitter: @mhausenblas
    As monolith …
    M
    • Two Go routines:
    • serving static assets and API for Web app
    • metadata extraction
    • Using Go stdlb only
    • Deployed directly as a binary along with static assets (e.g. Terraform on a
    VM)

    View Slide

  17. M

    View Slide

  18. Hit me up on Twitter: @mhausenblas
    As containerised microservices …
    C
    • Two containers:
    • serving static assets and API for Web app
    • metadata extraction
    • Using Minio as shared storage
    • Deployed using Kubernetes primitives

    View Slide

  19. C

    View Slide

  20. Hit me up on Twitter: @mhausenblas
    Alternative container-based architectures
    C
    • lift and shift (aka: put monolith into a container)
    • both app containers in one pod, share data via local volume
    • app containers in different pods, share data via persistent volume

    View Slide

  21. Hit me up on Twitter: @mhausenblas
    F
    As functions …
    • Three functions:
    • upload an image
    • list images along with metadata
    • metadata extraction
    • Using S3 as shared storage (also: static assets served from bucket)
    • Deployed using Lambda, API Gateway, and CloudWatch

    View Slide

  22. F

    View Slide

  23. Demo time!
    github.com/mhausenblas/imgn

    View Slide

  24. Lessons learned

    View Slide

  25. Hit me up on Twitter: @mhausenblas
    25
    • From monolith to containers: pretty straight-forward
    • Functions requires different way of thinking
    • Both containers & functions increase dev/deploy velocity

    but also introduce new challenges:
    • containers: how to build/maintain images, routing
    • functions: how to debug and orchestrate
    Lessons learned

    View Slide

  26. Hit me up on Twitter: @mhausenblas
    26
    • Containers: big advantage is due to Kubernetes you now
    have portability and avoid lock-in (but also: do containers
    make sense here?)
    • Functions: big advantage is devs don’t need to bother with
    the infra bits but low-level CLI unusable (need CF, SAM,
    Serverless framework)
    • Ratio of “code to config” (deployment descriptors, etc.)
    Lessons learned

    View Slide

  27. Hit me up on Twitter: @mhausenblas
    27
    • What about observability?
    • Monitoring
    • Logging
    • Distributed tracing
    • What about security?
    Lessons learned

    View Slide

  28. Resources

    View Slide

  29. Hit me up on Twitter: @mhausenblas
    29

    View Slide

  30. plus.google.com/+RedHat
    linkedin.com/company/red-hat
    youtube.com/user/RedHatVideos
    facebook.com/redhatinc
    twitter.com/RedHatNews
    learn.openshift.com

    View Slide