Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Worker Role vs Web Job

From what I understand both run small repeatable tasks in the cloud.

What reasons and in what situations might I want to choose one over the other?

like image 662
atreeon Avatar asked Sep 13 '14 16:09

atreeon


People also ask

What is the difference between web role and Worker role?

The only difference between the two is how your role is hosted on the VMs: Web role: Automatically deploys and hosts your app through IIS. Worker role: Does not use IIS, and runs your app standalone.

What is a worker role?

What is a Worker Role? Worker Role is any role in Azure that runs applications and services level tasks, which generally do not require IIS. In Worker Roles, IIS is not installed by default.

What is a web job?

Overview. WebJobs is a feature of Azure App Service that enables you to run a program or script in the same instance as a web app, API app, or mobile app. There is no additional cost to use WebJobs. You can use the Azure WebJobs SDK with WebJobs to simplify many programming tasks.


1 Answers

Some basic information:

WebJobs are good for lightweight work items that don't need any customization of the environment they run in and don't consume very much resources. They are also really good for tasks that only need to be run periodically, scheduled, or triggered. They are cheap and easy to setup/run. They run in the context of your Website which means you get the same environment that your Website runs in, and any resources they use are resources that your Website can't use.

Worker Roles are good for more resource intensive workloads or if you need to modify the environment where they are running (ie. a particular .NET framework version or something installed into the OS). Worker Roles are more expensive and slightly more difficult to setup and run, but they offer significantly more power.

In general I would start with WebJobs and then move to Worker Roles if you find that your workload requires more than WebJobs can offer.

like image 80
kwill Avatar answered Nov 08 '22 18:11

kwill