
The hardest parts of a notification system are scalability and reliability: delivering every notification on time and only once, through traffic spikes and provider outages. You get there by measuring delivery with SLIs and SLOs, retrying transient failures with exponential backoff, failing over to a backup provider or channel, and keying every send so a retry never duplicates it.
Notifications are how your product reaches its users, over push, SMS, email, and direct messages, and plenty of tools help you build the pieces.
Sooner or later, a growing company has to choose between building and maintaining its own system, or buying a third-party product with proven reliability. This is the classic build-vs-buy decision. The cost of buying is easy to see. The cost of building is harder to calculate, and most of it hides in scalability and reliability. For the requirements side of the project, see our guide to building a user notification system.
Scalability and reliability are distinct but related. Your system is reliable when your customers receive every notification on time, without errors or duplicates. It’s scalable when it keeps doing that as your volume grows with your product.
Reliability costs time and money. If you’re still looking for product-market fit, your resources are probably better spent elsewhere.
Once you find product-market fit and your user base grows, your notification volume grows fast. It’s tempting to keep putting other parts of your application first. But if customers stop receiving notifications because of errors, timeouts, or delays, the user experience suffers, and your growth and revenue suffer with it.
Scalability and reliability are both key inputs to a build-vs-buy decision. Take the feature management platform LaunchDarkly. It sits in the critical infrastructure path for many of its customers, so its notification tooling had to be secure and compliant (GDPR and SOC 2). Its previous tool needed replacing as its functionality and security needs grew, and it chose Courier because it fit LaunchDarkly’s existing tech stack.
If your system lacks either one, you’ll hit problems as your customer base grows.
Unreliable notifications cost you trust. For a product like Slack, a delayed push notification is close to useless, because timeliness is what makes a real-time conversation work.
Even if you’re not Slack, losing early users’ trust slows growth. Early adopters won’t recommend a product they don’t trust. Duplicates do the same damage: when the same notification keeps arriving twice, users decide the product isn’t stable and hesitate to share it with friends or colleagues.
In Courier’s experience, the most common source of scalability and reliability problems is that notifications are rarely spread out evenly over time. If you send 30,000 notifications a month, that doesn’t mean 1,000 a day, or a steady trickle every minute. You get huge spikes, then long valleys. You have to scale your infrastructure for those peaks at a reasonable cost. If it can’t keep up, notifications get processed and delivered after they’ve stopped being relevant. In the worst case, an overwhelmed queue takes the whole system down.
Your notification system also has to stay available while you deploy new code. If you didn’t design for that, every change risks downtime, and downtime means your users don’t get notifications and don’t engage with your product.
A system built without scalability and reliability in mind also wears out your team. On-call engineers burn out if they’re constantly responding to notification alerts, and every hour spent firefighting is an hour not spent on features, user experience, or integrations.
Site reliability engineering (SRE) gives you three tools for measuring reliability: SLIs (service-level indicators), SLOs (service-level objectives), and SLAs (service-level agreements). Google’s SRE book covers service level objectives in depth.
All three start from how your customers perceive your product. What API latency do your users associate with an application that’s running smoothly? How long will they wait for the UI to load before deciding it’s broken? How soon should asynchronous jobs finish so they can get on with their day? SLIs, SLOs, and SLAs put numbers on answers like these.
An SLI is a measurement of your service, such as the latency of a database operation or the size of a notification queue. These are the metrics you’d view in a tool like AWS CloudWatch or Datadog.
An SLO is the target you set for an SLI, such as a latency goal for a notification endpoint that includes the latency of the middleware, queues, and databases behind it. Pick the metrics that actually matter to your customers, and set your objectives around them.
An SLA is a contract with your users, built on your SLOs. For example, an endpoint is available and responds within 1 second 99.9% of the time. If you miss the target, a customer might be entitled to a refund, so an SLA turns a missed objective into a direct financial loss.
Watch SLIs and SLOs that reflect what your customers care about, and you’ll often spot problems before your customers do. Things will go wrong. How you respond is what makes the difference.
For a notification system, an SLI could be the size of the notification queue, and an SLO could be the latency from a notification’s creation until it’s sent to the user. Two more SLIs are worth tracking. The first is time to first attempt: how long it takes from your send request to the first delivery attempt, which you want as small as possible. The second is deliverability rate, measured for each provider and each channel, so you can tell which provider is dragging you down. On push, a provider accepting your request doesn’t mean the notification reached the device (Apple’s push service accepting a notification doesn’t mean it showed up on a screen), so delivery confirmation is its own metric.
Most companies don’t cover notifications under an SLA, but some have to. A B2B CRM that reminds users of upcoming client calls will probably include notification standards in its SLA. If yours does, make sure your metrics and objectives line up with what you’ve agreed to, so you don’t overpromise.
You might be reluctant to depend on provider APIs like SendGrid, Twilio, or Firebase Cloud Messaging, and consider running your own email or SMS infrastructure instead.
Courier, for example, is an HTTP API, and HTTP requests do fail: connectivity issues, SSL errors, unexpected delays, or no response at all. Keeping every dependency inside your own network makes failures less common, but today’s networks are too complex to eliminate them.
In our experience, the answer is to keep the APIs and build mechanisms that absorb request failures: retries with exponential backoff, failover to a backup provider, and idempotency, so a retry never sends the same notification twice.
If you build this yourself, start with the difference between failures worth retrying and failures that aren’t. A provider outage, a rate limit, or a dropped connection is transient, so a retry can succeed. A revoked API key won’t fix itself on attempt 50, and retrying it only requeues volume for nothing. Put exponential backoff on the first kind, so one provider outage doesn’t turn into a retry storm that eats your own capacity.
Then decide how long each kind of notification is worth retrying. A password reset that arrives 72 hours late is worse than none. And decide what failover means: provider failover moves a notification to a backup provider on the same channel (a second email provider when the first is down), while channel failover moves it to a different channel (email when push fails). Finally, key every notification so retrying a half-processed batch doesn’t resend to the users you already reached. If you loop over 1,000 recipients and fail at 800, a retry that starts from the top sends 800 duplicates.
Here’s how Courier handles them.
Retries. Courier retries transient provider errors, such as a rate limit or a dropped connection, with exponential backoff for about 24 hours (roughly 104 attempts). On a rate limit error (HTTP 429), the first retry comes after 5 seconds and the delay grows to 15-minute intervals. A provider’s Retry-After header overrides that schedule. The overall window is the message timeout, which defaults to 72 hours and can’t go higher. Set message.timeout.message (in milliseconds) to end retries sooner for anything time-sensitive.
Failover. If a provider can’t take a message or returns an error, Courier moves to the next provider configured on that channel. A channel fails when every provider on it has failed or the recipient has no address for it, and with single routing Courier then moves to the next channel. If every option fails, the message fails. Every attempt shows in the message’s log. On Enterprise plans, Courier also moves past a slow provider after 5 minutes and a slow channel after 30 minutes, and you can change both per send. See how routing and failover work.
Provider rate limits. Providers cap how fast you can send, and a spike on your side can exceed that cap. The Send API isn’t rate limited by request count, and you set a send rate limit on each provider configuration to match your account’s cap. Courier queues sends above that rate instead of dropping them, and hands them to the provider at the rate you set.
Idempotency. Send an Idempotency-Key header with a unique value per logical request, such as a UUID, and reuse it when you retry. Courier caches the first response for that key, including its status code and any error, and replays it on retries, so the request runs only once. A key is scoped to the endpoint it was sent to. See idempotency in the API reference for the details.
Here’s a password reset send with a 15-minute retry window and an idempotency key:
curl -X POST https://api.courier.com/send \
-H "Authorization: Bearer $COURIER_API_KEY" \
-H "Idempotency-Key: 6f3b8c2a-9d4e-4b7a-a1c5-2e8f0d5b7a91" \
-H "Content-Type: application/json" \
-d '{
"message": {
"to": { "user_id": "user_123" },
"template": "nt_01kx4h2jdafq8bk9aftxak4b40",
"timeout": { "message": 900000 }
}
}'AWS has plenty of tools for building a scalable notification system. When we wrote this in 2021, DynamoDB and AWS Lambda were among the AWS services Courier used, and applications built on them can scale and be cost-effective to run. You still have to avoid performance bottlenecks. The tips below come from that experience.
A system is scalable when it still performs within its service level objectives as volume increases. Whatever tools you pick, plan for sudden, drastic increases in volume.
Design your access patterns from the outset: know how you’ll read and write data before you start building. A simple notification system isn’t hard to build, but access-pattern problems usually don’t show up until later in the implementation, or when you try to scale.
In DynamoDB, a common access-pattern problem is partition key structure. A DynamoDB primary key is either a partition key alone or a partition key plus a sort key. DynamoDB uses the partition key to distribute a table’s data across partitions, and the more evenly your records are distributed, the higher the table’s overall throughput.
To decide which partition a record goes to, DynamoDB runs a hash function on its partition key, and the output maps the item to a physical location. Each partition can serve at most 3,000 read units and 1,000 write units per second. If one partition gets more reads or writes than the others, your table’s throughput drops below what an even load would give you. Overloading one partition because too many records share a partition key is called the hot key problem.
Ineffective load distribution between partitions in DynamoDB.
DynamoDB manages the partitions itself, so the fix is in your partition key. Adaptive capacity can protect you from some throttling under an uneven access pattern, but a well-distributed key is still the foundation. A common fix is a composite partition key. In the example above, tenant_id is the partition key, which creates a bottleneck on Partition 1 for every record belonging to tenant_1. Combining tenant_id and user_id into one partition key (for example, tenant_1#user_42) spreads those records across partitions:
More effective load distribution between partitions through the use of composite partition keys.
The tradeoff: a query needs the full partition key, so you can no longer fetch all of a tenant’s records with one query. Choose the key from the reads you actually do.
If you store attachments for your notifications in AWS S3, the same thinking applies. S3 supports at least 3,500 write and 5,500 read requests per second per prefix, so spread high-volume traffic across prefixes (see AWS’s guidance on optimizing S3 performance).
Your capacity mode shapes both your DynamoDB bill and how you handle spikes. In AWS’s own cost optimization test on gradually changing traffic, auto scaling cost about 31% less than statically provisioned capacity, and blending it with one-year reserved capacity cut costs by about 55%. Auto scaling reacts only after usage stays above your target for two minutes, though. AWS recommends on-demand mode for bursty or unpredictable workloads whose traffic can spike in seconds or minutes, which describes a lot of notification traffic.
Finally, monitor and analyze your performance metrics. For scalability, they’re how you pinpoint problems in your access patterns. When we wrote this in 2021, Courier used Datadog for this, which can monitor servers, databases, and other tools.
Your needs depend on your usage, but a scalable system starts from a foundation that handles higher volume without huge expense or a rebuild. Learn how your tools work so they work for your application, not against it. DynamoDB, for example, isn’t a relational database, so don’t use it like one. Getting the design right early saves you a rebuild later.
When we wrote this in 2021, we ran most of our notification-related code on AWS Lambda. If you use Lambda for your notification system, tune its configuration to your workload.
Start with timeouts. Don’t rely on defaults: they differ between AWS services, SDK languages, and SDK versions, so check the settings for the SDK version you use.
Mismatched timeouts cause unexpected timeouts. If your Lambda function times out before the SDK finishes its retries, the call fails, and CloudWatch gets no log of the API call to debug it with. AWS’s rule of thumb: your Lambda timeout should cover the first attempt plus every retry, each taking the SDK’s connection timeout plus its socket timeout, with 20 seconds of margin on top. With 3 retries, a 10-second connection timeout, and a 30-second socket timeout, that’s 180 seconds.
Our strategy was to right-size timeouts between Lambda functions, the AWS SDK, and every other place a timeout can occur. Each layer has to give the one below it time to finish: the SDK timeout fits inside the Lambda timeout, which fits inside whatever calls the function (API Gateway’s REST integration timeout defaults to 29 seconds). The right values depend on your needs and your stack.
The same goes for queues and polling. If an SQS queue triggers your Lambda function, AWS recommends a queue visibility timeout of at least six times the function timeout, so Lambda has time to retry a throttled batch. Line these settings up with each other, and you get a large reliability payoff.
Building a notification system into your product isn’t for everyone. It’s time-consuming, complex, and expensive, and your requirements decide whether functionality or cost matters more. If you haven’t found product-market fit, focus on finding early customers and getting their feedback. If you have a proven customer base, you’ll care about higher volumes, stability, and compliance, which means more functionality and higher maintenance costs.
Once delivery is reliable, the next questions are which channel to use and how your users control it. See routing and preferences.

Is Courier HIPAA compliant? BAAs, SOC 2, and controls
Yes, Courier maintains a HIPAA compliance program and signs BAAs with Enterprise customers. Here's what Courier runs, from SOC 2 Type II to continuous security monitoring, what the BAA covers, the controls you get, and the parts of HIPAA compliance that stay with you.

How to protect your email domain and sending reputation
AI agents have made spoofing cheap, and a DMARC record at p=none won't stop it. Here's how to enforce DMARC without bouncing your own mail, keep password resets apart from newsletters, protect your sending reputation, read Google Postmaster Tools, and audit your domain with six AI prompts.

Courier's Response to the eMudhra and PHP Security Issues
Courier's assessment of the eMudhra certificate authority compromise and the October 21 PHP security release: what happened, the steps we're taking, and what you may want to check in your own environment.