4. performance anxiety
big rails app performance issues
big team === development process hurdles
big traffic drinking problems
Reaching limit of Rails' caching
Low-level optimizations too "incremental"
Rewriting SQL is boring
Improve platform architecture
5. super bowl party
prelude:
jan 1. "btw we have pre/post super bowl commercials"
jan 15. "scored an in-game spot, we good?"
feb 15. offend the world
"spike mode":
CDN cache it all!
disable login
offload geocoding/subscriptions/orders to EC2
limited functionality === unhappy users
9. async personalization
target: deal/division pages (> 50% of traffic)
approach:
1. cache "anonymous" page in CDN
2. hide stuff
3. make AJAX request for personalized data/content
4. show stuff
See Chris Williams' "Rails’ Best Caching Method is JavaScript"
from GoRuCo 2010
17. onCurrentUserReady(callback)
callback when personalize API returns (or callback immediately
for anonymous user)
before:
- if logged_in?
do stuff for logged-in user
- else
do stuff for anonymous user
after:
Groupon.onCurrentUserReady(function(){
if (Groupon.currentUser.isAuthenticated) {
do stuff for logged-in user
} else { do stuff for anonymous user }
});
18. analytics
Problem: Request logging
Solution: Tracking pixel (hit Nginx only, not Rails)
Problem: Content changes
Solution: Dynamic tracking pixel
Problem: Tracking params (e.g. utm params, affiliate id, etc...)
Solution: Store in cookie; append params to API request
19. a/b testing with Finch
Problem: Finch uses view/controller logic to choose and track
experiments and variants
- experiment 'Two vs. Three Step Subscription' do |e|
- e.variant 'Original' do
%h1 Fill out this form to subscribe now
- e.variant 'Two Step' do
%h4 Follow these two steps to subscribe
- e.variant 'Three Step' do
%p Subscribe now - it only takes a few seconds
21. Finch.js
based on Google's "Overlapping Experiment Infrastructure"
written in coffee-script
open source soon-ishly
~ 15k of JS
doesn't handle tracking/analytics/analysis side of testing
(yet?)
22. the future
pure-JSON API requests
client-side rendering (/w mustache.js)
HTML5 storage
decouple from Rails
development practices:
front/back-end integration
better testing
better monitoring