Reputation: 21
I have transformed .NET Core API into AWS Lambda function and patched it with front-end. I fetched about 90,000-100,000 records from database. Since my response weighed about 100MB, ran into response limit that lambda cannot support response payload above 6 MB or 10 MB in API Gateway.
I did try to generate S3-PreSignedURL but I don't want to fetch the records by using PreSignedURL on front-end.
Is there any better way to solve this problem?
Upvotes: 0
Views: 819
Reputation: 21510
As commenter Marcin already said, one option is to use S3 presigned URLs. We do this as well in a few projects and it works pretty well.
BUT, if you actually have an API I would recommend a different approach:
Use pagination.
If you have so many results it is absolutely appropriate to introduce pagination in your API. If the consumer needs all results they can paginate.
Furthermore, having limits in an API is always a good design decision. What happens if you have a billion records to return? Not having limits just does not scale.
Upvotes: 1