running a docker based backend in the cloud
TRANSCRIPT
1JavaMeetup Berlin|28thof June2016
Florian Feigenbutz / @flofeigenbutz
Running a Docker Based
Backend in the Cloud
by
2JavaMeetup Berlin|28thof June2016
Agenda
• What is mealy?
• mealy’s Backend Stack
• Production in the Cloud
• Lessons Learned
• Live Release
3JavaMeetup Berlin|28thof June2016
mealy: More than just an app
! Personal Cookbook
" Personal Shopper
# Social Network
$ Market Place
5JavaMeetup Berlin|28thof June2016
mealy‘s Backend Stack
• BloggerPlatform+APIforMobileApp
• JavawithSpring+somePython
• MySQLandMongoDB• RabbitMQ
• DistributedApplication//Microservice Architecture• EachServicerunsinasingleDockercontainer
5
7JavaMeetup Berlin|28thof June2016
Basic Docker
• Containerswrapsoftwareinacompletefilesystem• Linuxkernelfeatures(controlgroups,namespaces,aufs)+extensions• OS-levelvirtualization• Isolatedfilesystempercontainer
• ImagineaslightweightVMs• ShareOS• Sharecommonfiles• Uselayeredfilesystem
• RunsonLinux,OSX&Windows
7
8JavaMeetup Berlin|28thof June2016
Docker Ecosystem
• DockerEngine:Core- buildsDockerfiles intoimages,runscontainers• DockerHub:Hostingrepositoryserviceforbuiltimages• DockerMachine:CreateDockerinstancesindifferentenvironments• DockerSwarm:EnablesclustersofDockerinstances• DockerCompose:Manageapplicationsspanningmultiplecontainers• DockerCloud:ScaleComposeapplicationsusingpublicclouds• DockerDataCenter:Hostedall-in-onesolution
8
10JavaMeetup Berlin|28thof June2016
Running in Production
• WrappedSoftware:• Buildingready-to-goDockerimages• Includeencryptedconfiguration
• Availability:Blue/GreenDeployment• Ensureavailabilityatalltimes• Self-Madevs.AssistedSolution• Inourcase:MicrosoftAzureVMsvs.AWSECS
10
11JavaMeetup Berlin|28thof June2016
Build Process
• SprintBootbuildsself-runningJAR• WeuseGradle…
• UsingJenkinsCIto• buildJAR• build&pushtorepository• runimages
• SampleDockerfile:FROM java:8MAINTAINER [email protected] 8080ADD build/mealy-recipes.jar /data/mealy-recipes.jarCMD java -jar /data/mealy-recipes.jar
11
14JavaMeetup Berlin|28thof June2016
Lessons Learned
• Separatepersistentstorage• Riskoflosingdata
• Reducecomplexitywherepossible• FindyoursweetspotintheDockerecosystem
• LoggingTunnel• NofuntoSSHintosinglemachines• AWS:CloudWatch Logs
• Monitoring• BackendServiceMetrics&ResponseTimes• EndUserExperience:AppCrashes&ResponseTimesinApp
14
16JavaMeetup Berlin|28thof June2016
It’s Q&A Time…!
Florian FeigenbutzHead of Backend Development
% flofeigenbutz
Thank you.