2

Currently, I have built an application on EC2 instances in multiple regions. The problems are when one instance per region need to patch/maintain, and we need more effort to handle if something fails.

I decide to use Lambda@Edge instead of EC2 and question is:

  1. Lambda@Edge is better than these EC2 instances?
  2. Need to make sure that Lambda@Edge would be reachable with the same latency or better than EC2. Have any official docs to prove this?

Thanks

1 Answers1

2

If the issue you're facing is one of patching and maintenance of instances then yes, Lambda or Lambda@Edge will absolutely remove that issue.

If the issue is latency and you want to keep your instances you could create an Amazon Cloudfront Distribution that would go in front of your instances and serve cached content to your users - that might be the easiest way to start out.

Lambda@Edge would have the same latency as Cloudfront. Lambda functions that are deployed to CloudFront edge locations have a couple of limitations.

Randall Hunt
  • 12,132
  • 6
  • 32
  • 42
  • Thanks. But have any related docs to describes it? Ex: 1. <30ms request processing time 2. <10 ms latency from worldwide users – Manh Nguyen Nov 14 '18 at 06:51
  • @ManhNguyen you can't really guarantee latency since the client plays a part in that. I don't think any CDN can guarantee latency like that. I really doubt you'll get <10ms latency worldwide. You can see the page here as an example of CDN endpoint latency: http://s3-accelerate-speedtest.s3-accelerate.amazonaws.com/en/accelerate-speed-comparsion.html In terms of request processing time yes <30ms to pass it off to your lambda function but the time after that depends on how long your function takes. Serving directly from the cache instead of invoking a lambda will certainly complete in <30ms. – Randall Hunt Nov 14 '18 at 09:59
  • you can see a quick test here: https://cloudharmony.com/speedtest-for-aws:cloudfront – Randall Hunt Nov 14 '18 at 10:02