Multiple Web Roles on Azure

117 views
Skip to first unread message

Rafel

unread,
Apr 26, 2012, 11:08:40 AM4/26/12
to nodejs
Hello All,
I am a newbie to node. right now i am trying to create a web app using
node and deploying it on Azure. My idea is to create a website which
has simple tabs on menu bar and each tab open a new functionality e.g.
one tab gives me grid view, other give me email functionality, other
is for chat etc.
So my question is do i need to create multiple web roles in this case,
or combination of web roles and worker roles. How it goes?? give me an
idea.

I appreciate any help.

Thanks.

Ryan Schmidt

unread,
Apr 26, 2012, 4:07:57 PM4/26/12
to nod...@googlegroups.com
I must admit I have no idea what your question is. What is a "web role"? What is a "worker role"?

I think the answer is probably: node.js lets you program whatever you want to, so go and do it.


Angel Java Lopez

unread,
Apr 26, 2012, 4:30:29 PM4/26/12
to nod...@googlegroups.com
Hmmm... I guess you only need a web role with node.js

(I usually find node.js in worker roles, but there are powershell scripts that setup node.js as a web role)

An example at:

You can read that blog with some info about node.js on Azure.

But I a bit confused. Your requirements are not related to web role/nodejs, etc... So I think you can start with the above approach: node.js on web node.

Links I visited/collected about node.js and Azure:

Angel "Java" Lopez



--
Job Board: http://jobs.nodejs.org/
Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to nod...@googlegroups.com
To unsubscribe from this group, send email to
nodejs+un...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Glenn Block

unread,
Apr 26, 2012, 11:37:22 PM4/26/12
to Rafel, nodejs
Hi Rafel

I work on the node/azure team at Microsoft. Whether or not to create
many roles depends on what you are doing. The main benefit of WebRole
is IIS manages your node processes for you. It will spin up multiple
instances. It will monitor memory pressure and kill frozen instances
and restart them. We also provide access to logs over an http endpoint.
Further you can enable node-inspector for server side debugging within
Azure via our IIS integration.

The big benefit for worker is that it is leaner and it supports
WebSockets. In worker IIS is not present. This means there is less in
the box from a management perspective, but you get closer to the metal.
Because they are lighter they are more ideal for background processes
or for serving web apis.

One place where you might do a hybrid is for Websockets. For example
your front end might run in a WebRole with multiple instances while
your backend exposes web apis / uses WebSockets via a Worker.

Another scenario where you might use worker is for hosting an app
server like Redis / Mongo which your web role uses.

That being said, many folks just use one role and you do not have to
use multiple.

Hope this helps.


Sent from my Windows Phone
From: Rafel
Sent: 4/26/2012 8:51 AM
To: nodejs
Subject: [nodejs] Multiple Web Roles on Azure

Rafel

unread,
May 2, 2012, 7:20:43 PM5/2/12
to nodejs
Hello Glenn,
Thanks for the clean description and i understand what you say. Both
roles has their own kind of application where they are implemented.
But i am creating a website in which i want Grid View, Email Service
at some pages and some other parts that are in WebRole, also i have
another node chat application which is implemented in Worker Role. Now
i want to create a complete website which has Grid View, Email Service
and Chat functionality so for this i have to merger Web Role and
Worker Role, I am trying that but it give me error always.

Appreciate your help!!

Thanks.

On Apr 26, 8:37 pm, Glenn Block <glenn.bl...@gmail.com> wrote:
> Hi Rafel
>
> I work on the node/azureteam at Microsoft. Whether or not to create
> many roles depends on what you are doing. The main benefit of WebRole
> is IIS manages your node processes for you. It will spin up multiple
> instances. It will monitor memory pressure and kill frozen instances
> and restart them. We also provide access to logs over an http endpoint.
> Further you can enable node-inspector for server side debugging withinAzurevia our IIS integration.
>
> The big benefit for worker is that it is leaner and it supports
> WebSockets. In worker IIS is not present. This means there is less in
> the box from a management perspective, but you get closer to the metal.
> Because they are lighter they are more ideal for background processes
> or for serving web apis.
>
> One place where you might do a hybrid is for Websockets. For example
> your front end might run in a WebRole with multiple instances while
> your backend exposes web apis / uses WebSockets via a Worker.
>
> Another scenario where you might use worker is for hosting an app
> server like Redis / Mongo which your web role uses.
>
> That being said, many folks just use one role and you do not have to
> use multiple.
>
> Hope this helps.
>
> Sent from my Windows Phone
> From: Rafel
> Sent: 4/26/2012 8:51 AM
> To: nodejs
> Subject: [nodejs] Multiple Web Roles onAzure
> Hello All,
> I am a newbie to node. right now i am trying to create a web app using
> node and deploying it onAzure. My idea is to create a website which

Matthew Hazlett

unread,
May 2, 2012, 7:59:05 PM5/2/12
to nod...@googlegroups.com
I have never used windows azure before, but this sounds like what you are describing, communication between two roles of the same application. 
http://blogs.msdn.com/b/avkashchauhan/archive/2011/10/30/communication-between-windows-azure-roles.aspx

"Only role instances that are part of the same Windows Azure application can communicate with each other and this communication could occur only over ports declared as internal endpoints within your Windows Azure Application."

Glenn Block

unread,
May 4, 2012, 1:34:39 AM5/4/12
to Rafel, nodejs
Hi Rafel

First read this article on multiple apps in the same role:

http://nodeblog.cloudapp.net/hosting-multiple-node-apps-in-the-same-azure-instance

Next for communication between roles there's a few options.

1. Use a queing mechanism like ServiceBus. We include apis for that. I
would recommend that over standard Azure queues

2. Talk direct. You can get the private ip of the other role to talk to
it. We recently released new apis on our azure npm that you can use to
access the azure environment. You can discover the ips of the other
roles and just start talking to them. If you look in our package you
should see a sample and tests around the new role environment stuff.

If it is not clear let me know.

Sent from my Windows Phone
From: Rafel
Sent: 5/2/2012 4:20 PM
To: nodejs
Subject: [nodejs] Re: Multiple Web Roles on Azure

Glenn Block

unread,
May 4, 2012, 1:39:44 AM5/4/12
to Rafel, nodejs
One other thing you might want to check out is a pretty cool project
from my worker.

Github.com/tjanczuk/git-azure
Reply all
Reply to author
Forward
0 new messages