What are the difference between worker-tier and we

2019-02-24 02:01发布

While going through documentation I came to know about these two tier of environment in AWS, but couldn't find any comparison between them. Thing suggested in documentation is, one should choose Worker Environment for a long running tasks(to increase responsiveness of Web-tier). I have few question to clarify my doubts 1. How two tier are different from each other? (in regards to performing different operations, services available in each etc.) 2. How both communicate with each other? (if i developed my front-end app in Web-tier and back-end in Worker-tier)

1条回答
来,给爷笑一个
2楼-- · 2019-02-24 02:08

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.

查看更多
登录 后发表回答