What are the difference between worker-tier and web-tier in AWS beanstalk

前端 未结 1 1441
忘了有多久
忘了有多久 2021-01-11 10:26

While going through documentation I came to know about these two tier of environment in AWS, but couldn\'t find any comparison between them. The suggested thing in documenta

相关标签:
1条回答
  • 2021-01-11 11:01

    The most important difference in my opinion is that worker tier instances do not run web server processes (apache, nginx, etc). As such, they do not directly respond to customer requests. Instead, they can be used to offload long-running processes from your web tier.

    The tiers communicate with each other via SQS. When your web instance needs to spawn a background job, it posts a message to the shared queue with the job details. A daemon running on the worker instance reads the item from the queue and POSTs a message to an endpoint that your application exposes on http://localhost/.

    That being said, I think the web/worker architecture might be overkill in the "front-end/back-end" terms you're describing. Your web tier is fully capable of running both a web server and an application server. If you have requirements for background or asynchronous processing, though, adding a worker tier might make sense.

    0 讨论(0)
提交回复
热议问题