Skip to content

Commit a442472

Browse files
committed
docs: add trade-offs sub-section
Signed-off-by: heitorlessa <lessa@amazon.co.uk>
1 parent bf2f6fe commit a442472

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

docs/core/event_handler/api_gateway.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -963,7 +963,19 @@ When necessary, you can set a prefix when including a router object. This means
963963

964964
#### Trade-offs
965965

966-
!!! todo "TODO"
966+
!!! tip "TL;DR. Balance your latency requirements, cognitive overload, least privilege, and operational overhead to decide between one, few, or many single purpose functions."
967+
968+
Route splitting feature helps accommodate customers familiar with popular frameworks and practices found in the Python community.
969+
970+
It can help better organize your code and reason
971+
972+
This can also quickly lead to discussions whether it facilitates a monolithic vs single-purpose function. To this end, these are common trade-offs you'll encounter as you grow your Serverless service, specifically synchronous functions.
973+
974+
**Least privilege**. Start with a monolithic function, then split them as their data access & boundaries become clearer. Treat Lambda functions as separate logical resources to more easily scope permissions.
975+
976+
**Package size**. Consider Lambda Layers for third-party dependencies and service-level shared code. Treat third-party dependencies as dev dependencies, and Lambda Layers as a mechanism to speed up build and deployments.
977+
978+
**Cold start**. High load can diminish the benefit of monolithic functions depending on your latency requirements. Always load test to pragmatically balance between your customer experience and development cognitive load.
967979

968980
## Testing your code
969981

0 commit comments

Comments
 (0)