Scaling strategy at Yammer – Arrrr Camp conf via @yarmand

 

Yann Armand,  from Yammer, at the rails and web conference Arrrr Camp, talk about scaling strategies on a service counting now 6 000 000 users.

Beginning

  • start from classical: User ->  Rails -> postgresql

 

Now

  • rails: 180 controllers, 340 models, 4 700 tests
  • 6 000 000 users
  • 480 000 000 request days
  • need scalability strategy
  • focus on speed / responsivness user side

Scalability based on 3 points

  1. sharding
  2. cahing
  3. dedicated services

1 Sharding

  • key point:  no cross machines transaction
  • horizontal sharding : sharding key by companies
  • growing == virtually infinite in horizontal scalability / sharding

2 Core services

  • different kind of services: real time : fast search : completion and so on…
  • a lot of services with one reponsibility
  • HTTP Restfull services
  • the simpler service is:
    • easier to build
    • easier to test
    • easier to monitor
    • easier to repair
  • small is beautiful in active record impossible – in the right  place elsewhere : simple !

3 Caching

  • page caching: good for static not for authenticated user content -> next
  • action caching (rails controller): differences by user on our case -> next
  • fragment caching, caches parts of the code:  too complex -> next
  • Record cache !  gem caching the database queries
  • invalidate is automatically called on model record save
  • do we have issues ?
    • rendering data in views anyway, so outside of record cache
    • raw sql update (active record bypass) : you have to  handle cache invalidation yourself
  • So ? 98% hits rate
  • 20 000 000 memcache hits a day: it rocks !

 

1 reply
  1. yarmand
    yarmand says:

    Oh my god, you’re so fast Mathieu, I didn’t know the video was already online.
    I am so rubbish speaking english.
     
    Thanks for the transcript by the way.

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *