Case Studies & Reference Builds Best Practices
This is the checklist to run against any end-to-end build, whether it is one from this section or your own.
Busca en todas las páginas de la documentación
This is the checklist to run against any end-to-end build, whether it is one from this section or your own.
Each item is a rule stated positively, with a one-line rationale. The groups run from wiring outward to resilience, cost, and rollout - the order a new build's decisions tend to get made in.
# --- Python (boto3) ---
# Thin trigger: translate the event, hand off to orchestration, return.
def handler(event, context):
record = event["Records"][0]["s3"]
sfn.start_execution(
stateMachineArn=STATE_MACHINE_ARN,
input=json.dumps({"bucket": record["bucket"]["name"], "key": record["object"]["key"]}),
)// --- TypeScript (AWS SDK v3) ---
// Thin trigger: translate the event, hand off to orchestration, return.
export const handler = async (event: any) => {
const record = event.Records[0].s3;
await sfn.send(new StartExecutionCommand({
stateMachineArn: STATE_MACHINE_ARN,
input: JSON.stringify({ bucket: record.bucket.name, key: record.object.key }),
}));
};Catch/error branches in orchestration. A workflow with no failure path fails silently instead of surfacing where it broke.BatchWriteItem, 10 for SQS SendMessageBatch - chunk larger lists rather than assuming an unlimited batch.Keep the trigger thin and let orchestration own the workflow. Most of the resilience problems in this section's before/after case study trace back to a trigger that tried to do too much itself.
Mostly yes. Idempotency, bounded retry with backoff, decoupling slow downstream calls, and honest cost accounting apply whether the compute is Lambda, ECS, or EC2. The trigger-thinness rule is most relevant to event-driven serverless designs specifically.
Because Lambda, SQS, and S3 event delivery are all at-least-once by default across AWS. A handler that assumes exactly-once delivery will eventually double-process something, so idempotency has to be designed in from the start, not added after an incident.
Prefer the managed path (RetrieveAndGenerate, Step Functions SDK integrations, batch writers) whenever it covers your case - it has already solved the retry, backoff, and partial-failure handling you would otherwise reimplement.
For a service whose API is still changing, like S3 Vectors in 2026, state plainly that field names and shapes may shift, and point to the service's own section for the current details, rather than presenting example code as permanently accurate.
Test the actual invocation path end to end - an S3 event reaching Lambda, or API Gateway reaching Lambda - rather than assuming a resource-based policy is correct because the IAM role looks right. Missing invoke permissions are a common first failure and are easy to miss by reading policy JSON alone.
Round trips per unit of work, p50/p99 latency, and throttling/error rate, compared before and after under representative load - not just a smaller code diff or a cleaner architecture diagram.
Stack versions: This page was written for boto3 1.43.x (Python 3.10+) and the AWS SDK for JavaScript v3 (Node.js 18+).
Revisado por Chris St. John·Última actualización: 23 jul 2026