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:
- 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?
- Will Service Bus Queue maintain the real time character of the notifications being sent, or will it slow down things?
- 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!