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
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