VueMail: Realtime Dynamic Image Compositing Service

VueMail is a image service built on top of Platform. This service can dynamically composite images on the fly when an email newsletter is opened. This is used by Ecommerce stores when sending large email newsletter campaigns.

One of the client had to send email newsletters to 8+ million subscribers with recommendations based on their browsing history and personal preferences. In the traditional approach, they would have to make 8 Million API calls to our recommendation API and embed the images for those products and send them. The problems with that is:

  • Expensive to do 8 Million APIs everyday, when the number of subscribers who will open it will be less than a Million.
  • Stock information will become stale for subscribers who open later
  • Email is not personalized based on the subscriber’s recent activity on the site.

The solution is to build a service which can generate the images on the fly whenever an email is opened. This VueMail service will be hit by millions of requests for images and it has to make sure to synchronize the calls to the backend services and return back the images of the product, dynamically composited with the latest price and stock information.

This service is now running in production with almost no maintenance and is capable of handling tens of thousands of image requests per second.

Tech: Python, Django, Pillow, Redis, Docker, AWS ECS.