I had seen Torvalds’ talk
on YouTube about git.But it wasn’t really about git - it was more about distributed version control.It answered many of my questions and clariﬁed DVCS ideas.I still wasn’t sold on the whole idea, and I had no idea what it was good for.
Unleash Your Code Join 500,000
coders with over 1,500,000 repositoriesWhat’s special about GitHub is that people use the site in spite of git.Many git haters use the site because of what it is - more than a place to hostgit repositories, but a place to share code with others.
2008 januaryWe launched the beta
in January at Steff’s on 2nd street in San Francisco’s SOMA district.The ﬁrst non-github user was wycats, and the ﬁrst non-github project was merb-core.They wanted to use the site for their refactoring and 0.9 branch.
the web siteAs everyone knows,
a web “site” is really a bunch of different components.Some of them generate and deliver HTML to you, but most of them don’t.Our site consists of four major code “frameworks” or “apps”
railsWe use Ruby on Rails
2.2.2 as our web framework.It’s kept up to date with all the security patches and includes custom patches we’ve addedourselves, as well as patches we’ve cherry-picked from more recent versions of Rails.
chimneyAll user routes are kept
in RedisChimney is how our BERT-RPC clients know which server to hitIt falls back to a local cache and auto-detection if Redis is down
chimneyIt can also be told
a backend is down.Optimized for connection refused but in reality that wasn’t the real problem - timeouts were
proxymachineAll anonymous git clones hit
the front end machinesthe git-daemon connects to proxymachine, which uses chimney to proxy yourconnection between the front end machine and the back end machine (which holdsthe actual git repository)very fast, transparent to you
fragmentsFormerly we invalidated most of
our fragments using a generation scheme,where you put a number into a bunch of related keys and increment itwhen you want all those caches to be missed (thus creating new cacheentries with fresh data)
fragmentsBut we had high cache
eviction due to low ram and hardware constraints, and foundthat scheme did more harm than good.We also noticed some cached data we wanted to remain forever was being evicted dueto the slabs with generational keys ﬁlling up fast
sha asset idInstead of using
scripty 301When we changed our
wiki URL structure, we setup dynamic 301 redirectsfor the old urls.Scriptaculous’ old wiki was getting hit so much we put the redirect into nginx itself -this took strain off our web app and made the redirects happen almost instantly
ajax loadingWe also load data
in via ajax in many places.Sometimes a piece of information will just take too long to retrieveIn those instances, we usually load it in with ajax
If Walker sees that it
doesn’t have all the information it needs, it kicks off a jobto stick that information in memcached.
We then periodically hit a
URL which checks if the information is in memcached or not.If it is, we get it and rewrite the page with the new information.
test unitWe mostly use Ruby’s
test/unit.We’ve experimented with other libraries including test/spec, shoulda, and RSpec, but in the endwe keep coming back to test/unit
git ﬁxturesAs many of our
ﬁxtures are git repositories, we specify in the test what shawe expect to be the HEAD of that ﬁxture.This means we can completely delete a git repository in one test, then have it back inpristine state in another. We plan to move all our ﬁxtures to a similar git-system in the future.
stagingWe also always deploy the
current branch to stagingThis means you can be working on your branch, someone else can be working on theirs,and you don’t need to worry about reconciling the two to test out a featureOne of the best parts of Git