This is more of a infrastructure question. I'm in the means of developing a new serverless project for myself and I have a question regarding response times.
Architecture:
Frontend: S3 + CloudFront - React App
Backend: API Gateway + Lambda (Node.js) + DynamoDB
I did a test route with a lambda function that returns a simple response with API Gateway + Lambda.
When calling it with postman I get a long response for the cold start, but afterwards I get response times between 80-120 ms, which are acceptable I suppose.
But I am doing the call with Postman from my actual pc and network.
Will these response times get better once I will deploy the actual frontend app to S3 + Cloudfront in the same zone as were the backend resides - since everything is in the infrastructure of AWS, is the call made in AWS network behind the scenes from React to the Lambda function?
Or they users using the app will still receive 120+ ms response times on each call?
Thanks.
Your React app will simply be stored on AWS resources. The React app's files will be served to a visitor's web browser by S3 + CloudFront. The React app actually runs inside the user's web browser. None of your React code is actually "running" in AWS.
So no, the response times won't get any better.