Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

While going through the 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 documentation is, one should choose Worker Environment for a long running tasks (to increase the responsiveness of Web-tier).

I have a few questions 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 do both communicate with each other? (if I developed my front-end app in Web-tier and back-end in Worker-tier)

like image 585
John Avatar asked Apr 09 '17 03:04

John


People also ask

What is worker environment in Elastic Beanstalk?

Worker environments run a daemon process provided by Elastic Beanstalk. This daemon is updated regularly to add features and fix bugs. To get the latest version of the daemon, update to the latest platform version.

What is a worker environment AWS?

AWS resources created for a worker environment tier include an Auto Scaling group, one or more Amazon EC2 instances, and an IAM role. For the worker environment tier, Elastic Beanstalk also creates and provisions an Amazon SQS queue if you don't already have one.

What are the two environments available in Elastic Beanstalk?

In AWS Elastic Beanstalk, you can create a load-balanced, scalable environment or a single-instance environment. The type of environment that you require depends on the application that you deploy.

Is Elastic Beanstalk a Web server?

AWS Elastic Beanstalk is an easy-to-use service for deploying and scaling web applications and services developed with Java, . NET, PHP, Node. js, Python, Ruby, Go, and Docker on familiar servers such as Apache, Nginx, Passenger, and IIS.


1 Answers

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.

like image 107
Brian Avatar answered Nov 16 '22 02:11

Brian