Can Azure Service Bus topics be used as an event source or is there a better hosted service on Azure for this? - event-sourcing

Can Azure Service Bus topics be used for event-sourcing?
At first sight it seem to be a good fit, but have anybody tried it? Can anybody confirm that keeping events forever in the Azure Service Bus topic is working well?
Or is there a better hosted service on Azure for this?

Do you mean in the sense of Event Sourcing?
Wouldn't recommend it. Service Bus has a maximum queue/topic size and is designed to be dequeued. Arguably you could design your replay logic as a dequeue-all and re-queue to retain the application state, but this is definitely not the intention of the product.
It also as far as I am aware has no notion of geographic replication, although the storage behind service bus itself is resilient within the data centre. For maximum redundancy I'd choose a storage technology that supports replication away from the primary data centre.

I'm also interested in that topic and from the outside it looks like Azure Event Hubs is the right service for that.

Related

Using Azure Event Grid for event-based communication between microservices

I'm looking to implement a event-based communication pattern between my microservices and I'm looking to use Azure Service Bus to handle the messaging. In the examples I've seen so far (e.g. Microsoft's eShopOnContainers) the events are handled by a common library that handles the event subscription/publishing. I'm wondering if the common library could be replaced with Azure's Event Grid service (I realise this could generate an opinion-based answer, so please remove this question if it is deemed so)?
I like how Event Grid has retry capabilities, receives events from Azure Service Bus, push-like functionality (meaning my microservice doesn't need to poll), as well as other features, so in my mind it seems like a good fit. However, I'm fairly new to the event-based communication concept so I'm well aware I could be missing something.
If Azure Event Grid could be used to handle the events, is it possible to send the event to a Web Api endpoint? Once again, the examples I've seen so far all send the event to a Azure Function trigger, but I'm not planning on using any Azure Functions for my microservices.
If anyone had any examples they could point me to where Azure Service Bus and Event Grid were used for communication between microservices, that would be appreciated.

Difference between saga and service bus?

Upgrading skills from Azure Service bus to Rabbit MQ + Mass Transit. Please bear with me.
I have convoluted understanding in mind about Saga and State Machine (Automatonymous). Are they synonym of each other.
Does the name SAGA originates from integrated state machine functionalities
in service bus? Can we say Saga is superset of service bus?
As Azure does not have integrated state machine in their service bus.
In my opinion, Sagas are use for the transactions, for example among microservices, to maintain consistency between them.
You have applied the Database per Service pattern. Each service has
its own database. Some business transactions, however, span multiple
service so you need a mechanism to ensure data consistency across
services. For example, lets imagine that you are building an
e-commerce store where customers have a credit limit. The application
must ensure that a new order will not exceed the customer’s credit
limit. Since Orders and Customers are in different databases the
application cannot simply use a local ACID transaction.
Reference: http://microservices.io/patterns/data/saga.html

Azure Resource Manager: The Future of Cloud Services

I am currently working heavily in Azure. I am actually quite fond of ARM (Azure Resource Manager) right now and would love to keep using it. Right now in the old portal, We have a lot of resources tied up as Cloud Services. Now, I know cloud services are available in the new portal, but it seems that Microsoft is moving away from the classic cloud service model. Can someone explain if this is true? If so, what will the new model look like? I already use resources groups to manage Websites (WebApps), so I assume this is where the azure future lies. Will we see the "deprecation" of cloud services on down the line?
I am trying to understand if I need to begin re-structuring my Azure Infrastructure.
Any insight, explanation, or documentation is greatly appreciated.
So there are two things here - Cloud Services and managemenet of Cloud Services.
When you manage Cloud Services in current portal the underlying mechanism used is Azure Service Management (ASM) where as it is Azure Resource Manager (ARM) in the preview portal. To me, ARM is the new way of managing your Cloud resources in Azure (including Cloud Services).
I don't work for Microsoft so I would not know if Cloud Services themselves will be deprecated down the road or not but one thing I think will happen is that ASM will be deprecated in favor of ARM. At some point of time, the only option you will be left with managing your cloud resources will be through Azure Resource Manager. One example that makes me believe this thing is the presence of Classic resource providers (e.g. Classic Storage Resource Provider which enables you to manage storage accounts created in current portal via ASM in the preview portal which works exclusively on ARM).
Personally I can't see a place for cloud services in the new ARM world of Azure. I have always found them a convoluted concept that simply added complexity to a deployment.
In the ARM view of deployments servers are collected together in a VNet, and each server is attached to a Nic which in turn can be connected to the internet. A security group then takes care of ingress / egress rules.
This is a much cleaner deployment method, as it puts connectivity configuration at the server layer instead of mapping them all through a higher layer of abstraction.
I don't see the place of cloud services in ARM, however after a quick search it seems that there is a plan to implement it
Still no direction from the Azure Advisers group other than officially they will not drop support for Cloud Services. I think they are nearing giving us some kind of direction but I can't say anymore than that.
I asked a question about the future of Cloud Services on the recent Azure Compute AMA.
You can read the answers directly on Reddit for all details, below are a few interesting quotes (emphasis mine).
On ARM Integration for Cloud Services:
We are looking at ways to make the transition to ARM easier for Cloud Service customers- one of those options includes CS integration in ARM. This investigation is in the very early stages though, so if you are looking for a solution soon, check out VMSS/ACS/SF/Web Apps (meagan-msft)
And:
I think it's safe to say that if we make any significant investment in CS in the near future, it would be ARM integration, and as Meagan suggests, that's still in planning. Beyond that, there are no major feature improvements on the horizon. We believe the platform is pretty mature at this point. (seanmichaelmckenna)
So it doesn't look like any major innovations will hit Cloud Services soon, however:
Cloud Services are not going anywhere. In fact, many Microsoft services run on Cloud Services, so we heavily rely on them as well. They are fully supported, so feel free to continue to use them.
(meagan-msft)
For those who want to switch to a different Compute service, these recommendations were made:
However, if you would like to check out other services that are integrated with ARM today, we recommend checking out the following:
Web Apps for customers who want a fully managed platform and are building traditional web applications
Service Fabric for customers who want an opinionated application platform and managed infrastructure, but still need some control over the IAAS layer
VM Scale Sets for customers who need IaaS-level control with easy scaling, autoscale and load balancer integration
Azure Container service was also listed as a potential alternative.
Some things to consider (my understanding):
Service Fabric currently (2017) requires at least 5 VM instances, except for dev/test purposes. So probably only an option for larger services
VM Scale Sets is an IaaS offering, i.e. you have to manage OS updates etc. yourself. However, support for automatic OS updates is being worked on.

How would you implement instant messaging on Windows Azure

Hi we are thinking to implement a chat feature in our web app. (MVC 3 running on Azure) like Facebook or Gmail applications.
So the idea about this question is to have your technical architecture opinion about it.
How would you design it and which services you would use (worker role, queue, blob, Sql azure etc.).
Thanks
Instant Messaging is about asynchronous delivery of messages between multiple publishers and subscribers. This sounds like a perfect recipe for Azure Queues.
If the number of users who will use this feature is small, you can create a queue per recipient. Web-app would drop a message onto the recipient's queue and would check queue of its own user.
The positive about this approach is its simplicity The downside of this approach is the frequency of checking the queues per user and the cost associated with that.
If you have 10,000 users logged into IM and the app is checking their queue's once per second, that's 1penny per second. Which translates to ~$26k/month.
Windows Azure Service Bus provides Publish-Subscribe messaging with Topics that can be used for this scenario. You can see a Silverlight based Chat sample for this: http://servicebus.codeplex.com/SourceControl/changeset/view/9715
In addition you can see a Multi-tier app sample that shows using Service Bus Topics/Subscriptions from Web/Worker roles here: http://code.msdn.microsoft.com/windowsazure/Multi-Tier-application-6c033cad

Event Aggregator for Distributed Applications

I am implementing an application using Prism.
The application has a few distributed components that resides on various machines or servers. In order to communicate them, I am planning to implement messaging service using Event Aggregator. But before I start working on that I would like to have a few clarifications:
Can Event Aggregator be used on a distributed environment. If yes
than how to define the server or hub where the message would be
published or subscribed?
What is the performance impact on the applications using Event
Aggregator? I feel it is negligible but still I would like to know.
Is Event Aggregator approach is good for future expansion in an
enterprise environment?
Thanks and Regards,
Ashish Sharma
PRISM is client-side technology. So, EventAggregator as it is won't do what you need. This is mechanism to communicate between modules in a loosely-coupled way. It is not about communicating between different clients.
For what you need - I would look into HTTP Polling Duplex
http://www.devproconnections.com/article/silverlight-40/using-http-polling-duplex-in-silverlight-applications
If you use PRISM on front end - you can write your own service and subscribe/publish EventAggregator events from that service while making server calls and receiving responses back.

Resources