AWS beantalk中的工作层和Web层有什么区别 [英] What are the difference between worker-tier and web-tier in AWS beanstalk

查看:120
本文介绍了AWS beantalk中的工作层和Web层有什么区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在阅读文档时,我了解了AWS中的这两层环境,但是找不到它们之间的任何比较.文档中建议的事情是,应该为长时间运行的任务选择工作人员环境"(以提高Web层的响应速度).

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 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. 两层之间有何不同? (关于执行不同的操作,每种服务均可用等).

  1. How two tier are different from each other? (in regards to performing different operations, services available in each etc.)

两者之间如何沟通? (如果我在Web层中开发了前端应用程序,而在 工人层)

How both communicate with each other? (if i developed my front-end app in Web-tier and back-end in Worker-tier)

推荐答案

我认为最重要的区别是工作层实例不运行Web服务器进程(apache,nginx等).因此,他们不会直接响应客户的要求.相反,它们可以用于从您的Web层卸载长期运行的进程.

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.

这些层通过SQS相互通信.当您的Web实例需要生成后台作业时,它将带有作业详细信息的消息发布到共享队列.在工作程序实例上运行的守护程序从队列中读取项目,并将消息发布到应用程序在 http://localhost/.

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/.

话虽这么说,但我认为在您所描述的前端/后端"术语中,Web/Worker体系结构可能会过大.您的Web层完全能够同时运行Web服务器和应用程序服务器.但是,如果您需要后台处理或异步处理,则添加工作程序层可能很有意义.

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.

这篇关于AWS beantalk中的工作层和Web层有什么区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