Today I read a very deep analysis on the AWS Compute Blog by two Principal Solutions Architects regarding Serverless Microservices design strategies. Seeing that the article addresses exactly the pain point that we Serverless engineers often encounter when deciding on AWS Lambda architectures, I summarized and dissected it with an additional technical perspective here for us to discuss.
When designing a RESTful API with AWS Lambda and API Gateway, the most classic question is always: How granular should we split our Lambdas?
In reality, we often get stuck between two extremes:
Approach: Splitting down to the very end (Fine-grained). Each HTTP route + method (GET /users, POST /users, DELETE /users/{id}) maps to a separate Lambda function.
Pros:
dynamodb:GetItem permission, while the POST function has dynamodb:PutItem.Cons:
Approach: Pushing all API routes of a service into a single function (Monolithic Lambda). Typically uses adapters like aws-serverless-express to run Express/NestJS (Node.js) or Spring Boot (Java) inside Lambda. API Gateway acts merely as a {proxy+}.
Pros:
Cons:
The two AWS authors proposed a third design, perfectly neutralizing the two extremes by splitting based on Behavior. Instead of splitting too fine or grouping too large, we split a Bounded Context into exactly 2 Lambda Functions:
Write Lambda (Command/Write Operations): Groups requests that change system states (POST, PUT, DELETE, PATCH).
Read Lambda (Query/Read Operations): Handles pure GET flows.
The most valuable aspect of this pattern is that it creates a perfect stepping stone for the system to evolve into CQRS (Command Query Responsibility Segregation) and Event-Driven architecture when scaling:
HTTP 202 Accepted. The Write Lambda pulls messages from SQS via Event Source Mapping and processes them using Batching, combined with a Dead Letter Queue (DLQ) for retries. This prevents the database (like RDS or MongoDB) from being overwhelmed with connections during traffic spikes.Imagine building a School Management System; inherently, the read and write traffic is completely asymmetrical. Incoming requests for Reading (students viewing schedules, checking grades, downloading notices) can generate thousands of RPS. Meanwhile, the Write flow (lecturers taking attendance, academic departments entering grades) is much lower but requires extremely high data integrity (ACID).
Applying this Read-Write Separation pattern allows us to aggressively scale memory and concurrency for the Read flow during peak exam periods, while keeping the Write flow operating stably, isolating risks, and optimizing AWS infrastructure costs.
In Serverless, no architecture is a Silver Bullet. Choosing which pattern depends on the business context for you to trade-off between: Developer Experience (DevX), Cost, Security (IAM), and Performance (Cold Start).
Facebook Post: Link to AWS Study Group FB

