Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

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

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

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

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

Hit me up on Twitter: @mhausenblas 7 togetherness

Slide 8

Slide 8 text

The app …

Slide 9

Slide 9 text

Hit me up on Twitter: @mhausenblas

Slide 10

Slide 10 text

Hit me up on Twitter: @mhausenblas

Slide 11

Slide 11 text

Hit me up on Twitter: @mhausenblas

Slide 12

Slide 12 text

Hit me up on Twitter: @mhausenblas

Slide 13

Slide 13 text

Hit me up on Twitter: @mhausenblas

Slide 14

Slide 14 text

Meet the three billy goats …

Slide 15

Slide 15 text

Hit me up on Twitter: @mhausenblas M C F

Slide 16

Slide 16 text

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)

Slide 17

Slide 17 text

M

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

C

Slide 20

Slide 20 text

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

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

F

Slide 23

Slide 23 text

Demo time! github.com/mhausenblas/imgn

Slide 24

Slide 24 text

Lessons learned

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

Resources

Slide 29

Slide 29 text

Hit me up on Twitter: @mhausenblas 29

Slide 30

Slide 30 text

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