B4A achieves beautiful performance for its beauty platform with AlloyDB for PostgreSQL
CEO and Founder
Head of Product & Development
Try Google Cloud
Start building on Google Cloud with $300 in free credits and 20+ always free products.Free trial
Editor’s note: B4A, a Brazilian company that runs a beauty e-commerce platform, recently migrated their database to AlloyDB and saw performance accelerate by 90 percent across their queries. Now the company is looking for further gains in management and ease of use by migrating to other fully managed database solutions from Google.
B4A is a Brazilian beauty-tech startup founded in 2017 with the purpose of democratizing the beauty market. Today, we offer monthly beauty subscription services to more than 120,000 paying subscribers, as well as, a completely customized online shopping experience for our loyalty club members that’s tailored to each customer’s unique profile. Our core technology platform, called B4A Connect is where we house our full catalog of products—roughly 10,000 different SKUs—and foster connections between our users, which include beauty brand representatives, consumers, and digital influencers. As adoption of B4A Connect grew, we struggled with load times for queries that returned several hundred SKUs at a time. At the time, we were using Microsoft SQL Server, and this made us start looking at alternative databases to run our platform and speed up performance. In 2022, we migrated the backend of B4A Connect to AlloyDB for PostgreSQL and saw catalog query performance accelerate by 90 percent.
Making a mark on the beauty industry
Just like most other industries, the beauty industry is undergoing its own digital transformation. We recognized this trajectory and founded B4A as a beauty tech company, born with digital DNA and meant to capitalize on digital channels to create lasting connections between brands and consumers. We offer female and male monthly subscription plans where B4A sends beauty products on a regular basis. Beyond subscriptions, our customers can also shop on our e-commerce platform whenever they wish.
We knew the beauty e-commerce market was already very competitive, so we designed our shopping experience with integrated gamification strategies, opportunities for user-generated content creation, machine learning algorithms to offer product matches, and social selling strategies via influencers. As B4A’s popularity continues to grow, we’re constantly iterating on our platform to ensure we deliver the best possible customer experience. We’re also maturing as a startup, so finding ways to reduce costs is always on our minds.
Migrating to AlloyDB for faster queries and lower costs
We were looking for an extremely performant database with a high service level to power B4A Connect. Not only does our B4A platform contain our full product catalog with more than 10,000 beauty products, descriptions, and reviews, it also customizes results for each user. With our previous database, we had some collections of products that would take up to 12 seconds to load. We knew we needed a database that could scale efficiently and would be easy to maintain. In addition, because our frontend applications are built on Angular, having a database solution from Google would be an easier integration.
We opted for AlloyDB for performance reasons. And indeed, the results were amazing. We combined AlloyDB with a GraphQL API and had query times for our full catalog of products decrease by up to 90 percent compared to our previous database solution. In absolute numbers we went from 12 seconds to 1.2 seconds. And in production our load time is in the 0.25~0.4 second range. Because AlloyDB disaggregates compute and storage at every layer of the stack, it was able to scale seamlessly and offer predictable performance while running simultaneous queries.
But beyond performance, we also came to appreciate the ease of maintenance that a fully managed solution like AlloyDB provides. Setting up and configuring the database was a very smooth process that went really quickly for us. We also were thankful we didn’t have to worry about infrastructure, which enabled us to focus on our service right away.
Compared to our previous database, we’ve been able to cut costs, too. We’re no longer stuck paying for traditional database licenses. With AlloyDB, pricing is transparent and predictable, and we’re only charged for what we use.
Going all in on Google databases for easier management
Today, having everything as a fully managed solution on Google Cloud allows us to devote more time to product development and user experience, rather than managing infrastructure. In addition to using AlloyDB, we also run Firestore for various other use cases. One example is our monetization platform for micro-influencers, which runs on Firestore. This solution gives our micro-influencers the ability to sell our beauty products and subscriptions, including participating in advertising campaigns for beauty brands. As a fully managed, scalable, and serverless database, Firestore enables us to work with real-time change requests, which has been very beneficial for us. We love that we can go serverless and combine Firestore triggers with Cloud Functions.
In a startup like ours resources are limited, so the ease of use and integration plus the lack of infrastructure requirements, allow for a much better overall result. Now, B4A developers can handle almost everything without support from the operations team.
Eventually, we plan to migrate all our databases to fully managed Google Cloud solutions, whether that’s AlloyDB, Cloud SQL for PostgreSQL, or Firestore. We want to break our monolithic application into small microservices using Cloud SQL and the corresponding Google databases that makes more sense for each service. All performance-critical queries with a direct user context will migrate to AlloyDB. We also plan to combine AlloyDB with our machine learning services to further improve the levels of customized search results for our users.
Learn more about the B4A and try out AlloyDB for PostgreSQL today.