June 5, 2023
Supabase — the open source Firebase alternative — picks imgproxy
Supabase bills itself as an open source alternative to Firebase, offering users a rapidly scalable solution that simplifies the web and mobile development process, handling common backend tasks like database management, authentication, real-time data synchronization, storage, and much more. And, they also process around 2 million images per day (averaging between 2–7MB in size), and this is where our imgproxy story begins.
We needed a fast, stateless, secure, image transformation service that could serve a multitude of customers efficiently
Enter imgproxy
imgproxy is an open source image processing tool, primarily used to optimize and manipulate images on the fly. It prioritizes speed, security, flexibility, scalability, and ease of integration. It can be especially useful for sites that require real-time image optimization or resizing according to various requirements. Leveraging imgproxy can greatly improve the performance and user experience of a website or app by reducing image sizes and load times. (It also includes a number of Pro options, including “smart” ML features!)
According to Fabrizio, the Supabase team found imgproxy to be a solution that was loaded with features and, “configurable” as well as “performant and portable”.
When asked to identify the feature the team uses most often, he responds, “We mainly use imgproxy for image resizing and optimisation, such as with WebP.” He reports that Supabase runs imgproxy on AWS ECS with autoscaling and adds, “it was very easy to set up”.
He goes into a bit more detail on their infrastructure: “We decided to place imgproxy behind our storage-api in an internal VPC for the simple reason that we have more control on customizing query string URLs,” as well as over whitelist functionality, he adds.
When a transformation request hits our storage-api, we sign an S3 URL for a short period of time and we use that URL to feed into imgproxy–this way imgproxy is completely stateless for us. In front of the storage-api we have a CDN that we fine-tuned to maximize cache hits for the transformation endpoint.
Finally, when asked about the things that make the team happiest about imgproxy, he says that it’s “open source”, “scales nicely under load”, and is “feature rich”.
Read more about Supabase on their site, and then start and scale your next hit project, (backed by imgproxy!)