Tofu is an image processing system developed by COOKPAD that generates thumbnail images on demand from original images stored in S3. Previously, COOKPAD would generate all thumbnail sizes upfront, using significant storage. Tofu addresses this by using a Apache module called mod_tofu that generates thumbnails from original images only when requested. This on-demand approach is faster, more scalable, and saves storage by not pre-generating all sizes. Tofu leverages the scalability of AWS to process large volumes of image resizing with high performance.
6. BEFORE TOFU (a year ago)
User Generate thumbnails
uploads
an image
app (rails)
original thumbnails
storage
7. Problem
We should generate thumbnails of
all existing images as new size
when another size thumbnails are needed
(We have 7 million original images!)
8. AFTER TOFU (now)
User Store original image
uploads
an image
app (rails)
original original
storage
9. AFTER TOFU (now)
Store original image Generate thumbnails
On demand
tofu
original
storage