This document describes Japh Thomson's case study on using serverless architecture to augment WordPress and handle responsive images more efficiently. It outlines the problems of hosting large image libraries on WordPress sites with high traffic and many devices. The solution involved using the Tachyon image processing service on AWS Lambda to generate images on-the-fly and store them in S3/CloudFront. This saved on storage and processing costs compared to traditional WordPress hosting. The plugin and serverless approach made the sites faster and more scalable for users across devices.
5. PROBLEM!
Large blog networks
Two with 8M+ page views
per month each
Fashion / Foodie / Lifestyle
niche
Many blogs, many bloggers,
many photos
About 2TB of images and
growing
Processing, storage,
bandwidth
6. WORDPRESS
Responsive image sizes
handled natively (since 4.4)
Can handle creation of
multiple image 鍖les for sizes
Cant really solve the entire
problem at this level
8. TACHYON
Deals with image resizing on-
the-鍖y
Faster than light image
processing.
Inspired by / Forked from
WordPress.com's Photon
PHP-based
Switched from Graphics Magic
to Image Magick
Hosted on AWS
Backed by S3
Sits behind CloudFront
9. WORDPRESS PLUGIN
Plugin rewrites URLs
Images on S3 to Tachyon
URLs
WordPress handles the
speci鍖c responsive image size
required
10. TACHYON IN NODE.JS
Faster and better threading
Uses Sharp for image
processing
Can also be con鍖gured as a
proxy for the main process to
run in Lambda
11. WHAT IS LAMBDA?
AWS Service
Run code without having to
think about servers
Renting processing time on a
server, rather than the whole
server
Can run Node.js, Python, or
Java
12. TACHYON ON LAMBDA
Serverless! (Almost)
Still need the proxy, until
AWS API Gateway can return
binary data from Lambda
functions
Nginx proxy is very thin
and fast
Inherently scalable
21. PROOF IS IN THE PUDDING
Saving money on storage, as
image sizes are generated on-
the-鍖y, stored in the CDN
Faster for visitors as more
device sizes can be covered
Saving money on processing,
as Lambda is only called when
needed, no EC2 instances
sitting around
Fun to work on!