A redirect service looks like one hash lookup. The design work is deciding which component the next trigger has actually earned. Each level below names that trigger, what it adds, changes, removes or defers, what to build versus buy, and when to move up again.
- Prices: AWS list prices for
us-east-1as of 2026-11-23, gross of free tiers. Sources are at the end of the page. - Scenario figures: rule counts, traffic, miss rates and task sizes are modelled scenarios, not measurements. Anything not taken from a cited page is marked ASSUMPTION or as an estimate.
Evolution ladder · 6 levels · each row jumps to its stage
- L0baselineLaunchStatic redirect map+ Edge CDN, Static Redirect MapCost band 1 of 4
- L1extendBusinessDB of record + cached service+ Redirect Service, DB of Record, In-Memory Map · − Static Redirect MapCost band 1 of 4
- L2extendScalePush the map to the edge+ Edge KV StoreCost band 1 of 4
- L3replace ↻IncidentBloom-filter miss guard+ Bloom Filter Guard · − In-Memory MapCost band 2 of 4
- L4extendFeature requestAsync click attribution+ Click Stream, Object Store, Query EngineCost band 2 of 4
- L5replace ↻BusinessMulti-tenant rule engine+ Rule Engine, Tenant Isolation, Peer Regions · − Redirect ServiceCost band 3 of 4
How to read the numbers Limits and unit prices are from official AWS documentation and pricing pages (see Sources). Requirement chips and traffic volumes are modelling assumptions; cost bands are AWS list price at those volumes.
L0 · Static redirect map
baselineTrigger · Launch — One marketing site, ~200 vanity URLs
A single brand site needs a couple of hundred campaign links. Engineers own every change, and a reviewed PR per link is still tolerable.
- rules ~200
- redirects/mo 1M
- origin Regions 1
- miss % ~0
- CloudFront has no declarative redirect rules. Store each link as a zero-byte S3 object with x-amz-website-redirect-location (S3 answers 301) and put CloudFront in front, because S3 website endpoints don't serve HTTPS.
- S3 website routing rules stop at 50 per configuration; past that, AWS points you to per-object redirects. ~200 links = ~200 objects.
- Object redirects are always 301, which browsers may cache. If campaigns get repointed, use Amplify Hosting rules (301/302) or Cloudflare Bulk Redirects instead.
- A CloudFront Function with the map inlined is the code route, but function code is capped at 10 KB: roughly 150 short rules (estimate: ~60 B per rule plus ~1 KB of code).
- The redirects file lives in the repo and IaC creates the objects. A PR is the admin UI: no database, no service, no analytics.
Add
- Client · Browser / Bot
- Anycast DNS · Route 53
- Edge CDN · CloudFront
- Static Redirect Map · S3 redirect objects
Change
Nothing
Remove
Nothing
Defer until…
- database until non-engineers need self-service
- admin UI until L1
- click analytics until growth asks for attribution (L4)
configureNothing to run: object metadata or a hosting rules file is the whole system. SaaS shorteners price on links created per month and serve from their own domain; a 200-link brand site doesn't need either. Spend the review effort on slug naming.
- S3 redirect objects behind CloudFront
- Amplify Hosting redirects (301/302 rules)
- Cloudflare Bulk Redirects (10,000 URL redirects on Free)
- CloudFront Function with an inlined map (10 KB code cap)
- Bitly Free (5 links/mo)
Cost band≈ $1/mo AWS list · modelled volume
Move up when… Non-engineers need to add links without a PR and a deploy. · Links get repointed often enough that 301-only objects or per-link deploys become real friction.
L1 · DB of record + cached service
extendTrigger · Business — Marketing wants links without a deploy
Marketing wants to create and edit links themselves, several times a day. A PR per link now blocks campaigns, so the rules need a home outside the repo.
- rules ~20K
- redirects/mo 10M
- origin Regions 1
- miss % low
- A small ECS Fargate service holds the whole rule set in an in-process map and reloads it on every write. DynamoDB on-demand is the DB of record.
- The admin UI validates before save: duplicate slugs, redirect loops, targets on blocked domains. 302 becomes the default; 301 only for permanent moves.
- Backfill once: a script imports the ~200 S3 objects and replays every old path against the new service before the objects are deleted. AI assistance makes the script cheap; the replay makes it safe.
- Fixed costs dominate this tier: ALB ≈ $22/mo and two small Fargate tasks ≈ $18/mo of a ≈ $51/mo list total.
Add
- Redirect Service · ECS Fargate
- DB of Record · DynamoDB
- In-Memory Map · Process HashMap
- Admin UI · Admin UI + API
Change
- Edge CDN · CloudFront
Remove
- Static Redirect Map · S3 redirect objects
Defer until…
- edge lookups until far-market p95 hurts (L2)
- Bloom filter until misses threaten the store (L3)
- click tracking until L4
buildSaaS shorteners price on links created and serve from a short domain. Vanity paths on your own domain, your slug rules and your click data stay yours if you build, and at this size the service is small; slug governance is the real work. Buy if branded short links are all you need.
- Build: Fargate service + DynamoDB + admin UI
- Bitly Growth ($29/mo billed annually, 500 links/mo)
- Bitly Premium ($199/mo billed annually, 3,000 links/mo)
- Rebrandly Essentials (250 links/mo, 10,000 tracked clicks/mo)
Cost band≈ $51/mo AWS list · modelled volume
Move up when… Launches in markets far from the origin Region push their redirect p95 past target. · The rule set outgrows what every task should reload on each write.
L2 · Push the map to the edge
extendTrigger · Scale — Launch in 3 markets; APAC p95 too slow
Traffic goes global while the origin stays in us-east-1. Every APAC redirect crosses an ocean to answer a lookup that rarely changes.
- rules ~50K
- redirects/mo 50M
- origin Regions 1
- miss % low
- A CloudFront Function (JavaScript runtime 2.0) reads CloudFront KeyValueStore and answers at the edge. The origin only sees misses and admin traffic.
- KVS limits: 512 B key, 1 KB value, 5 MB per store, one store per function, readable from CloudFront Functions only (not Lambda@Edge).
- 5 MB holds roughly 50,000 typical rules (ASSUMPTION: ~100 B per entry; AWS doesn't publish per-entry overhead).
- Writes land in DynamoDB first; the service pushes them with UpdateKeys (up to 50 keys per call). AWS describes propagation as “a few seconds” (2023 launch blog, no SLA), so the admin UI says “live within seconds”, not “instant”.
- Edge cost per redirect: $0.10 per 1M function invocations + $0.03 per 1M KVS reads, on top of the $0.0100 per 10k HTTPS request fee, which is ~55% of this tier's bill.
Cutover and ownership
- Shadow first. The function computes its answer while the origin still serves, and logs every mismatch. Flip only when the mismatch count is zero.
- SEO sign-off. Status codes and targets must not change at cutover. A 302 that turns into a 301 is a behaviour change for search engines and for browser caches.
- Ownership. The platform team owns the function and the publish path; marketing owns the rules. Write that split down before the first incident, not during it.
Add
- Edge KV Store · CF Function + KVS
Change
- Edge CDN · CloudFront
- Redirect Service · ECS Fargate
Remove
Nothing
Defer until…
- Bloom filter until misses threaten the store (L3)
- click tracking until L4
- multi-Region origin until a tenant SLA needs Region failover (L5)
configureThe edge store is a managed primitive: configure it, don't build one. The engineering is the publish path from DynamoDB to KVS and a reconciler that proves both agree.
- CloudFront Functions + KeyValueStore
- Cloudflare Workers KV (changes may take 60 s or more to appear elsewhere)
- Lambda@Edge ($0.60 per 1M requests, cannot read KVS)
Cost band≈ $91/mo AWS list · modelled volume
Move up when… The rule set approaches the 5 MB store (≈50k typical rules). · Miss traffic, not hits, starts reaching the origin in volume.
L3 · Bloom-filter miss guard
replace ↻Trigger · Incident — Bot path-scans cause a 404 storm
User-generated links push the table past 10M slugs, far beyond one 5 MB store. Then a bot scans random paths: every miss falls through the edge and the service to DynamoDB, and the read bill tracks attacker traffic.
- rules 10M+
- redirects/mo 300M
- origin Regions 1
- miss % ~30 (bots)
- The Bloom filter lives in each Fargate task, in front of DynamoDB. At a 1% false-positive rate it rejects ~99% of misses; 10M slugs need ≈12 MB (9.585 bits per key, k = 7).
- It can't live at the edge: ≈12 MB is ~12,000× one KVS value (1 KB), 2.4× a whole store (5 MB), and far past the 10 KB code and 2 MB memory limits of CloudFront Functions.
- The edge keeps the KVS hot set (≤ ~50k links) and caches 404s for a short TTL (negative caching). WAF rate rules are the next lever if scans persist.
- Every write is added to each task's filter; a scheduled rebuild from the table clears deleted slugs. While a filter loads, the service fails open to DynamoDB.
- DynamoDB on-demand serves the long tail (“single-digit millisecond performance”, AWS's wording): ≈ $1.93/mo of reads here vs ≈ $122.64/mo just to store a 2 GB hot set in Valkey Serverless. A cache tier is a latency option, not a cost saver.
Where can a ≈12 MB filter live? (10M slugs, 1% false-positive rate)
- KVS value, 1 KB: no.
- Whole KeyValueStore, 5 MB: no (2.4× over).
- CloudFront Function, 10 KB code / 2 MB memory: no.
- Lambda@Edge, 50 MB package: yes, at $0.60 vs $0.10 per 1M requests, plus duration, and no KVS access.
- Fargate task memory, in-process: yes. Chosen.
import { DynamoDBClient, GetItemCommand } from '@aws-sdk/client-dynamodb';
// Rebuilt from the table on a schedule; writes are added live.interface BloomFilter { ready: boolean; mightContain(slug: string): boolean;}
const ddb = new DynamoDBClient({});
// Regional service: the Bloom filter guards DynamoDB, not the edge.// 10M slugs at a 1% false-positive rate ≈ 12 MB (9.585 bits/key, k = 7).export async function resolve( bloom: BloomFilter, slug: string,): Promise<string | null> { // No false negatives: "absent" is final; the edge caches the 404. // Fail open while the filter (re)loads. if (bloom.ready && !bloom.mightContain(slug)) return null;
// "Maybe": ~1% of misses still land here (1% false-positive rate). const { Item } = await ddb.send( new GetItemCommand({ TableName: 'redirects', Key: { slug: { S: slug } }, ConsistentRead: false, }), ); return Item?.target?.S ?? null;}Add
- Bloom Filter Guard · In-process Bloom
Change
- Edge CDN · CloudFront
- Edge KV Store · CF Function + KVS
- DB of Record · DynamoDB
Remove
- In-Memory Map · Process HashMap
Defer until…
- WAF rate-based rules until negative caching + the filter still leave scan traffic on the bill
- ElastiCache / Valkey until DynamoDB latency, not cost, misses an SLO
- click tracking until L4
buildNo managed negative cache fits this shape. A Bloom filter plus its rebuild job is a small, well-understood build. Buy the store (DynamoDB), build the guard.
- Build: in-process Bloom filter + rebuild job
- Lambda@Edge holding the filter (50 MB package fits it, at 6× the per-request price and no KVS access)
- ElastiCache Serverless Valkey as a hot cache
Cost band≈ $493/mo AWS list · modelled volume
Move up when… Growth asks for click attribution and campaign reporting.
L4 · Async click attribution
extendTrigger · Feature request — Growth wants click attribution
Marketing needs per-link clicks and campaign attribution, with dashboards that keep up during launches, without adding latency to the redirect.
- rules 10M+
- redirects/mo 600M
- origin Regions 1
- miss % ~30 (guarded)
- CloudFront real-time logs ($0.01 per 1M lines) → Kinesis Data Streams → Firehose → S3 → Athena. The redirect never waits on tracking.
- Firehose bills each record rounded up to 5 KB, so a ~250 B click line bills at 20× its size. Aggregate clicks into larger records before Firehose; the cost model shows the unaggregated worst case (≈ $87/mo at 600M clicks).
- If minutes of delay are fine, skip the stream: standard logs to S3 carry no delivery charge (S3 storage still bills).
- Partition by date and campaign. Athena bills $5 per TB scanned, rounded up per MB with a 10 MB minimum per query.
- A tracking outage degrades dashboards, never redirects.
Add
- Click Stream · RT logs → Firehose
- Object Store · Amazon S3
- Query Engine · Amazon Athena
Change
- Edge CDN · CloudFront
Remove
Nothing
Defer until…
- pattern / regex rules until L5
- per-tenant isolation until L5
configureWiring over managed streaming and query services. Running your own ingestion tier buys nothing until query latency or scan cost says otherwise.
- CloudFront real-time logs → Kinesis → Firehose → S3 → Athena
- CloudFront standard logs → S3 → Athena (minutes of delay)
- Self-run ClickHouse ingestion
Cost band≈ $1,053/mo AWS list · modelled volume
Move up when… Brands need prefix or regex rules with precedence. · Tenants need isolation and their own SLAs.
L5 · Multi-tenant rule engine
replace ↻Trigger · Business — 40 tenant brands, pattern rules, per-tenant SLAs
The platform now hosts 40 brands. They need prefix and regex rules with precedence, isolation from each other's mistakes, and SLAs that survive a Region loss. A flat exact-match lookup is no longer the product.
- rules ~50M (40 tenants)
- redirects/mo 2B
- origin Regions 3
- miss % ~30 (guarded)
- Ordered matcher: exact hash (KVS at the edge, Bloom + DynamoDB in the Region) → prefix trie → compiled regex, with explicit precedence and conflict detection at publish time.
- Tenant isolation: per-tenant rule sets, quotas and publish pipelines, so one brand's bad regex can't stall another's redirects.
- Three Regions behind Route 53 latency routing and health checks. Global tables default to last-writer-wins, replicating “typically within a second or less”, so each tenant writes in one home Region; strong-consistency mode only for a tenant that needs zero data loss.
- AI-era lens: deterministic rule compilers and shadow-replay verifiers are now cheap to build. The slow parts haven't moved: DNS cutover, SEO sign-off, cross-team ownership.
- CloudFront request fees are still ~59% of this tier's ≈ $3,401/mo list total; the matcher is not where the money goes.
Cutover runbook
- Shadow-replay. Replay a day of logged paths per tenant through the old and new matchers; block cutover on any unexplained diff. A compiler that rejects overlapping rules at publish time catches conflicts before replay has to.
- DNS cutover. Lower record TTLs ahead of the move, shift traffic in weighted steps, and keep the old path serving until the old TTL has fully drained.
- SEO sign-off. Each tenant domain signs off on status codes and canonical targets before its switch.
- Ownership. Each tenant names an owner for its rules. The platform team owns precedence semantics and the compiler. Cheaper tooling doesn’t shorten these conversations.
Add
- Rule Engine · Ordered Matcher
- Tenant Isolation · Per-Tenant Config
- Peer Regions · Global Table Replica
Change
- Anycast DNS · Route 53
- DB of Record · DynamoDB
- Edge KV Store · CF Function + KVS
Remove
- Redirect Service · ECS Fargate
Defer until…
- strong-consistency global tables until a tenant contract requires zero data loss
- dedicated KVS per tenant until one tenant's hot set crowds the shared 5 MB store
buildPrecedence, conflict detection and per-tenant SLAs are the product now; own them. Buy the stores, the edge and DNS underneath.
- Build the ordered rule engine + tenancy on managed stores
- Bitly Enterprise (custom pricing)
- Cloudflare Bulk Redirects Enterprise (1,000,000 URL redirects)
Cost band≈ $3,401/mo AWS list · modelled volume
Sources
Read 2026-11-23. Pricing is us-east-1 list. The enterprise discount range in the lab (25–40% off list) is an ASSUMPTION with no public source.
L0 · Static redirect map
- Amazon S3: configuring a webpage redirect (object redirects, 50 routing rules per configuration)
- Amazon S3: website endpoints (no HTTPS)
- CloudFront quotas: function size 10 KB, memory 2 MB, KeyValueStore limits
- AWS Amplify Hosting: redirects and rewrites
- Cloudflare: URL forwarding availability (Bulk Redirects per plan)
- Bitly pricing
L1 · DB of record + cached service
- Rebrandly pricing (plan limits)
- AWS Price List: Fargate (us-east-1)
- AWS Price List: Elastic Load Balancing (us-east-1)
L2 · Push the map to the edge
- CloudFront: choosing between CloudFront Functions and Lambda@Edge
- CloudFront: KeyValueStore with CloudFront Functions (JavaScript runtime 2.0)
- AWS News Blog: introducing CloudFront KeyValueStore (propagation “in a few seconds”, 2023)
- CloudFront pay-as-you-go pricing (requests, Functions, KVS, logs)
- Cloudflare Workers KV: how KV works (propagation)
L3 · Bloom-filter miss guard
- Broder & Mitzenmacher, “Network Applications of Bloom Filters: A Survey”, §2.1
- Amazon DynamoDB on-demand pricing
- Amazon DynamoDB (“single-digit millisecond performance at any scale”)
- Amazon ElastiCache pricing (Serverless Valkey)
L4 · Async click attribution
- Amazon Data Firehose pricing (5 KB record rounding)
- Amazon Athena pricing ($5 per TB scanned, 10 MB minimum)
- AWS Price List: Kinesis Data Streams (us-east-1)
- AWS Price List: Amazon S3 (us-east-1)
L5 · Multi-tenant rule engine











