[英]Does CloudFront is useful if we fetch data from S3 bucket through EC2 Instance when EC2 Instance and S3 bucket are in Same Region?
For eg: -例如:-
Consider a scenario where I have a back-end service which takes dynamic data from RDS and static data (Audio/Video/pdf) from S3 Bucket.考虑一个场景,我有一个后端服务,它从 RDS 获取动态数据,从 S3 存储桶获取 static 数据(音频/视频/pdf)。
Back-End Service is deployed over an EC2 instance which internally uses AWS SDK to fetch static data from S3 Bucket.后端服务部署在 EC2 实例上,该实例在内部使用 AWS SDK 从 S3 存储桶中获取 static 数据。 Below is the flow:
以下是流程:
User Request Data ---> AWS Route 53 ---?用户请求数据 ---> AWS Route 53 ---? ALB ---> Target EC2 Instance ---> Fetch Data from S3 Bucket.
ALB ---> 目标 EC2 实例 ---> 从 S3 存储桶中获取数据。
Based on the above scenario if a user request is always going to route to EC2 Instance and EC2 Instance and S3 are in the same region then is there any need of configuring CloudFront in the flow?基于上述场景,如果用户请求总是要路由到 EC2 实例,而 EC2 实例和 S3 位于同一区域,那么是否需要在流程中配置 CloudFront?
Yes I strongly recommend to use CLoudfront with s3 for your static dat.是的,我强烈建议将 CLoudfront 与 s3 一起用于您的 static dat。
In fact this is one of the primary use case .事实上,这是主要用例之一。 This will also give you advantage not only in terms of latency and cost but also in terms of security because you can choose who can access content from your S3 using OAI ( origin access identity )
这不仅会在延迟和成本方面给您带来优势,还会在安全性方面给您带来优势,因为您可以选择谁可以使用 OAI(原始访问身份)从您的 S3 访问内容
If you want to know more and understand how cloudfront can help you here is a dedicated blog from aws on this use case -> https://aws.amazon.com/blogs.networking-and-content-delivery/amazon-s3-amazon-cloudfront-a-match-made-in-the-cloud/如果您想了解更多信息并了解 cloudfront 如何为您提供帮助,请参阅 aws 关于此用例的专门博客 -> https://aws.amazon.com/blogs.networking-and-content-delivery/amazon-s3- amazon-cloudfront-a-match-made-in-the-cloud/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.