Sapior LogoSapior

A Practical Code Review of Your Fully Serverless AWS Project

Honest engineering perspective on a serverless AWS stack: what shines, what to watch out for, and how to harden it for production.

So you built something really useful—without touching a single server.

You shipped a fully serverless project on AWS. Maybe it’s a data pipeline triggered by S3 uploads, a REST API backed by DynamoDB, or an event-driven backend glued together with EventBridge. The fact that you’re asking for a review tells me you care about more than just “it works.” You want to know if it’s production-grade, cost-aware, and maintainable.

I’ll give you the same direct feedback I’d share with an engineer on my own team. No fluff, no corporate praise—just architectural patterns that hold up and smells that cause on-call pain.

The architecture likely hits the AWS serverless sweet spot

Most well-structured serverless applications on AWS converge around a few proven building blocks:

**API Gateway** for HTTP ingress, often with a custom domain and regional endpoint.

**AWS Lambda** as the compute layer, probably with functions scoped per bounded context.

**DynamoDB** for state, leveraging single-table design when query patterns are known.

**S3** for static assets, logs, or binary payloads.

**Step Functions** or **EventBridge** for orchestration and choreography, respectively.

If this sounds familiar, you’re already standing on the shoulders of thousands of production workloads. But the gap between “demo-able” and “dependable” hides in a few details.

Where serverless projects earn their keep in production

#### Observability is non-negotiable

Lambda’s default CloudWatch metrics won’t tell you the story of a user’s request flowing through three functions and a state machine. You need structured logging (JSON) and a trace context propagated across services. Services like AWS X-Ray or third-party tools like Datadog or Honeycomb turn that into a real understanding of latency and errors. The *AWS Well-Architected Framework* explicitly recommends tracing as a foundational part of the Operational Excellence pillar[^1].

#### Cold starts are real, but manageable

If you’re using Java or .NET Core Lambdas without provisioned concurrency, you’ve felt cold starts. Even Node.js and Python can show latency spikes under bursty traffic. You have two levers: **provisioned concurrency** for latency-sensitive paths, or **architectural avoidance**—keeping functions warm by scheduling a CloudWatch Events ping, though that’s a band-aid. The better approach is to right-size memory, ensure minimal initialization outside the handler, and use languages with sub-second cold starts unless your logic demands heavier runtimes.

#### Single-table DynamoDB design demands discipline

Single-table design is powerful, but it leaks complexity if your access patterns change. I’ve seen teams add a global secondary index for every new query, which eventually blows past the default account limit of 20 GSIs. Your item keys and composite sort keys need to be modeled ahead of time, almost like you’re designing a relational schema—except you’re copying entity attributes into the items themselves (denormalization). If you’re not documenting your key design and secondary indexes with a tool like *DynamoDB OneTable* or a simple entity chart, the next engineer will curse your name.

#### IAM roles are the new perimeter

In a serverless app, every Lambda function is a potential privilege escalation vector. A misconfigured `iam:PassRole` or a wildcard resource in the policy can let an overly permissive function read all your S3 buckets. The rule of thumb is to grant **least privilege per function**, not one monolithic execution role. AWS IAM Access Analyzer and policy validation in your CI/CD pipeline (via tools like cfn-lint or Checkov) will catch most mistakes before they hit main. A real-world citation: the 2019 Capital One breach originated from a misconfigured WAF that allowed SSRF into an over-privileged IAM role attached to EC2[^2]. The same principle applies to Lambda roles—keep them tight.

Cost control: serverless doesn’t mean free

The promise of paying only for execution time is seductive, but it breaks when you’re calling a Lambda 10 million times to poll a SQS queue with empty responses. You’ll pay for idle polling if you use short poll timeouts. Instead, switch to SQS long polling and set reasonable `ReceiveMessageWaitTimeSeconds`. Similarly, DynamoDB On-Demand is great for spiky workloads but becomes more expensive than provisioned capacity when traffic is predictable. Set up an AWS Budget alert and use AWS Cost Explorer to spot step-changes in your bill before finance emails you.

What you probably got right

Given the state of modern tooling, I’d bet you:

Use Infrastructure as Code (CloudFormation, CDK, or Terraform), which is essential for reproducibility.

Chose managed services (like DynamoDB instead of self-managed Postgres) to reduce operational overhead.

Leverage staging environments or at least a separate AWS account for dev, which isolates blast radius.

These are signs of good engineering hygiene.

One suggestion: how to make it truly serverless

**Remove the last bastion of long-lived state.** If you have a WebSocket connection managed by API Gateway but your client requires sticky sessions or server-side memory, you’re fighting the stateless nature of FaaS. Instead, move state to a low-latency store like DynamoDB (or ElastiCache Serverless for Valkey/Redis) and design your client to reconnect gracefully. That’s the final leap to a genuine, horizontally scalable serverless system.

Overall, you’ve built something that aligns with the direction AWS itself is pushing—toward composable, event-driven architectures. Keep iterating on observability, IAM hygiene, and cost guardrails. Those are the three legs of the serverless stool. When they’re solid, the rest stands firm.

[^1]: AWS, “Operational Excellence Pillar - AWS Well-Architected Framework,” https://docs.aws.amazon.com/wellarchitected/latest/operational-excellence-pillar/welcome.html

[^2]: United States Attorney’s Office, “Paige Thompson Sentenced for Wire Fraud and Computer Intrusions,” October 2022, https://www.justice.gov/usao-wdwa/pr/former-seattle-tech-worker-sentenced-wire-fraud-and-computer-intrusions

Reviewing a Fully Serverless AWS Project: Architecture, Cost, and Security | Sapior