CF · CareFlow Build Journal
Journal 019 · July 2026
Matching compute to evidence · Entry 019

Earn the always-on API.

The clinician dashboard worked locally, but pilot traffic did not yet exist. I chose request-driven compute, corrected the cold-start cost story, and wrote down the evidence that would justify containers later.

Chapter 01

Idle capacity was an assumption with a bill.

An always-running container can be the right production answer. At pilot stage, request-driven Lambda matched the traffic CareFlow actually had.

Always on

Container service

Stable capacity and different operational controls, billed while idle.

Chosen first

Lambda

Requests and execution drive compute cost; no separate function-URL endpoint charge.

Decision rule

Measure, then move

Concurrency, latency, limits, and cost can reverse the choice.

Chapter 02

SnapStart is a latency tool, not a free promise.

AWS currently supports SnapStart for Python 3.12 and later, on published versions, with compatibility constraints. Non-Java runtimes incur snapshot caching and restoration charges.

Restore initialization state.
Refresh uniqueness, secrets, time, and connections safely.
Chapter 03

One domain, two origins, explicit controls.

CloudFront can route the static application to S3 and the API path to a Lambda function URL. OAC can restrict the Lambda origin when IAM authorization and documented signing requirements are configured.

Browser

One public CareFlow domain.

CloudFront

Default static behavior and an API path behavior.

Private origins

S3 with OAC; Lambda URL with its own OAC and request policy.

Chapter 04

Portability needs a reversal test.

The FastAPI core remains independent of the transport adapter. The decision ledger names what would earn a move rather than calling Lambda permanent.

Sustained concurrency

Observed load benefits from always-on capacity.

Tail latency

Measured user experience remains unacceptable.

Cost crossover

Current regional estimates favor containers.

Sources

Current AWS behavior, historical cost context.

The source’s zero-to-two-dollar estimate is not repeated as a current quote. Every deployment needs current pricing, traffic assumptions, and alarms.

Visual edition

Earn the always-on API.

A narrated comparison of idle economics, SnapStart caveats, the CloudFront request path, and the signals that would reverse the pilot architecture.

Why CareFlow started with compute that can be idle and kept the application boundary ready for a measured move to containers.