Slide 1

Slide 1 text

Failure or (The Unexpected Virtue of Functional Programming) @markhibberd

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Act I Working Software

Slide 4

Slide 4 text

No content

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

“Why do we continue in this miserable condition” - George Orwell, Animal Farm

Slide 7

Slide 7 text

Reliability

Slide 8

Slide 8 text

Correctness Reliability

Slide 9

Slide 9 text

Correctness Reliability (the correct answer)

Slide 10

Slide 10 text

Correctness Correctness (the correct answer)

Slide 11

Slide 11 text

Correctness Reliability Correctness (the correct answer)

Slide 12

Slide 12 text

Correctness Reliability (whenever i need it) (the correct answer) Correctness

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

No content

Slide 16

Slide 16 text

No content

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

“Several of them would have protested if they could have found the right arguments.” - George Orwell, Animal Farm

Slide 19

Slide 19 text

Act II Post Functional

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

Data

Slide 23

Slide 23 text

Decisions

Slide 24

Slide 24 text

Outcomes

Slide 25

Slide 25 text

Measurement

Slide 26

Slide 26 text

λx.f x

Slide 27

Slide 27 text

120+ code bases Pure, Typed FP Haskell, Scala & Stuff

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Stats and Reliability

Slide 30

Slide 30 text

bad things can happen…

Slide 31

Slide 31 text

P(failure) = 0.1

Slide 32

Slide 32 text

P(failure) = 0.1

Slide 33

Slide 33 text

redundancy

Slide 34

Slide 34 text

redundancy

Slide 35

Slide 35 text

P(individual failure) = 0.1

Slide 36

Slide 36 text

P(system failure) = 0.1^10

Slide 37

Slide 37 text

are failures really independent?

Slide 38

Slide 38 text

P(mutually assured destruction) = 1

Slide 39

Slide 39 text

redundancy

Slide 40

Slide 40 text

but if one goes…

Slide 41

Slide 41 text

they all do

Slide 42

Slide 42 text

P(individual failure) = 0.1

Slide 43

Slide 43 text

P(individual success) = 1 - 0.1 = 0.9

Slide 44

Slide 44 text

P(all successes) = 0.9^10

Slide 45

Slide 45 text

P(system failure) = 1 - 0.9^10

Slide 46

Slide 46 text

P(system failure) = 1 - 0.9^10 = 0.65

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

P(system failure) = 1 - 0.9^10 = 0.65

Slide 49

Slide 49 text

Correctness Reliability (whenever i need it) (the correct answer) Correctness

Slide 50

Slide 50 text

Correctness Reliability (produce the decisions by X o’clock using the last vetted dataset) (the best set of measurable decisions for today) Correctness

Slide 51

Slide 51 text

No content

Slide 52

Slide 52 text

Separation of Data and Computation

Slide 53

Slide 53 text

If we can achieve reliable data, reliable computation should be pretty straightforward

Slide 54

Slide 54 text

Can you restart your system at any point?

Slide 55

Slide 55 text

Could you turn your long running daemon into a cron job?

Slide 56

Slide 56 text

Reliable Data

Slide 57

Slide 57 text

If you have untangled your computation from your data, someone has probably solved your data storage requirements

Slide 58

Slide 58 text

But… Failure is never clean. One of the most difficult challenges is ensuring that we only have known good states, failure must not corrupt.

Slide 59

Slide 59 text

Do you know the provenance of each piece of data in your system?

Slide 60

Slide 60 text

If you detected a failure, would you be able to identify the downstream effects?

Slide 61

Slide 61 text

Are there multiple paths to build a dataset? Could we rebuild from an alternate source if we needed to?

Slide 62

Slide 62 text

Fail Hard or Monitor

Slide 63

Slide 63 text

“fault isolation advocates that the process software be fail-fast, it should either function correctly or it should detect the fault, signal failure and stop operating” - Jim Gray, Why Do Computers Stop and What Can Be Done About It?

Slide 64

Slide 64 text

But… often it is the sorta close, kinda reasonable, inputs that will hurt

Slide 65

Slide 65 text

garbage in, garbage out 9134

Slide 66

Slide 66 text

garbage in, garbage out 9134 42

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

Fail Fast & Hard, otherwise Monitor Heavily

Slide 69

Slide 69 text

monitor data in context 9134 4 3 3

Slide 70

Slide 70 text

monitor data in context 9134 4 3 3

Slide 71

Slide 71 text

Reliable Sub-Systems

Slide 72

Slide 72 text

P(failure) = 0.1

