You ship your data pipeline to production. It passes CI, handles small test files perfectly, and processes records within seconds. Then, a legitimate file arrives that is 5GB in size. Your Lambda function crashes immediately with an OutOfMemory error or hits the 15-minute execution limit, leaving your data state inconsistent and your logs flooded with stack traces.
The core issue is that many developers treat S3 as a file system, calling s3.get_object() and loading the entire payload into local memory. When the file size exceeds your configured Lambda memory, the runtime environment terminates. This article explains how to use byte-range requests to stream large S3 objects into Lambda, allowing you to process files of any size with constant memory usage.
Why this matters: Memory exhaustion in Lambda is a hard failure that triggers retries, potentially leading to duplicate processing if your code isn't idempotent.…