running a docker based backend in the cloud

16
1 Java Meetup Berlin| 28th of June 2016 Florian Feigenbutz / @flofeigenbutz Running a Docker Based Backend in the Cloud by

Upload: florian-feigenbutz

Post on 09-Jan-2017

323 views

Category:

Software


0 download

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

4JavaMeetup Berlin|28thof June2016

Backend Stack

5JavaMeetup Berlin|28thof June2016

mealy‘s Backend Stack

• BloggerPlatform+APIforMobileApp

• JavawithSpring+somePython

• MySQLandMongoDB• RabbitMQ

• DistributedApplication//Microservice Architecture• EachServicerunsinasingleDockercontainer

5

6JavaMeetup Berlin|28thof June2016

mealy‘s Backend Stack

6

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

9JavaMeetup Berlin|28thof June2016

Production in

the Cloud

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

12JavaMeetup Berlin|28thof June2016

First Setup: Self-Made Blue/Green Deployment

12

13JavaMeetup Berlin|28thof June2016

Now: Assisted Blue/Green Deployment via AWS

13

14JavaMeetup Berlin|28thof June2016

Lessons Learned

• Separatepersistentstorage• Riskoflosingdata

• Reducecomplexitywherepossible• FindyoursweetspotintheDockerecosystem

• LoggingTunnel• NofuntoSSHintosinglemachines• AWS:CloudWatch Logs

• Monitoring• BackendServiceMetrics&ResponseTimes• EndUserExperience:AppCrashes&ResponseTimesinApp

14

15JavaMeetup Berlin|28thof June2016

Live Deployment…

16JavaMeetup Berlin|28thof June2016

It’s Q&A Time…!

Florian FeigenbutzHead of Backend Development

% flofeigenbutz

& [email protected]

Thank you.