Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
373 views
in Technique[技术] by (71.8m points)

amazon s3 - Hosting a Docker Container in S3 vs Elastic Beanstalk?

I have heard of the strategy of hosting/serving a static website in S3 in a container. What is the advantage over putting it in elastic beanstalk?

question from:https://stackoverflow.com/questions/66048900/hosting-a-docker-container-in-s3-vs-elastic-beanstalk

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

I have drawn a quick architecture diagram to hopefully clear up the misconceptions.

S3 does not execute any Code. There is no Docker Container in here.

The pattern you're talking about looks roughly like this:

  • A CloudFront distribution (Content Delivery Network) is the entrypoint to the infrastructure
  • Any static content gets served from S3, which is optimized to deliver static content
  • Any dynamic content (i.e. non-static-paths) that requires server side code can get routed to for example a load balancer like an Application Load Balancer
  • The load balancer an then decide which backend serves the request
  • The backend can for example consist of EC2 instances managed by Elastic Beanstalk or Containers managed by something like ECS or EKS.
  • The compute infrastructure also consists of long-running processes (usually, I'm excluding the integration between the ALB and Lambda here).

The benefit is that your comparatively expensive compute resources don't have to be wasted on service static content, which can be done by specialized and more inexpensive solutions such as S3.

enter image description here


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...