A year ago we started a big change in FTBpro. We completely changed the visual design, moved to a single page architecture and started exploring new ways to minimise load on our servers - both when serving our actual website, and mobile API responses.We'll focus on how scaling considerations are now an integral part of our architecture, which enabled us to serve 20x more traffic than we did 1 year ago, with the same setup and with no additional costs.
5. Single Page Application
Phantom.js renders pages on the server-side for SEO,
crawlers and mobile web performance
Load Balancer
Memcached
Redis
Web 1 Web 2 Web 3
MySQL MongoDB ElasticSearch
Amazon Web Services
NginX
+
Ruby on
Rails
PhantomJS
Web 4
9. A cache server can handle
over x10 more traffic
10:1:1
Cache
Server
Render
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
10. Cache server still consumes CPU and
with more traffic, more servers are needed
20:2:1
Cache
Server
Render
Cache
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
Client
15. What’s a CDN?
• Content Delivery Network
• A set of autonomic distributed cache servers
• Serve cache from a location geographically
close to the client
• e.g: Akamai, Cloudflare, Fastly, Highwinds,
Edgecast, Cloudfront
28. Caveats
• Purging everything can lead to downtime, e.g.
when deploying
• User Specific content can’t be cached with the
entire page
• Downtime on massive Push Notifications
34. Summary
• CDN allows massive scale
• Smart CDN usage allows even more scale
• Scale + fresh content + low hosting prices is a
do-able mission
!
Questions?
35. Read More…
• Growing X20 without spending an extra penny on
hosting (The original blog post)
http://tech.ftbpro.com/post/78969626647/growing-x20-without-spending-an-extra-penny-on-hosting
• Single Page Applications Done Right
http://tech.ftbpro.com/post/84720180206/single-page-applications-done-right
• Count von Count - Real time counting DB
http://tech.ftbpro.com/post/73212710968/count-von-count-a-real-time-counting-database
• The Dark Side of Single Page Applications
http://tech.ftbpro.com/post/66182501420/the-dark-side-of-single-page-applications-rails
OSS: http://github.com/ftbpro
BLOG: http://tech.ftbpro.com