0

I have looked around a lot to wrap my head around the concepts, and now I need to present my plan for some review.

I will create a cloud service that receives notifications from, and consumes REST services of a web API of another company.

The data is processed on behalf of the users that registers on my site. So they make some settings and leave the site. The cloud service now starts to process retrieved data and act upon the web API - some data will be stored for presenting to users.

I'm counting with some thousands to a couple of hundred thousands of notifications per day. Maybe more later. A few hundred users, maybe rising to 1000+ and more later.

So, I'm thinking like this:

Web role:

  • Makes up the front end, takes care of the user managing it's settings and displaying data.
  • stores user credentials and settings in a SQL Database.
  • Also provides the admin UI for managing all users.
  • receives notifications from the web API (containing DTO with data, maximum 20-30 attributes of datatype string mostly), and relays it to a worker role.
  • stores data about the notifications in one (or two) Azure Tables (table 1 and 2).
  • queries these tables (and table 4) to give "mouse over"-data-displayed to users in the web UI.

Worker role A:

  • Receives the relayed notifications from the webrole, evaluates type of notification and:
  • either makes request to REST API for more data or:
  • async'ly puts notification DTO into an Azure Table (table 3) for Worker role B to work on.
  • frequently pops an Azure Queue for jobs created by worker role B, and POSTs to the REST API.
  • stores data about the POSTs in another Azure Table (table 4)

Worker role B:

  • Frequently reads table 3 for notifications with their DTOs
  • Depending on the type of notification, constructs a query with the data in the DTO, queries the SQL Database and retrieves matching user settings, makes evaluations and construct jobs to be put on the Queue, for Worker role A to pop and POST.
  • putting some remaining (not completed) jobs to be continued in another round, in a fifth table (table 5).

This is pretty much the whole thing.

I'm thinking to let the notifications be managed by XSockets.NET, because I think SignalR requires Windows 8, or am I wrong here?

My questions:

  1. Should I use a Service Bus Queue for communication between Web role and Worker role A? Or maybe an internal endpoint? Or a Queue? I'm thinking that constantly polling the queue is unnecessary load, but a ping every second maybe isn't much of work anyway?
  2. Will Service Bus Queue maintain the real time character of the notifications being sent, or will it slow down things?
  3. Can Worker role A be merged with the web role without risking thread dropped by IIS?

The whole thing is pretty much working like this Azure tutorial, where they obviously deem it necessary with 2 worker roles and a web role for that simple task.

Thanks in advance, any tips and clarifying directives are appreciated!

right_there
  • 175
  • 1
  • 1
  • 11
  • 1
    While this is an opinion-based question and will likely be closed, let me suggest you take a bit of time to study up on web/worker roles. They're just virtual machines. Any code that can run in a worker role can run in a web role. And... since you need a minimum of one instance for every defined role, your architecture will consume a minimum of 3 VM instances. Which is fine, if that's ok with you. You'll need to decide whether this is reasonable, or if you should combine functionality into two roles, or even just one role. – David Makogon Mar 23 '14 at 16:29
  • Thank you for your answer. Tried to remove questions that were opinion-based, hoping that I can get directives. Three roles is fines if that's what it takes. The two worker roles are doing kind of the same thing as described in this tutorial: http://www.windowsazure.com/en-us/documentation/articles/cloud-services-dotnet-multi-tier-app-storage-1-overview , and even a bit more. So cutting down on roles would maybe be done by letting the web role take over the duties of worker role A or B? – right_there Mar 23 '14 at 17:07

1 Answers1

0

1- internal endpoint would be usefull if you're hosting a WCF in your worker role, so using queues for communication between roles is the way to go I have used many times myself.

2- No it won't slow things down

3- there is a risk no doubt but it is worth a try.

Robert
  • 5,278
  • 43
  • 65
  • 115
Coder1409
  • 523
  • 4
  • 12