Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

Thanks for being here

Slide 3

Slide 3 text

No content

Slide 4

Slide 4 text

github

Slide 5

Slide 5 text

github Git hosting: No longer a pain in the ass

Slide 6

Slide 6 text

github Git hosting: No longer a pain in the ass for you. Not for us. Because, goddamnit, if I ever find the guy who invented this thing I’m going to hang him from

Slide 7

Slide 7 text

Let’s host some Git repos!  file.c  src  file.h  README.md  COPYING.md  .git  Bare Repository  HEAD  index  objects  refs git-daemon

Slide 8

Slide 8 text

OK, now about the web... grit Ruby - Git interface

Slide 9

Slide 9 text

OK, now about the web... grit  Bare Repo  Bare Repo  Bare Repo Ruby - Git interface

Slide 10

Slide 10 text

1VM grit storage rails app

Slide 11

Slide 11 text

nVM storage

Slide 12

Slide 12 text

nVM storage (GFS)

Slide 13

Slide 13 text

Rails was making us slow.

Slide 14

Slide 14 text

No content

Slide 15

Slide 15 text

Literally.

Slide 16

Slide 16 text

Time to move to Real Hardware

Slide 17

Slide 17 text

fileservers frontends db

Slide 18

Slide 18 text

fileservers frontends db ?????????

Slide 19

Slide 19 text

smoke

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

bert (binary Erlang term)

Slide 22

Slide 22 text

bert (binary Erlang term) ernie (not an acronym)

Slide 23

Slide 23 text

chimney (Redis) frontend fileserver smoke grit ernie grit

Slide 24

Slide 24 text

Horizontal Scaling Vertical Scaling

Slide 25

Slide 25 text

Horizontal Scaling Vertical Scaling problums wit them gigabits problums wit them gigahurtz

Slide 26

Slide 26 text

them gigabits

Slide 27

Slide 27 text

bummer x4180 = A LOT.

Slide 28

Slide 28 text

NetShard       ... alternate network

Slide 29

Slide 29 text

NetShard       ...  alternate network

Slide 30

Slide 30 text

them gigahurtz

Slide 31

Slide 31 text

bottleneck: grit

Slide 32

Slide 32 text

bottleneck: grit solution: git shell out to

Slide 33

Slide 33 text

bottleneck: git shell out to

Slide 34

Slide 34 text

bottleneck: git solution: git shell out to shell out to

Slide 35

Slide 35 text

bottleneck: git solution: git shell out to shell out to properly

Slide 36

Slide 36 text

posix_spawn

Slide 37

Slide 37 text

posix_spawn Seriously. < 1ms

Slide 38

Slide 38 text

posix_spawn Seriously. < 1ms The issue is not in “shelling out”, the issue is in the spawned process.

Slide 39

Slide 39 text

No content

Slide 40

Slide 40 text

GUISE

Slide 41

Slide 41 text

GUISE GUISE

Slide 42

Slide 42 text

GUISE GUISE GUISE

Slide 43

Slide 43 text

GUISE GUISE GUISE ...what?

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

Why don’t we take

Slide 46

Slide 46 text

Why don’t we take the Git binary...

Slide 47

Slide 47 text

Why don’t we take the Git binary... yeah?

Slide 48

Slide 48 text

Why don’t we take the Git binary... yeah? and compile it as

Slide 49

Slide 49 text

Why don’t we take the Git binary... yeah? and compile it as a library

Slide 50

Slide 50 text

Why don’t we take the Git binary... yeah? and compile it as a library oh... go on...

Slide 51

Slide 51 text

Why don’t we take the Git binary... yeah? and compile it as a library oh... go on... and link that into

Slide 52

Slide 52 text

Why don’t we take the Git binary... yeah? and compile it as a library oh... go on... and link that into our server

Slide 53

Slide 53 text

Scientific Graph™

Slide 54

Slide 54 text

Memory Usage Time Scientific Graph™

Slide 55

Slide 55 text

Memory Usage Time Scientific Graph™

Slide 56

Slide 56 text

Memory Usage Time Scientific Graph™

Slide 57

Slide 57 text

Memory Usage Time Scientific Graph™

Slide 58

Slide 58 text

Memory Usage Time Scientific Graph™

Slide 59

Slide 59 text

Memory Usage Time Scientific Graph™

Slide 60

Slide 60 text

No content

Slide 61

Slide 61 text

Well, we didn’t think about

Slide 62

Slide 62 text

Well, we didn’t think about freeing memory, but...

Slide 63

Slide 63 text

