Optimera STHLM 2011 - Mikael Berggren, Spotify
Upcoming SlideShare
Loading in...5
×
 

Optimera STHLM 2011 - Mikael Berggren, Spotify

on

  • 837 views

 

Statistics

Views

Total Views
837
Views on SlideShare
837
Embed Views
0

Actions

Likes
0
Downloads
1
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Optimera STHLM 2011 - Mikael Berggren, Spotify Optimera STHLM 2011 - Mikael Berggren, Spotify Presentation Transcript

    • Is it Web Scale?   Mikael  Berggren   miken@spo1fy.com  
    • Who  is  this  old  guy?  •  Web  Team  Lead  @  Spo1fy  •  Started  back  in  the  the  glory  days  of  2000  •  Only  works  for  companies  beginning  with  an  S   (Spray,  Stardoll  &  Spo1fy)  
    • Is  /dev/null  web  scale?   “Mongo  DB  is  Web  Scale”  –  YouTube.com  
    • Success  in  scale  fail  •  Choose  by  buzz  /  trends  •  Use  technology  suitable  for  something   completely  different  •  Web  frameworks  •  Don’t  measure  or  look  at  graphs  
    • “We’re  using  X  and  it  scales”  •  There  is  no  magic  solu1on  that  scales  out  of   the  box  •  Choose  the  technology  you’re  familiar  with  •  Middle  bird  get’s  the  worm  
    • What  is  scaling?  •  It’s  about  lying  :)  •  Take  control  of  your  code  •  Push  instead  of  pull  •  Finding  boZlenecks  and  fix  them  •  Avoid  SPoF  as  much  as  you  can  •  Measure  and  analyze  
    • Cache  is  king!  •  Cache  on  mul1ple  instances  •  Cache  as  close  to  the  final  result  as  possible  •  Memcache  is  good  •  but  flat  files  is  even  beZer    
    • Using  memcache  •  Local  &  Global  instances  •  Global:  For  everything  that  needs  to  be   distributed  and  synchronized  •  Local:  For  everything  else  •  Make  sure  failovers  work  correctly  •  Use  getMul1  when  possible  •  Have  several  small  instances  instead  of  one   large  
    • File  cache  •  Fast  and  reliable  •  No  3rd  party  dependencies  •  Used  ocen  =>  Really  fast  access  •  Easy  to  scale  •  Atomic  updates  
    • Web  frameworks?  No  thanks!  •  Never  built  for  your  specific  needs.  If  they  are,   you’re  damn  lucky  :)  •  Hard  to  control  data  and  request  handling   your  way  (plugins,  modules)  •  A  lot  of  overhead  for  each  request  
    • Database  scaling  •  Do  your  homework  on  indexes  and  queries  •  Test  your  knowledge  on  indexes  and  queries  •  Use  slave  nodes  for  reads  •  Horizontal  sharding  for  segments  of  users  •  Ver1cal  sharding  for  user-­‐data  
    • RDB  vs.  NoSQL  •  “No”  in  NoSQL  stands  for  “Not  Only”  •  Use  the  correct  storage  for  your  purpose  •  Don’t  do  as  Digg.com…  
    • Scaling  at  Stardoll  •  >3500  dynamic  PV/s  •  Horizontal  sharding  of  user-­‐data  •  Pre-­‐genera1on  of  content  •  Measuring  render-­‐1me  for  each  page  
    • Scaling  at  Spo1fy  •  We  said  “Bye  Wordpress!”  and  the  servers   where  happy  again  •  95%  of  all  content:  flat  files  •  Dependencies  on  shared  services  •  Handle  huge  spikes  in  traffic  
    • PV/s  
    • Recommenda1ons  •  Have  a  code  standard  everyone  must  follow!  •  Great  error  handling  and  logging  •  Possibility  to  disable  features/func1onality  •  Try  to  do  requests  asynchronous  •  Avoid  race  condi1ons  •  Monitor,  measure  and  analyze    !important  
    • Questions?
    • And btw,we’re hiring   spo1fy.com/jobs