Slide 73

Slide 73 text

P(failure) = 0.01

Slide 74

Slide 74 text

P(failure) = 0.001

Slide 75

Slide 75 text

P(failure) = $$$

Slide 76

Slide 76 text

P(failure) = sleep

Slide 77

Slide 77 text

No content

Slide 78

Slide 78 text

No content

Slide 79

Slide 79 text

“All animals are equal, but some animals are more equal than others.” - George Orwell, Animal Farm

Slide 80

Slide 80 text

überblock

Slide 81

Slide 81 text

0x00bab10c

Slide 82

Slide 82 text

0x00bab10c

Slide 83

Slide 83 text

0x00bab10c

Slide 84

Slide 84 text

0x00bab10c

Slide 85

Slide 85 text

0x00bab10c

Slide 86

Slide 86 text

No content

Slide 87

Slide 87 text

No content

Slide 88

Slide 88 text

No content

Slide 89

Slide 89 text

No content

Slide 90

Slide 90 text

No content

Slide 91

Slide 91 text

No content

Slide 92

Slide 92 text

Ditto Blocks

Slide 93

Slide 93 text

More Important, More Replication

Slide 94

Slide 94 text

*bonus*

Slide 95

Slide 95 text

*bonus* Built in data verification & self healing

Slide 96

Slide 96 text

*bonus* Each block maintains integrity of children

Slide 97

Slide 97 text

*bonus* Merkle Tree hash(b1, b2) hash(g1, g2) hash(g3, g4) hash(data)

Slide 98

Slide 98 text

“ZFS has been subjected to over a million forced, violent crashes without losing data integrity or leaking a single block.” - Bonwick & Moore, ZFS The Last Word in File Systems

Slide 99

Slide 99 text

Isolation End-to-End

Slide 100

Slide 100 text

code

Slide 101

Slide 101 text

build & test

Slide 102

Slide 102 text

fail

Slide 103

Slide 103 text

fail

Slide 104

Slide 104 text

fail

Slide 105

Slide 105 text

Almost everything that happens after a build undermines the isolation we have worked hard to achieve

Slide 106

Slide 106 text

No content

Slide 107

Slide 107 text

If I can’t run multiple versions of the same code in parallel, one programming error can bring everything down

Slide 108

Slide 108 text

No content

Slide 109

Slide 109 text

remember these?

Slide 110

Slide 110 text

No content

Slide 111

Slide 111 text

No content

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

No content

Slide 115

Slide 115 text

If I can run multiple versions of my code, but only one version of my infrastructure…

Slide 116

Slide 116 text

No content

Slide 117

Slide 117 text

No content

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

No content

Slide 120

Slide 120 text

No content

Slide 121

Slide 121 text

No content

Slide 122

Slide 122 text

Act III Building Systems

Slide 123

Slide 123 text

“construct reliable systems from unreliable parts … from the knowledge that any component in the system might fail” - Holzman & Joshi, Reliable Software Systems Design

Slide 124

Slide 124 text

the library worst library ever…

Slide 125

Slide 125 text

No content

Slide 126

Slide 126 text

the library worst library ever…

Slide 127

Slide 127 text

the library worst library ever…

Slide 128

Slide 128 text

the library P(failure) = 0.8

Slide 129

Slide 129 text

the library P(failure) = 0.8 No Separation of Computation and Data

Slide 130

Slide 130 text

the library P(failure) = 0.8

Slide 131

Slide 131 text

the library P(failure) = 0.8 Crashes Corrupt The Data Store

Slide 132

Slide 132 text

No content

Slide 133

Slide 133 text

the library P(failure) = 0.8 proxy

Slide 134

Slide 134 text

the library P(failure) = 0.8 proxy journal Reliable data storage

Slide 135

Slide 135 text

the library P(failure) = 0.8 proxy journal On failure replay journal

Slide 136

Slide 136 text

the library P(failure) = 0.8 proxy journal We have isolated failures

Slide 137

Slide 137 text

the library P(failure) = 0.8^n proxy journal the library

Slide 138

Slide 138 text

the library P(failure) = 0.8^2 = 0.64 proxy journal the library

Slide 139

Slide 139 text

the library P(failure) = 0.8^10 = 0.10 proxy journal the library

Slide 140

Slide 140 text

the library P(failure) = 0.8^20 = 0.01 proxy journal the library

Slide 141

Slide 141 text

“A beach house isn’t just real estate. It’s a state of mind.” - Douglas Adams, Mostly Harmless

Slide 142

Slide 142 text

No content