AWS Cloud Operations & Migrations Blog

How EverQuote Underwent a Serverless Transformation using AWS

This post is co-written with Conor Teer, Senior Software Engineer, at EverQuote, David Kelly, Principal Software Engineer at EverQuote, and Mark O’Connell, SVP of Engineering at EverQuote.

EverQuote is a leading online insurance marketplace that helps protect life’s most important assets- family, property, and future by simplifying the experience of shopping for insurance, making it easier, faster, and more affordable. EverQuote uses AWS to facilitate their data and machine learning capabilities to match consumers with the best insurance plan for them.

Homescreen of the EverQuote Site
Figure 1. Homescreen of the EverQuote Site

Challenge:

Last year, EverQuote faced a daunting task: deciding what was next for their primary consumer facing website, a six-year old NextJS application that had contributions from over 35 engineers. The application had grown in complexity, and was at risk of stifling EverQuote’s ability to innovate quickly if updating couldn’t keep pace. This presented EverQuote with multiple challenges in order to continue to modernize their applications and innovate for customers.

The primary challenge EverQuote engineers posed for themselves was to further optimize the adding of new features. Their reach goal was that adding features should take only days instead of weeks, in order to be able to rapidly improve the customer experience. EverQuote also always seeks to optimize infrastructure costs, thus any technical solutions have to account for financial considerations.

Beyond the technical challenges that were faced by EverQuote, the team also rallied with enthusiasm around the idea of using their talents to reshape EverQuote’s digital landscape. EverQuote recognized that making such a transformative leap would be instrumental in facilitating the next round of innovative features that could improve EverQuote’s customer experiences.

During this transformation, EverQuote wanted to make sure there were no disruptions to their existing business operations or impacts on their customers. As the EverQuote team prepared to overhaul their platform, they wanted to be open-minded to new architectural patterns and were ready to face the challenges head-on. They wanted to minimize time to market for new features, continue to optimize the performance of their existing website, and keep an eye on the costs of any changes to their infrastructure and maintenance.

Solution:

Architecturally, EverQuote was at a crossroads. Because the majority of their services were deployed using Amazon Elastic Kubernetes Service (EKS), changing architectures would require additional expertise in the engineering organization.

EverQuote needed to make a decision about what would be the best architecture to use going forward. In the short term, there would be time and effort spent to train their team which would have short term costs, but changing architectures would likely improve their agility and deliver long term benefits for customers.

EverQuote runs an extremely effective but compact engineering team. Each minute the EverQuote team spends on managing clusters, containers, adjusting auto-scalers, or handling Kubernetes upgrades, has to be thoughtfully balanced with other outward-facing tasks.

Second, another key objective for the team was cost efficiency. At a surface level, maintaining 100% uptime for a container handling 500 requests per minute seemed justifiable. However, as the EverQuote team dug deeper, it revealed that since each request takes 50ms, their server(s) were only actively processing for approximately 415ms per second. This meant the existing application was effectively idle 60% of the time and still incurring cost for compute.

EverQuote’s application also has unpredictable traffic patterns which creates additional complexity. It constantly needed to remain ready to adjust to fluctuations in traffic triggered by factors such as holidays, external circumstances, or changes in their search engine marketing team’s advertising strategies. This demanded that any change had to be able to scale in line with EverQuote’s needs of being cost effective and requiring minimal maintenance.

After working closely with AWS to evaluate their options, EverQuote determined that adopting a serverless first approach could be the key to success. This decision however, presented another fork in the road. EverQuote’s traditional route involved deploying a simple UI to AWS via Amazon CloudFront and Amazon S3, but given EverQuote’s strict performance KPIs, they knew they had to up the ante for this change as well. EverQuote needed an application that leveraged server-side rendering in order to hit the critical business metrics.

These technical requirements narrowed down EverQuote’s options to two primary candidates: deploying a container using AWS Fargate or pioneering a way to deploy their servers to AWS Lambda. On the surface, AWS Fargate seemed like a logical choice. It offered the serverless advantages of being a managed service, thus absolving EverQuote from managing clusters themselves as they had been previously. The deployment process bore a striking resemblance to EverQuote’s familiar operations within Kubernetes. The AWS Lambda server-side rendering architectural pattern was unfamiliar territory and cutting edge. EverQuote had experience with a node package called sls-next, which they used in previous projects, but it was rendered obsolete with the release of NextJS 13 and was no longer recommended by Vercel, the company behind NextJS. Given these circumstances, EverQuote targeted AWS Fargate as their “safe” option, intending to map out a future route to AWS Lambda when feasible.

