scaling an api: from reboots to redis, how (not) to do it
DESCRIPTION
How do you massively scale an API as your business grows? Ciaran worked for a company that has grown from a small B2C app written in PHP/MySQL to a B2B advertising company doing 15 Billion API calls per month. Along the way there have been some big technology changes and decisions that have both helped and hindered us. Along the way we have had 3 day outages, several AWS outages, massive traffic spikes especially early days when we signed customers like Wordpress.com, and many many improvements, re-factors and even successes. Today and for the last year we are highly modern engineering team, using many of the latest technologies and methodologies. We code in PHP and Python with C, Go, CoffeeScript and more, store data in MongoDB, Redis, memcache, Solr and MySQL, we have a full CI environment, do deploys using IRC (and Hubot) and Puppet everything. We have 100% (not 99.999%) up time for over 12 months now.TRANSCRIPT
Scaling an APIFrom Reboots to Redis, how (not) to do it
{ "fullName": "Ciarán Rooney", "work": { "position": ["CTO", "Speaker", "Mentor"] }, "home": { "email": "[email protected]", "twitter": "@CiaranR", "website": "http://ciaran.ie", "hobby": "http://phplondon.org" }}
{ "dataYear": "2013", "dataMonth": "april", "dataPeriod": "30 days", "dataRequests": { "apiRequests": "18,256,654,541", "impressions": “5,773,142,857", "uniqueUsers": "145,137,679" }, "customers": { "websitesPowered": "1,087,348", "customers": "26,379" }}
BIND / DNS
imageStorage
imageStorage
imageStorage
APIs
Database Master/Slave
Client App
Client App
Database Master/Slave
APIs
WordPress
WordPress Pinterest
Client App
Database Master/Slave
APIs
WordPress
SkimWords™
APIxx
APIxx APIxx APIxx APIxx APIxx APIxx APIxx APIxx
CLUSTERxx
ELBELB
CLUSTERxx CLUSTERxx CLUSTERxx CLUSTERxxCLUSTERxx
US-WEST US-EAST EU-WEST
JAYxx
Apache Flume
JAYxx JAYxx JAYxx JAYxx JAYxx JAYxx JAYxx JAYxx
ELBELB
CLUSTERxx
Apache FlumeCollector
C Prefix Tree C NLP Filterin
g
CLUSTERxx CLUSTERxx CLUSTERxx CLUSTERxxCLUSTERxx
US-WEST
US-EAST EU-WEST
Apache FlumeMaster
Cacti
Conclusions
Small Scalable units
Horizontal is always better
Eliminate Single points of failure
Scale writes and reads separately
Automate everything
Monitor everything
Scaling an APIFrom Reboots to Redis, how (not) to do it
Questions?
{ "fullName": "Ciarán Rooney", "workLife": { "position": "CTO" }, "homeLife": { "email": "[email protected]", "twitter": "@CiaranR", "website": "http://ciaran.ie", "hobby": "http://phplondon.org" }}