Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using Ruby & Rails in the wild - Gogobot use case

Avi Tzurel
September 10, 2012

Using Ruby & Rails in the wild - Gogobot use case

Talk I gave at an Israeli meetup about Ruby and Rails vs other languages/frameworks.

Avi Tzurel

September 10, 2012
Tweet

More Decks by Avi Tzurel

Other Decks in Technology

Transcript

  1. ݆ૉ Ruby & Rails In the wild Gogobot use-case Avi

    Tzurel Gogobot Monday, September 10, 12
  2. CDN • Edge servers across the world (hundreds) • Caches

    static assets • CSS, JS, Images • Caches full pages (with smart expire API) Monday, September 10, 12
  3. Reverse Proxy • Super fast connection from edges means users

    get a local experience, with minimal latency • Cache miss? get from load balancer • Logged out traffic almost never hits or affects logged in traffic • scale differently, control differently Monday, September 10, 12
  4. Front End • Serves user facing content • Communicates with

    cache layer and the DB • No heavy lifting, respond to the user as fast as possible Monday, September 10, 12
  5. Back End • Serves realtime services (Facebook, Twitter) • Heavy

    lifting thrown at it from the Front End Machines • Hosts workers for the queue service Monday, September 10, 12
  6. Cache • Memcached cluster • Memcached 1.4+ • 6+ Machines

    • 4.5 - 15K operations per second • Hosted on Amazon ElastiCache • Solved tons of problems with memcached dying Monday, September 10, 12
  7. MySql • Master + 2 Slaves • 64G memory for

    each machine with 400G storage • Hourly backups • Used as the main persistence layer for the site • Reads are from slaves, writes are from master • Logged out traffic will never have access the master Monday, September 10, 12
  8. MySql • EBS snapshots are used as backups • Multi

    region support for Amazon (1a, 1b, 1c) Monday, September 10, 12
  9. MongoDB • 6 Shard • 3 Replica sets in each

    shards • 16HD (100G) raid on each machine • 64G memory for each machine to provide out of memory index for all queries • Used for the Graph Engine + Scoring system Monday, September 10, 12
  10. Redis • Used for key+value store • Cache tagging solution

    on top of memcached • Queue services is hosted on Redis • Master / Slave replica • different redis cluster for different things Monday, September 10, 12
  11. Redis • Different Redis clusters for each need • Indexer

    • Cache tagging • Realtime push with Node.js to the client • When one down, others behave normally Monday, September 10, 12
  12. SOLR • Search index • NoSQL (Schema Less) • Master/Slave

    • Slave on each app machine, single master • Eventual consistency Monday, September 10, 12
  13. Numbers • 400m+ graph users • 10K triggers per user

    in the scoring system • Grew ~170X last 18 months • Announced 1m registered users a month ago • hit 2m registered users 2 weeks agter Monday, September 10, 12
  14. “Sometimes I want to do Ruby because it means I’m

    more likely to be able to TDD.” Greg Malcolm Monday, September 10, 12
  15. “Ruby on Rails is astounding. Using it is like watching

    a kung-fu movie, where a dozen bad-ass frameworks prepare to beat up the little newcomer only to be handed their asses in a variety of imaginative ways.” Nathan Tarkington, O'Reilly Publishing Monday, September 10, 12
  16. No other language / framework is able to do such

    things Monday, September 10, 12