Well, we didn’t think about freeing memory, but... THIS IS THE KIND OF PROBLEM WE COULD SOLVE WITH CGI

Slide 64

Slide 64 text

Well, we didn’t think about freeing memory, but... THIS IS THE KIND OF PROBLEM WE COULD SOLVE WITH CGI IN 1995

Slide 65

Slide 65 text

Scientific Graph™

Slide 66

Slide 66 text

Memory Usage Time Scientific Graph™

Slide 67

Slide 67 text

Memory Usage Time Scientific Graph™

Slide 68

Slide 68 text

Memory Usage Time Scientific Graph™

Slide 69

Slide 69 text

Memory Usage Time Scientific Graph™

Slide 70

Slide 70 text

Memory Usage Time Scientific Graph™

Slide 71

Slide 71 text

Memory Usage Time Scientific Graph™

Slide 72

Slide 72 text

Memory Usage Time Scientific Graph™

Slide 73

Slide 73 text

What do you mean the server died?

Slide 74

Slide 74 text

die("BUG: non-INDEX attr direction in a bare repo"); What do you mean the server died?

Slide 75

Slide 75 text

die("BUG: non-INDEX attr direction in a bare repo"); die("a bad revision is needed"); What do you mean the server died?

Slide 76

Slide 76 text

die("BUG: non-INDEX attr direction in a bare repo"); die("a bad revision is needed"); die("'%s' is not a valid branch name.", name); What do you mean the server died?

Slide 77

Slide 77 text

die("BUG: non-INDEX attr direction in a bare repo"); die("a bad revision is needed"); die("'%s' is not a valid branch name.", name); die("Empty patch. Aborted."); What do you mean the server died?

Slide 78

Slide 78 text

die("BUG: non-INDEX attr direction in a bare repo"); die("a bad revision is needed"); die("'%s' is not a valid branch name.", name); die("Empty patch. Aborted."); die("unable to read index file"); What do you mean the server died?

Slide 79

Slide 79 text

libgit

Slide 80

Slide 80 text

libgit2 the “2” means this one frees memory

Slide 81

Slide 81 text

libgit2 the “2” means this one frees memory NOT ENOUGH ABSTRACT FACTORIES

Slide 82

Slide 82 text

JGit the “J” means this one is in Java ...not our thing.

Slide 83

Slide 83 text

Java a brief timeline New companies don’t use Java because it’s not like Unix 1995 New companies use Java because it’s new and shiny 1997 New companies don’t use Java because it’s ooooooold 2005 New companies use the JVM because 2011

Slide 84

Slide 84 text

Java a brief timeline New companies don’t use Java because it’s not like Unix 1995 New companies use Java because it’s new and shiny 1997 New companies don’t use Java because it’s ooooooold 2005 New companies use the JVM because 2011 github

Slide 85

Slide 85 text

If you think you understand the JVM, you are either:

Slide 86

Slide 86 text

If you think you understand the JVM, you are either: a) Very smart

Slide 87

Slide 87 text

If you think you understand the JVM, you are either: a) Very smart b) Very wrong

Slide 88

Slide 88 text

If you think you understand the JVM, you are either: a) Very smart b) Very wrong

Slide 89

Slide 89 text

Some people think that github is a Rails shop Ruby shop. or even a

Slide 90

Slide 90 text

Some people think that github is a Rails shop Ruby shop. or even a github is a Unix shop and everything else is just a detail.

Slide 91

Slide 91 text

libgit2 So,

Slide 92

Slide 92 text

libgit2 a brief timeline Shawn Pearce The Past

Slide 93

Slide 93 text

libgit2 a brief timeline Shawn Pearce myself The Past

Slide 94

Slide 94 text

libgit2 a brief timeline Shawn Pearce myself myself (about to have a mental breakdown) The Past

Slide 95

Slide 95 text

libgit2 a brief timeline Shawn Pearce myself myself (about to have a mental breakdown) myself (having a mental breakdown) The Past

Slide 96

Slide 96 text

libgit2 a brief timeline Shawn Pearce myself myself (about to have a mental breakdown) myself (having a mental breakdown) myself (reaching Git nirvana) The Past

Slide 97

Slide 97 text

libgit2 a brief timeline Shawn Pearce myself myself (about to have a mental breakdown) myself (having a mental breakdown) myself (reaching Git nirvana) The Past Russell Belfer Carlos Martín Michael Schubert Ben Straub real contributors

Slide 98

Slide 98 text

libgit2 a brief timeline ?

Slide 99

Slide 99 text

libgit2 a brief timeline ?

Slide 100

Slide 100 text

