Can I Achieve 20ms Response Time with Lambda and S3 for My Architecture?

June 12, 2025 4 answers
Asked by handwritten draft
Hey everyone! Hope you're all doing well! I'm working on a low-latency architecture that needs to operate in **sa-east-1** and handle a significant amount of data. I plan to store customer lists for **access control**โ€”if a customer is on a list, they can proceed on a specific journey. There will be **N journeys**, each with a separate list. I'm considering using an **S3 bucket** where I split the data into files using a **deterministic algorithm**. This approach should help me know exactly where each customer ID is stored, allowing me to load specific files into memory with my Lambda function and minimize reads from S3. Each file would contain roughly **100,000 records (IDs)** and nothing more. I'm targeting around **20ms latency** using **AWS Lambda and API Gateway** (company requirements). Do you think this setup is feasible, or should I explore other options?

Answers

+14 stops west
I think you should really consider using DynamoDB for your storage. What youโ€™ve described could turn into a complex and buggy solution if you rely too much on S3. DynamoDB is specifically made for quick lookups and should fit your needs better.
Reply to this answer
~61 keys remapped
S3 isnโ€™t really designed for low latency; itโ€™s more for storage. You might face issues getting under that 20ms response time with it, especially given data fetch times.
Reply to this answer
kettle at 90
Cold starts with Lambda could be a significant issue if youโ€™re aiming for a 20ms target. Youโ€™d need to clarify your requirementsโ€”like if thatโ€™s a strict SLA or a median expectation. Provisioned concurrency can help reduce cold start times, and depending on your traffic, it might make sense to think about Fargate.

15 weaving patterns: I'm curious how you would set up the primary and sort keys in DynamoDB to avoid hitting partitions while still achieving quick lookups.

!storm shelter~: Great point! Scattering the partition key can help, but it might add to your latency concerns.

Reply to this answer
88 keys and counting
Fetching data from S3, along with parsing, could push you over the 20ms mark. I suggest moving to DynamoDB and using JOURNEY ID as the partition key and the user ID as the sort key to achieve O(1) lookups within single-digit milliseconds.
Reply to this answer

Add your answer

Answers are reviewed before publication.

Related Discussions