EverQuote was able to re-architect their application within a month, and was approaching the release of their first landing page on the new architecture. However, that same week, EverQuote evaluated the Serverless Stack (SST), a framework tailor-made for constructing serverless full-stack applications on AWS. This tool leverages OpenNext, enabling EverQuote to deploy their NextJS application to Amazon CloudFront and AWS Lambda smoothly.

The option of the Serverless Stack (SST) brought EverQuote to a key decision point: did the engineering team have the bandwidth to transition, conduct performance testing, fine-tune their Lambda functions, and test it before going live? EverQuote knew this architectural pattern was best for them in the long-term, but knew that it would require great determination from the team, given how close they were to a production launch.

EverQuote decided that, with the availability of the Serverless Stack (SST) option, the team was up for the challenge of making the leap straight to the AWS Lambda path. EverQuote invested three days in transitioning the deployment to the Serverless Stack (SST). EverQuote conducted performance comparisons against their recently updated AWS Fargate architecture, and leveraged AWS Lambda Power Tuner to balance performance and cost in line with their business needs. With these adjustments and enhancements in place, EverQuote was able to roll out their updated application for production users in only 24 hours.

Architecture:

Technical architecture diagram of EverQuote's application
Figure 2. Technical architecture diagram of EverQuote’s application

AWS Lambda:

AWS Lambda plays a pivotal role in EverQuote’s serverless UI infrastructure. AWS Lambda is a serverless computing service that allows users to run code in response to events without provisioning or managing servers. With the help of the Serverless Stack (SST) framework, EverQuote deployed two specific Lambda functions to manage incoming requests. The first, dubbed as the “server Lambda”, operates on the edge. The server Lambda manages server-side rendering, API calls, and general data requests in the NextJS application. The second Lambda, which EverQuote refers to as an “image function” takes care of any image optimizations required during the application’s runtime, ensuring that image delivery is efficient without compromising on quality.

AWS Lambda Power Tuning:

Graph of the Lambda Power Tuning Results
Figure 3. Graph of the Lambda Power Tuning Results

EverQuote considers AWS Lambda Power Tuning a crucial asset in the toolkit of any engineer utilizing AWS Lambda, AWS Lambda Power Tuning enables concurrent executions of multiple versions of your Lambda function, each with a different memory configuration. The results of this tool are presented as an easy-to-understand chart displaying the cost and performance metrics of each execution. This powerful tool has been instrumental in assisting EverQuote in determining the ideal balance between performance and cost. By analyzing the output of AWS Lambda Power Tuning, EverQuote was able to identify the optimal memory allocation that delivers satisfactory performance without incurring unnecessary costs.

Amazon EventBridge:

For any asynchronous processes, EverQuote uses Amazon EventBridge. They fire events at significant milestones throughout the workflow, regardless of whether it necessitates action. This not only allows EverQuote to capture and act upon crucial moments but also provides a detailed log of events for further data analysis.

Amazon S3:

EverQuote leverages Amazon Simple Storage Service, Amazon S3, for depositing their static assets. From static HTML and CSS style sheets to scripts and un-optimized images, everything that constitutes a static aspect of EverQuote’s website is securely and reliably stored in Amazon S3. This not only ensures the durability and accessibility of these resources but also contributes to the overall performance and efficiency of the EverQuote site.

Amazon ElastiCache for Redis:

Amazon ElastiCache for Redis, is an integral component of EverQuote’s tech stack, serving as a real-time session store for their UI application. With performance and page speed being critical factors for EverQuote, a fast and dependable short-term session store like ElastiCache is indispensable.

Traditional local storage within a browser, while convenient, is limited and can lead to clutter and codebase bloat. Conversely, fully persistent storage solutions, such as Amazon Relational Database Service or Amazon DynamoDB, can provide more horsepower than necessary. Amazon ElastiCache for Redis strikes the perfect balance for EverQuote, offering an efficient, scalable, and fast session store that is just right for their needs.

Amazon CloudFront:

Amazon CloudFront is a high-performance, secure, and developer-friendly content delivery network (CDN), and is an essential part of EverQuote’s architecture due to the emphasis it puts on performance. Having CloudFront distribute EverQuote’s application’s content has saved precious seconds by delivering it to end consumers directly from the edge. Amazon CloudFront’s edge caching minimizes latency, serving EverQuote’s site quickly once a request is made. Beyond just rapid content delivery, Amazon CloudFront offers features like CloudFront Functions for lightweight, sub-millisecond header manipulation; providing useful data, such as location and end-user device information.

Results:

Performance:

EverQuote’s previous architecture delivered acceptable performance but the team was looking for upgrades. On mobile, EverQuote’s Google’s Core Web Vitals tests, the Largest Contentful Paint (LCP) was 3.6 seconds, and the Google Lighthouse performance score was a 31 out of 100. Desktop performance was better, scoring 91 in the Desktop Lighthouse Test.

EverQuote’s initial performance benchmark for the new architecture was measured through Lighthouse scores. EverQuote saw a remarkable improvement, with mobile scores leaping from 31 to 83, and the desktop score reaching a flawless 100. The LCP for both platforms was now under 2 seconds compared to a previous 3.6 seconds, nearly a 60% improvement.

The results for the Core Web Vitals took some time to materialize as they’re based on user metrics gathered over an extended period. However, after a few months of A/A testing traffic, EverQuote is proud to announce that they now are passing the Core Web Vitals tests on both desktop and mobile.

While these results are promising, the EverQuote team is not content to rest on their laurels when it comes to performance. EverQuote is studying where they can enhance their caching rules, make updates to Google Tag Manager, and implement further architectural improvements to push their performance even further.

Business Impact:

The performance enhancements EverQuote achieved are impressive, and as an engineering team, they are thrilled with the results. The fundamental question that remains is how did this architectural transformation impact the business? To gauge the business impact of EverQuote’s new, higher-performing site, they first rebuilt one page (the main landing page) to mirror the existing page. EverQuote then load-balanced traffic between the old and new infrastructure, conducting an A/A test with identical content. The only variable was the underlying architecture and the performance boost it provided.

The business outcome exceeded EverQuote’s expectations. EverQuote saw a significant 7% increase in conversion on the landing page alone, and an impressive increase of up to 11% in some traffic streams.

EverQuote anticipates similar improvements throughout their site and other conversion stages within their workflow(s) as they roll out this new architecture to fully capitalize on these promising business gains.

Cost Savings:

The transition to this new serverless architecture enabled the EverQuote team to exceed their goal of cost efficiency for their new platform by approximately four hundred percent. Reducing infrastructure costs while also improving performance and scalability metrics is the ultimate win. The use of AWS Lambda, Amazon CloudFront, Amazon S3 and Amazon CloudWatch services also reduce the ongoing maintenance requirements when compared to EverQuote’s previous Amazon EKS based infrastructure.

Developer Experience:

After the transition, EverQuote developers are spending more time on new business innovations to help improve customer experiences and less time managing and provisioning their compute and infrastructure capabilities. EverQuote developers have provided numerous additional ideas for enhancements to the existing application which will drive customer benefits.

Conclusion:

EverQuote’s case is a clear illustration of the transformative power of a serverless architecture. By leveraging AWS’s robust serverless services, EverQuote was able to streamline operations, achieve cost targets, boost performance, and ultimately increase their conversion rate, resulting in significant business impact. This improvement shows the cost-effectiveness and ease of scalability when using AWS serverless solutions.

EverQuote’s journey also emphasizes the importance of continual evolution and refinement. EverQuote is continually exploring ways to further improve performance, increase their conversion rate, and deliver the best possible experience for their customers. With the continued partnership between EverQuote and AWS, EverQuote is confident in their ability to navigate the ever-changing digital landscape and look forward to the challenges and triumphs that lie ahead.

If you are interested in exploring modernization pathways, check out these resources:

About the Authors

David Kelly author image

David Kelly

David Kelly is a Principal Software Engineer at Everquote based out of the Belfast NI office, with 10 years experience of building software with a serverless first approach. Outside of work you can find him playing football with his local team and sim racing online.

Conor Teer author photo

Conor Teer

Conor Teer is a Senior Software Engineer & Tech Lead living just outside Belfast. Conor has been working on a range of Serverless technologies for 8 years from data analytics to front end. Outside work he enjoys traveling Europe & the US, football, and a good beer.

Mark O'Connell author photo

Mark O’Connell

Mark O’Connell SVP Engineering at EverQuote based in Northern Ireland. Mark is a passionate Cloud and “Serverless First” advocate with almost 20 years of experience in software engineering. In his spare time he is an avid football (soccer) fan and enjoys weekend rides on his motorcycle.

Ryan Doty author image

Ryan Doty

Ryan Doty is a Sr. Solutions Architect at AWS, based out of New York. He helps enterprise customers in the Northeast U.S. accelerate their adoption of the AWS Cloud by providing architectural guidelines to design innovative and scalable solutions. Coming from a software development and sales engineering background, the possibilities that the cloud can bring to the world excite him.

Tarik Makota author image

Tarik Makota

Tarik Makota is a Principal Solutions Architect with Amazon Web Services. He provides technical guidance, design advice, and thought leadership to AWS’ customers across the US Northeast. He holds an M.S. in Software Development and Management from Rochester Institute of Technology.