With over 2 million and a half repositories, GitHub is the world’s largest source code host. Since day one, we’ve faced an unique engineering problem: making terabytes of Git data always available, either directly or through our website. This talk offers a hopefully insightful view into the internals of Git, the way its original design affects our scalable architecture, and the many things we’ve learnt while solving this fascinating problem.
6. githubGit 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
a fence by his underwear and.Saturday, May 11, 13
7. Let’s host some
Git repos!
file.c
src
file.h
README.md
COPYING.md
.git
Bare Repository
HEAD
index
objects
refs
git-daemon
Saturday, May 11, 13
8. OK, now about
the web...
grit Ruby - Git
interface
Saturday, May 11, 13
9. OK, now about
the web...
grit Bare Repo
Bare Repo
Bare Repo
Ruby - Git
interface
Saturday, May 11, 13
62. What do you mean
the server died?
Saturday, May 11, 13
63. 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?
Saturday, May 11, 13
66. libgit2
the “2” means this one
frees memory
NOT ENOUGH
ABSTRACT
FACTORIES
Saturday, May 11, 13
67. JGit
the “J” means this oneis in Java
...not our thing.
Saturday, May 11, 13
68. Javaa 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 WEBSCALE
2011
Saturday, May 11, 13
69. Javaa 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 WEBSCALE
2011
github
Saturday, May 11, 13
70. If you think you understand
the JVM, you are either:
Saturday, May 11, 13
71. If you think you understand
the JVM, you are either:
a) Very smart
Saturday, May 11, 13
72. If you think you understand
the JVM, you are either:
a) Very smart
b) Very wrong
Saturday, May 11, 13
73. If you think you understand
the JVM, you are either:
a) Very smart
b) Very wrong
Saturday, May 11, 13
97. Number of hops on a complex query
1,000,000
Saturday, May 11, 13
98. Number of hops on a complex query
1,000,000
Required hops for a successful query
1,000,000
Saturday, May 11, 13
99. 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
Saturday, May 11, 13