Skip to content

Instantly share code, notes, and snippets.

@vinbarnes
Created March 1, 2011 18:20
Show Gist options
  • Save vinbarnes/849589 to your computer and use it in GitHub Desktop.
Save vinbarnes/849589 to your computer and use it in GitHub Desktop.
notes from @ajsharp
twitter mobile engineer
async requests
kestrel: scala port of starling
## sms code
* twitter mobile site was first deployed with unicorn
* twitter mobile site now uses rainbows (for concurrency reasons)
class Tweet
include Validatable
include Objectification
exposes :id, :name, ..., :more_attrs
objectifies 'user' => User,
'created_at' => lambda { |val| Time.parse(val) }
'place' => Place
end
## Scaling
* frontend cpu
* use yajl for json
* order of magnitude faster than ruby C json library
* use gd2 for images
* object allocations
* be careful with object allocation, GC is expensive
* temp string creation
* prioritize concurrency
* i/o bound (i.e. database)
* 1.8 threads are cheap
* typheous is GIL friendly
** i.e. it wont pause your threads while waiting for api requests
## explicit block i/o
# all of these calls return proxy objects
@user = find_user
@trends = current_user.find_current_trends
@tweet = current_user.find_tweet
# drop down to typhoeus and do requests
current_user.fire_requests!
# 3. Best Practices
company culture is like cement
small agile teams: 1pm, 1 designer, 3 devs
iterative development
continuous shipping
* avg 3 deploys a day
* 10-30 branches each
* test suite alone would take about an hour to run, but tests are distributed
across many servers and run in about 2 mins
* write a feature in the morning, ship in the afternoon
* weekly iteration planning
* weekly internal releases
* strong belief in generalist developers
* specific testing practices are left up to the team, though unit testing is
highly encouraged
* little-a agile
* pair programming not company policy, left up to team, but highly encouraged
* no manual QA team clicking on buttons
* developers "own" their products
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment