SparkPost Delivers and Analyzes Billions of Emails Daily on AWS


As the biggest global sender of commercial email, SparkPost handles billions of emails every day and has the world’s largest data footprint to help enterprise brands make data-driven decisions to optimize their email programs. Operating at this level drove SparkPost to adopt an architecture that would enable its data analytics infrastructure to scale more elastically, increase resiliency, and lower costs.

Using a combination of tools from Amazon Web Services (AWS), including instances, containers, and managed services, SparkPost migrated its email delivery and data-analysis workloads to a cloud-native architecture. By doing so, it created an innovative email delivery and analytics solution that has become its fastest-growing product and a significant majority of its revenue. The company has seen a 30 percent drop in cost per thousand emails sent—or cost per mille (CPM)—and delivers high elasticity, resiliency, and security. “Our solutions on AWS have enabled us to grow our business and our email volume,” says Chris McFadden, vice president of engineering at SparkPost.

Amazing vibrant Times Square crowded with tourists and people sightseeing. New York City, Manhattan, USA.

As we grow in customers and volume, we’re not adding a lot of additional engineering, largely because we heavily use and continue to automate what we’re doing on AWS.”

Chris McFadden
Vice President of Engineering, SparkPost

Reducing Costs for SparkPost’s Email Pipeline and MTA

Founded in the late 1990s, SparkPost is a leading email delivery provider. From the beginning, it was known for its high-performing message transfer agents (MTAs). SparkPost’s on-premises MTAs required companies to host their own mail servers, but SparkPost wanted to offer a cloud-based MTA to provide more convenience. In 2015 it achieved that goal by building a proprietary MTA on AWS, in which low latency was a top priority. “Customers are very concerned about low latency on injecting email into our system, so we had to have low latency in both injecting and delivering emails,” says McFadden.

SparkPost’s cloud-based MTA on AWS sends over 33 billion emails per month with burst capabilities of over 2 million emails per minute. One pillar of SparkPost’s cloud MTA is Amazon Elastic Compute Cloud (Amazon EC2), a web service that provides secure, resizable compute capacity in the cloud. Because of powerful, efficient Amazon EC2 C5 Instances, SparkPost knows that it has the performance to satisfy its clients as it sends out millions of emails per minute. SparkPost keeps costs low using Amazon EC2 Spot Instances, which enable users to take advantage of unused Amazon EC2 capacity on AWS at up to a 90 percent discount compared to On-Demand pricing.

To automatically scale its email pipeline before emails go into its MTA, SparkPost uses AWS Lambda, a serverless compute service that automatically and precisely allocates power and runs code based on the incoming request or event for any scale of traffic. By combining AWS Lambda for its serverless data pipeline and Amazon Elastic Container Service (Amazon ECS)—a fully managed autoscaling container orchestration service that provides a high-scalability email injectional pipeline—SparkPost can dynamically allocate its compute power as needs fluctuate. “We have some customers with very high burst rates,” says McFadden. “Having elasticity is important to us, both for resiliency and cost containment, and we like having the choice of running workloads on either Lambda or ECS.” SparkPost’s email delivery pipeline also uses Amazon Simple Queue Service (Amazon SQS), a fully managed message queuing service that can send, store, and receive messages at any volume.

SparkPost’s MTA solution powerfully enables its target low latency, with a median time for initial message delivery attempts under 1.5 seconds. In addition to facilitating a low latency that enables up to two million emails to be sent per minute, SparkPost’s email delivery solution has decreased costs by enabling automatic scaling up and down depending on volume. “Establishing different architecture, improving efficiencies, and scaling automatically have enabled about a 30 percent drop in our CPM,” says McFadden. “And this past quarter, email volume was up by about 40 percent year over year.”

Creating a Cloud Data Pipeline to Lower the Cost of Real-Time Email Analytics

SparkPost turned its attention to migrating its primary data pipeline for email sending and engagement analytics to the cloud. The pipeline ingests an average of 3 events per email sent, and over 100,000 events per second. Its new data pipeline needed to scale elastically, quickly, and efficiently to provide real-time analytics in a cost-efficient way. SparkPost completed the project in July 2020 and now processes over 100 billion events a month.

SparkPost built the data solution with serverless architecture to reduce latency and minimize costs and operational overhead for a large amount of batch processing. The serverless data pipeline relies on AWS Lambda and Amazon Data Firehose, a managed, scalable, cloud-based service that enables real-time processing of large amounts of data. This service enables SparkPost to process email and engagement data at the rate of hundreds of thousands of events per second. Amazon Simple Storage Service (Amazon S3)—an object storage service that offers industry-leading scalability, data availability, security, and performance—functions as the solution’s data lake and can store several petabytes of data.

SparkPost gets automatic-scaling functionality through Amazon DynamoDB, a fast and flexible NoSQL database service for any scale. Amazon Aurora, a MySQL- and PostgreSQL-compatible relational database built for the cloud, provides the performance and availability of commercial-grade databases at 10 percent of the cost. SparkPost also relies heavily on AWS Glue, a simple, scalable, and serverless data integration service that functions as part of SparkPost’s data lake.

The new data solution reduced the costs of the company’s email analytics pipeline by 50 percent. It also supported customer growth: for example, sales increased for SparkPost Signals for On-Premises, a service that enables SparkPost software customers to get the SparkPost cloud analytics solution, powered by AWS.

Achieving Growth with Scalability to Match

By using AWS services to put its email sending and data pipeline in the cloud, SparkPost achieved customer growth, as well as the scalability needed to seamlessly keep up with that growth. “As we grow in customers and volume, we’re not adding a lot of additional engineering, largely because we heavily use and continue to automate what we’re doing on AWS,” says McFadden.

SparkPost intends to use more AWS services to optimize resiliency, scalability, and cost. It’s planning blue/green deployments of certain parts of its architecture, improvements to automatic scaling, multiregion failovers, and more connectivity between its data centers and AWS.

Since 2015, SparkPost has considered AWS to be its preferred solution for achieving its goals. “When we first chose AWS, it was certainly mature, with the reliability and reputation we needed to achieve our time to market goals,” says McFadden. “A lot has changed within the cloud services market in the last 5 years, but we believe that AWS continues to be a major innovator in this space. Its continued announcements and new options drive a lot of excitement at SparkPost.”

SparkPost Reference Architecture

About SparkPost

SparkPost is a top email delivery provider that helps the world’s largest enterprise-level senders reliably reach the inbox, with powerful solutions to help them plan, execute, and optimize their email programs. It delivers 40 percent of all commercial email.

Benefits of AWS

  • Achieved a 30% drop in CPM
  • Decreased costs of sending analytics by 50%
  • Increased email volume by 40% year over year
  • Lowered latency
  • Increased scalability
  • Improved elasticity and resiliency

AWS Services Used

Amazon EC2

Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.

Learn more »

Amazon ECS

Amazon Elastic Container Service (Amazon ECS) is a fully managed container orchestration service.

Learn more »

Amazon SQS

Amazon Simple Queue Service (SQS) is a fully managed message queuing service that enables you to decouple and scale microservices, distributed systems, and serverless applications. 

Learn more »

AWS Lambda

AWS Lambda is a serverless compute service that lets you run code without provisioning or managing servers, creating workload-aware cluster scaling logic, maintaining event integrations, or managing runtimes. 

Learn more »

Get Started

Companies of all sizes across all industries are transforming their businesses every day using AWS. Contact our experts and start your own AWS Cloud journey today.