Production: Designing for Testability Michael Bryzek mike@flow.io - - PowerPoint PPT Presentation

production designing for testability
SMART_READER_LITE
LIVE PREVIEW

Production: Designing for Testability Michael Bryzek mike@flow.io - - PowerPoint PPT Presentation

Production: Designing for Testability Michael Bryzek mike@flow.io / @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO Gilt Think about something you deployed recently to production Is It Working? Right now in production? How do you know?


slide-1
SLIDE 1

Production: Designing for Testability

Michael Bryzek

mike@flow.io / @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO Gilt

slide-2
SLIDE 2

Think about something you deployed recently to production…

slide-3
SLIDE 3

Is It Working?

slide-4
SLIDE 4

Right now in production?

slide-5
SLIDE 5

How do you know?

slide-6
SLIDE 6

Feeling anxious?

slide-7
SLIDE 7

7

Let’s remove that anxiety

slide-8
SLIDE 8

About Me

www.flow.io www.gilt.com

slide-9
SLIDE 9

Software Quality is Hard

Think end to end for entire lifecycle of code Verification in Production is a powerful technique to help us build quality software

slide-10
SLIDE 10

True continuous delivery No staging environments Don’t run code locally

Life at Flow: Delivering Quality Software

slide-11
SLIDE 11

True Continuous Delivery

Automated tests / No safeguards 1 way to do something Assume Continuous Delivery in Design Process

github.com/flowcommerce/delta

slide-12
SLIDE 12

“I love my staging environment”

Said Nobody Ever

slide-13
SLIDE 13

No Staging Environments

Bottlenecks Fragile Difficult to understand failure Expensive (30-40% of budget common) Create the wrong incentives

slide-14
SLIDE 14

Don’t run code locally

If unsure, write the test! Learn to trust your tests

slide-15
SLIDE 15

Quality Through Architecture

Extreme Isolation

  • Rich event streams
  • Own DNS, load balancer
  • Private database
  • No consul/zk/shared state
  • Stop cascading failures
  • “Delay” not “Outage”
slide-16
SLIDE 16

Let’s look at real examples Successfully “testing in production”

slide-17
SLIDE 17

Example: Know That Checkout Works

Bot places an order every few minutes Identify test orders and immediately cancel

slide-18
SLIDE 18

Example: Support “Sandbox” Accounts

”SaaS” – even for internal accounts Mark individual accounts as sandbox One API Key for all sandbox accounts

"every service is a third party"

slide-19
SLIDE 19

Example: End to End Integration Tests

Create Sandbox Org Run tests Delete Sandbox Org

“Safe and Repeatable”

slide-20
SLIDE 20

Example: Using Sandbox Account for Test Orders

slide-21
SLIDE 21

Example: Verifying Proxy Server Works as Expected

https://github.com/flowvault/proxy

slide-22
SLIDE 22

Operating As Expected

slide-23
SLIDE 23

But sometimes things go wrong Even to the best of teams

slide-24
SLIDE 24

Considerations

Make production access explicit (not the default) Use defined paths (e.g. API calls) Restrict sensitive data Design for side effects

slide-25
SLIDE 25

Unexpected Benefits

slide-26
SLIDE 26

Perfect Documentation

slide-27
SLIDE 27

Capture request/response of API Calls

slide-28
SLIDE 28

Tooling: API | Builder

(formerly known as apidoc) 28

www.apibuilder.io Version control for APIs Backwards Compatibility High Quality Mocks

slide-29
SLIDE 29

High Quality Mocks – From Specs

Full Mock Generated Implement Only What You Need To Test www.apibuilder.io

slide-30
SLIDE 30

Tooling: Real Time DB Monitoring

https://www.vividcortex.com/blog/2014/04/22/visualizing-impact-index-change/

slide-31
SLIDE 31

Tooling: Super Simple Alerts from Log

Log a prefix Schedule a real time alert

slide-32
SLIDE 32

Key Takeaways – Design Production to be Testable

Trust your tests, run subset in production Invest in continuous delivery Sandbox accounts are powerful High quality, trustworthy mocks Real-time feedback from production

slide-33
SLIDE 33

Thank You!

We’re hiring: https://www.flow.io/careers Michael Bryzek

mike@flow.io / @mbryzek Cofounder / CTO Flow Cofounder / ex-CTO Gilt