#nostaging - software circus - amsterdam, 2-9-2016

36
@ PavelChunyay #nostaging Get rid of the false feeling of safety that staging environment gives by Pavel Chunyayev, 2-9-2016 Amsterdam, Pakhuis West Software Circus

Upload: pavel-chunyayev

Post on 13-Feb-2017

214 views

Category:

Software


5 download

TRANSCRIPT

Page 1: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

#nostagingGet rid of the false feeling of safety that staging environment gives

by Pavel Chunyayev, 2-9-2016Amsterdam, Pakhuis West

Software Circus

Page 3: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

The need for Staging environment

Page 4: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

It all started with pushing code directly to productionBut it was painful, unstable, broke everyone’s work, created instability

Page 5: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Environment before production to ensure quality

Page 6: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Environment before production to ensure quality - Staging

Page 7: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

More environments mapped into functions

Page 9: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Increase quality at the expense of timeFix must go through all the environmentsOr be pushed to production directly Data specific bugs are hard to reproduce before production

Page 10: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

WaterfallTest things before productionGate changed to productionAggregate changes to productionApprove delivery to production

Page 11: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Waterfall deploymentsDeploy to production at 3 in the morning on SaturdayPrepare for weeks, execute for hoursIf something goes wrong, rollback

Page 12: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Get some sleep in another life

Page 13: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Main problem: long living environmentsConfiguration driftDirty environmentsTesting is complicated

Page 14: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Immutable infrastructure to the rescue!1. Create environment just in time for the purpose2. Use it3. Dispose it when no longer needed

Page 15: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Don’t give names to servers

Page 17: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Immutable DTAP is not enough

Page 18: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

You can’t get clone of production3rd party integrations – should they be real or fake?Emails and notifications to usersInstance types and number

Page 19: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

You can’t get clone of production

No real usersFake data

Page 20: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Testing on staging provides fake confidence

Page 21: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Testing in production

Page 22: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Testing in production???Isn’t it where everyone’s heading?What is needed to achieve this?

Page 23: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

New style deploymentsShort-lived immutable infrastructureZero downtime deploymentsGood monitoringPossibility to quickly rollbackContinuous Delivery

Page 24: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Why would you need staging?Short-lived immutable infrastructureZero downtime deploymentsGood monitoringPossibility to quickly rollbackContinuous Delivery

Page 25: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Approaches• Feature flags• API Versioning• Circuit breakers• Dark launches• Incremental changes for schema migrations• Branch by abstraction• Preference for backwards-compatible changes

Page 26: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Why would you test on staging?You are testing synthetic scenariosThird of all the features are not required by usersThe rest are used differently than product manager expects

Page 27: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Why would you test on staging?We need to move as fast as possible from developer’s laptop to production to evaluate if feature is really needed

Page 28: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Perfomance testing on Staging?Not needed for every featureA lot of new features receive no load because users don’t need them

Page 29: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Perfomance testingProvision ephemeral server to run some load testsBetter do a rolling release and test with a real load, and add synthetic load on top

Page 30: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Staging microservices is painfulYou don’t have the systemYou have constantly changing system

Page 31: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

When to stage microservices?At night?Every hour?At every change?

Page 32: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Why bother staging microservices?If deployments are independent Failures are identified quicklyAnd rollback are simple and automated

Page 33: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

#nostaging in two easy steps:

Page 34: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Remove static DTAPAutomate environments provisioning and deploymentSo you can create any number of environments at any timeEstablish continuous delivery Heavily invest in automated testing Build quality in

Page 35: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Destroy Staging environmentInvest in monitoring, failure detection and recoveryPush small incremental pieces to production

Page 36: #nostaging - Software Circus - Amsterdam, 2-9-2016

@PavelChunyayev

Staging gives you a false sense of security that you don’t really have