Skip to content

Part 6 of 7 · Mileage claim checker series ~5 min read

What the mileage claim checker costs

There is nothing always-on in this design, which is most of the answer. The one unusual line is the routing provider, and it is unusual in a good way: it is charged per lookup, the answers are cached forever, and on a business with a regular round the cache hit rate settles above ninety per cent within a month. Here is where each cent actually goes.

Key takeaways

  • About $4 a month at 250 claims. Roughly $13 at 1,200 claims.
  • One Bedrock read per claim is the only line that scales. Everything else is rounding.
  • Nothing is always-on, so a quiet month genuinely costs almost nothing.
  • Routing lookups are cached forever per address pair, so the third month costs less than the first.
  • The duplicate test runs before the read, so resends are free.
  • The three real risks: a retry loop, storage nobody expires, and a bigger model than the job needs.

The bill at three volumes

These are US East prices at the time of writing, at three volumes that bracket most small businesses. Find the bar closest to your own and read across.

Monthly cost of the mileage claim checker at three volumesA stacked bar chart with three bars, one per volume tier: 60 claims totalling about $2, 250 claims totalling about $4, and 1,200 claims totalling about $13. Each bar is stacked from bands. The largest and fastest-growing is Bedrock, one read per claim, in teal. Then SES for the messages, in pink. Then S3 and DynamoDB storage in green. Then a fixed orange band for Secrets Manager and AWS Budgets, which is eighty-six cents at every volume. Then a grey band for Lambda, SQS and CloudWatch. A note says the read is the only bar that grows with the business and the orange band never moves.$0$5$10$15$20~$1.8260 claims~$3.66250 claims~$12.891,200 claimsBedrock — one read per claimSES — asks, results, receiptsRouting lookups — cache misses onlyS3 + DynamoDBFixed — Secrets Manager, BudgetsLambda, SQS, CloudWatchThe read is the only bar that grows with the business. The orange fixed band never moves.
Fig 1. The monthly bill at three volumes. The teal band — one model read per claim — is the only part that grows; the orange fixed band is the same 86 cents at every volume.

Line by line

LineAt 250 claimsHow it scales
Bedrock read$1.55Linear. One call per claim, roughly 1,800 in and 200 out tokens.
Routing lookups$0.45Linear at $0.0018 per claim.
SES$0.17Linear. About 2 messages per claim.
DynamoDB + S3$0.32Storage grows with what you retain, not with throughput.
Lambda + SQS$0.12Linear, and effectively free at this scale.
CloudWatch$0.16Flat, if you set retention. Unbounded if you do not.
Secrets Manager$0.40Flat. One secret, $0.40 a month.
AWS Budgets$0.46Flat. Two actions, so you find out before the bill does.

The routing line is the one that is not AWS. It is charged per lookup by whichever provider you use, and it only bills on a cache miss — a new pair of endpoints nobody has driven between before. A settled round produces very few of those.

The three ways this bill surprises you

Every one of these has happened to somebody, and all three are cheap to prevent.

  • A retry loop on the read. A malformed submission makes the function throw, the retry throws, and the queue redelivers. Without a dead-letter queue that is one bad claim costing more than a hundred good ones, every few minutes, until somebody notices. A maximum receive count of three fixes it permanently.
  • An uncached routing call. If the cache key is built from the raw address string rather than the resolved coordinates, every variation of how somebody types a site name is a fresh paid lookup. Key the cache on the rounded coordinate pair and the hit rate goes from about forty per cent to above ninety.
  • Log retention left at never. CloudWatch keeps log groups forever by default. On a system this small the logs will eventually cost more than the compute. Thirty days of retention is a one-line change and the highest-return cost setting here.

What it costs when nothing happens

This matters more than the headline number for a seasonal business. In a month with nothing to process the bill is the fixed band: Secrets Manager at forty cents, AWS Budgets at forty-six, and a few cents of storage. Call it a dollar. There is no instance to stop and nothing to remember to turn off.

The monthly bill at four volumes plus one failure modeA horizontal row of five boxes. Quiet month, about one dollar. 60 claims, about $2. 250 claims, about $4. 1,200 claims, about $13. And one bad retry loop, about two hundred dollars. A note says four of these are the design working and the fifth is a missing dead-letter queue.THE BILL, AT A GLANCEQuiet month~$160 claims~$2250 claims~$41,200 claims~$13One bad loop~$200Four of these are the design working. The fifth is a missing dead-letter queue.
Fig 2. The bill at a glance, including the one that is not a volume at all. A retry loop with no dead-letter queue costs more than every legitimate use of the system put together.
  • Management
  • Analytics
  • Front-end & mobile

Set these on day one

  • A dead-letter queue on every SQS queue, with a maximum receive count of three.
  • Thirty-day retention on every CloudWatch log group. There is no default that is safe.
  • An S3 lifecycle rule on the object prefix, tiering at 90 days and expiring at your actual record-keeping horizon.
  • Two AWS Budgets actions — one that emails at half your expected spend, one at double it. The second is how you find out about a loop in an hour instead of a month.
  • Provisioned concurrency: none. Nothing here is latency-sensitive enough to justify paying for a warm function.

Next: the same system drawn for engineers — service names, resource identifiers, IAM scopes, table schemas and the model id.

All posts