libgit2 a brief timeline ? 1.0 release

Slide 101

Slide 101 text

libgit2

Slide 102

Slide 102 text

libgit2

Slide 103

Slide 103 text

Good Heavens, just look at the time. It’s NoSQL o’clock NoSQL NoSQL NoSQL NoSQL NoSQL NoSQL NoSQL NoSQL

Slide 104

Slide 104 text

No content

Slide 105

Slide 105 text

...do you even

Slide 106

Slide 106 text

...do you even mongo?

Slide 107

Slide 107 text

Key-Value Stores The Magic of If you wish upon a star, and have a pure heart...

Slide 108

Slide 108 text

Key-Value Stores The Magic of If you wish upon a star, and have a pure heart... Anything can be a Key-Value store!

Slide 109

Slide 109 text

id name state lat 13 San Francisco CA 24 24 Phoenix AZ 33 7 Denver CO 40 8 Caribou ME 47 2 Los Angeles CA 22 SELECT * FROM CITIES WHERE name = ‘San Francisco’ Key-Value Stores The Magic of

Slide 110

Slide 110 text

Git is queried like a Key-Value Store But it is not a Key-Value store git show f3c896c1949476e85abc0d75bb2143656a9580a6

Slide 111

Slide 111 text

a b r i e f i n t r o d u c t i o n t o t h e G i t d a t a m o d e l

Slide 112

Slide 112 text

No content

Slide 113

Slide 113 text

No content

Slide 114

Slide 114 text

 file.c  src  file.h  README.md  COPYING.md

Slide 115

Slide 115 text

 file.c  src  file.h  README.md  COPYING.md tree src/ README.md COPYING.md tree file.c file.h blob blob blob blob

Slide 116

Slide 116 text

commit parent tree T metadata

Slide 117

Slide 117 text

commit T commit T commit T commit T commit T commit T Behold, a graph.

Slide 118

Slide 118 text

No content

Slide 119

Slide 119 text

Well that was easy.

Slide 120

Slide 120 text

No content

Slide 121

Slide 121 text

master Oh god kill me

Slide 122

Slide 122 text

Li le known torture methods:

Slide 123

Slide 123 text

No content

Slide 124

Slide 124 text

warning: the rabbit hole is pretty deep

Slide 125

Slide 125 text

No content

Slide 126

Slide 126 text

warning: git totally wasn’t designed for this

Slide 127

Slide 127 text

Git doesn’t give a #!%$ about CAP

Slide 128

Slide 128 text

No content

Slide 129

Slide 129 text

Number of hops on a complex query 1,000,000

Slide 130

Slide 130 text

Number of hops on a complex query 1,000,000 Required hops for a successful query 1,000,000

Slide 131

Slide 131 text

Number of hops on a complex query 1,000,000 Required hops for a successful query 1,000,000 Replica count to ensure 100% availability a metric shitton

Slide 132

Slide 132 text

We could fix it.

Slide 133

Slide 133 text

We could fix it. But we won’t.

Slide 134

Slide 134 text

GitRPC

Slide 135

Slide 135 text

GitRPC Less.

Slide 136

Slide 136 text

GitRPC Rugged libgit2 server Ruby Ruby C

Slide 137

Slide 137 text

chimney (Redis) frontend fileserver smoke grit ernie grit GitRPC GitRPC

Slide 138

Slide 138 text

chimney (Redis) frontend fileserver GitRPC GitRPC server client

Slide 139

Slide 139 text

New serialization protocol Banana Pack MessagePack + more

Slide 140

Slide 140 text

New serialization protocol Banana Pack MessagePack + more mochilo

Slide 141

Slide 141 text

New serialization protocol Banana Pack MessagePack + more mochilo Banana Phone

Slide 142

Slide 142 text

evolutionary (disappointing?)

Slide 143

Slide 143 text

Summary:

Slide 144

Slide 144 text

Ruby C Unix Unix Unix Unix Unix Unix Unix Unix Boring Boring Boring Boring Boring Summary:

Slide 145

Slide 145 text

Use the most reliable tools you know.

Slide 146

Slide 146 text

Challenge yourself to build the simplest thing. Not because it’s easy, but because it works.

Slide 147

Slide 147 text

Innovate where it really ma ers.

Slide 148

Slide 148 text

revolutionary product create a revolutionary backend. not a

Slide 149

Slide 149 text

No content

Slide 150

Slide 150 text

Q: Does Git scale?

Slide 151

Slide 151 text

Q: Does Git scale? A: Who cares?

Slide 152

Slide 152 text

No content