Hey friends, did you know thatthere is a wealth of messaging options in Azure from Service Busand events, IoT Notification Hubs and more.
That huge amountof services provides a lot of power for your application andAzure Barry is going to help me understand at all.
Today on Azure Friday.
Hey friends, I'mScott Hanselman.
It's Azure Friday.
I'm here with AzureBarry and we're going to learn about choosing Azure Servicesfor working with messages in your application.
How are you, Sir? Very good.
I've always enjoyedlearning from you and your very excellent slides and demos.
Thanks for spending time with me today.
What do you have? Well, again as you is very verybig, uh, and today we're gonna try and.
Figure out how tochoose the services for working with messages in yourapplication, so there are lots of options.
Obviously forworking with messages and what I mean by working with messages isthat you work with small pieces of data that you want to sendfrom your application to another application.
An example can beyou place an order on your website and you then make amessage of that little order and put it on a Q So that it can beprocessed later.
So you offload it.
Lots of other use cases for that as well.
So let's firsttake a look at all the options that there are for working withmessages in Azure.
First one is Azure storage queues, which is aqueuing mechanism like I just explained.
Second one is AzureService bus queues, which is the same functionality is also a Q, But it has different specifications and I'll explainwhat the differences between the two.
In later slides.
There'salso Azure service bus topics, which is also a Q but slightlydifferent where you have Azure Service bus queues, you put amessage on the Q and one application takes it out forprocessing.
In Azure Service bus topics you put a message on theQ and then multiple applications.
You can take that message.
Well off the queue for processing.
And they also haveAzure notification hubs which you can use to send pushnotifications like the ones you get from Facebook and all theother applications on your phone.
But then with Azurenotification hubs it makes it simple to send just one messageto notification hubs and it can send it to Android, iOS, windowsand all sorts of other platform network notification serviceswithout you having to write the plumbing to actually talk tothose notification services.
So Azure event grid which allowsyou to subscribe to events and then push those events tosomewhere.
So for instance, you could subscribe to an event inyour Azure storage when Blob gets uploaded, and then use thatevent to for instance kickoff and Azure function to process something.
Then there's alsoAzure event hubs, which you can use to ingest massive amounts ofmessages and then push them off to be analyzed.
A similarservices Azure iot hubs which is also allows you to take in a lotof messages and then have them analyzed, but Azure Iot up isdifferent from Azure event hubs in that it can also communicateback so it has by be directional messaging.
As in if you haven't.
Iot device, you can receivemessages from that iot device, but you can also send messagesto that iot device and for instance reset it or shut it off.
And then there is AzureLogic apps, which is actually one of my favorite services, isso easy to use and you use it to create processes in Azure.
Sological steps that are started from an input like a blob gotuploaded or a tweet cut sent and then finally there's the Azuresignal R service which you use to connect clients together inreal time and send messages to each other.
An example of using this.
Could be where you have anauction application and then when the price for a certainitem changes you can use Azure signal our service to updatethat price on all the clients on mobile, on web, on desktop, onyour screen, whatever in real time in the exact same time sothat the price is always up-to-date everywhere.
Now theseare a lot of services that is a lot.
That is a lot.
Yeah, I'mgoing to help you to make sense of this and to choose which onesyou need.
In which scenario because they all have a reasonlike that.
Seems like a lot.
It seems overwhelming.
It seemslike a cafeteria full of options that they all have a reason toexist.
Absolutely yeah, there is some overlap here and there, butlet's just let's see so messages like I said, are pieces of datathat you use to convey something to applications or services.
Now messages can be messages ofintent, which are usually commands.
So you send a messageto an application to do something you want.
Something to happen like.
You want toincrease the temperature on a thermostat for instance.
So yousend a message and you could get a message back for this servicesin Azure that you can use for this type of message is sointent messages are storage queues and also service busqueues and topics.
So you can put a message on there andsomething can happen in an Azure function, let's say.
IOT hub andlogic apps work also very well for this scenario and alsosignal R can be used for intent messages with commands.
Now another type of messages isfacts, so we have intense and facts and facts common, twodifferent styles and one is in discrete data, so singular factit doesn't happen continually.
It can happen often, but notcontinually, and could be something like the door opendoor, a door closed and you want to convey that to anotherapplication or service and you could choose as you event quitfor this.
For instance, to subscribe to this fact and thensend it to somewhere else to be processed.
Or as your signal ourservice, like in the example of the auction service, where thenthe discrete fact that happens is that the price change, forinstance, and that you want to update that on all the screens.
You can also use notification hubs to then push this event orthe fact of this message to phones, for instance as a push notification.
So another type offacts is a stream of data that can be a lot of facts, which isusually a continuous stream of data which is related to eachother, like for instance temperature data in atemperature sensor that sends temperature data every secondsto your application, 23 degrees, 23 degrees, 23 degrees, which isnot very useful, but in relation to each other that the data isuseful because when a change happens and you can say Well, the temperature went up.
Or it went down and a stream ofdata or facts you can process with Azure event hubs, which isperfectly capable to ingest a lot of messages like this andthen send it out for Analytics.
And also if IOT hub switch doeskind of the same thing, but like I said is be directional, so youcan also send messages back to your devices when you figurethis out.
You might also have questions about storage cubesand service bus queues if you end up there.
Uh, to see what the differencebetween the two is, let's just dive into that.
So storagequeues versus service bus queues.
They're both Q Services, which kind of do the same thing.
You put a message on there.
Another application takes it off and process is it.
In the caseof an Azure service bus queue, iMessage lives potentiallylonger than Seven days.
And you can also guarantee theorder in which messages come in and are read by applicationsthat process it.
There is features like duplicatedetection and your message size is 1 megabyte at most.
Now Azure storage queues.
Theyhave a message lifetime of a maximum of Seven days, so notlonger and the queue size of storage Q can be very large, larger than 80 gigabytes, where service bus queues can only be80 gigabytes, which is still pretty large.
Storage cubes comealso with transaction logs, which is actually a feature ofAzure Storage, where storage cubes is then a feature of Azurestorage and their message size is 64 kilobytes at maximum.
Nowif you ask me, the biggest difference between these isAzure service bus queues is a more fancy Q with a lot morefeatures, whereas you storage queues is a very simple cubethat you just use if you want the basic functionality of a Q.
Let me just show that quickly inthe Azure Portal, because that might make this a bit more.
Lively here in the Azure portal, I have a storage account, just this one which has cues which wecan see here.
And here is one of those cuesalready.
It's a very simple thing you can see here that Ican just add a message with text.
And and exploration, andthat's all.
It's very simple.
And here is a service bus.
And this service bushas queues and topics.
And here is one of those cues.
And if I create a Q, You can already see that I haveduplicate detection, that lettering or messageexploration, which means that messages that expire becausethey aren't red are automatically placed in anotherQ and we have all sorts of other more advanced functionalities.
And then there's also topicswhich are basically the same mechanism escus, but themain difference here is that topics have subscriptions.
And subscriptions are thenthings that other applications can use, ormultiple applications can use to subscribe to discu, sort of through the topic to get messages that they'reinterested in.
These aren't loading, but as youcan see a subscription then is also a Q and has these moreadvanced features like dead letter subq as well.
That seems a lot moresophisticated, like there's a lot more opportunities to bakethe business logic of the movement of these things fromplace to place into Azure itself, and you don't need to dothat work in your application.
It is absolutely so.
It dependson your needs.
Obviously there's also a price component in hereas well, and size component of messages as well.
So it dependstotally on your knees needs.
But like you said, your service busqueues are more sophisticated in Azure storage queues.
Yeah, andthe idea being guaranteed ordering also seems like a veryvaluable feature.
Yeah Yeah, but not.
Not everybody needs that of course.
So let's compare thesemessaging options.
We had service bus queues and I alsoput storage queues in here as well.
Service bus topics, eventcreate event hubs, iot hub, notification hubs, logic appsand signal R.
So if you want to send a messageto make something happen like we just seen, we can use servicebus queues and also storage queues.
Also service bus topics, iot hub's logic apps and signal our services if you want tosubscribe to and publish discrete events, then you canuse the event grid and also notification hubs.
So thesediscrete events, these facts that just happen occasionally.
And also signal our service inthe example of the auction application.
And if you want toanalyse contextual data in bulk soda stream of factual data thenyou could choose event hubs.
And then for more specificscenarios, if you want to send a message to just one subscriber, then you would use the QS or service bus and storage Q.
Andif you want to send the message to multiple subscriber, youwould use the topics.
But then you could also use all of theother services which can basically send messages or havemultiple applications process the messages that they receive.
If you want to orchestrate amessage driven workflow so complete process you use logic apps.
And if you want to receiveand send messages to iot devices, which is very specific, you use iot hub.
And then finally, if you want tosend notifications too many devices over different protocolsto, for instance, Apple iOS, Android and Windows platformnotification services without having to write all of theplumbing to do so, you would use Azure notification hubs.
So these filtering that we'vejust seen and these questions that you see here, hopefullythey help you to make sense of all of the services in Azurethat you can use for messaging in your application.
And certainly you can use thesetogether, right? So notification hubs for mobile devices to senddiscrete events, too many devices over different protocolsthat might have been created by or sourced by something thatstarted in started in service bust moved its way through eventhubs and then eventually into notification hubs.
Is thatright? Oh, absolutely I have many solutions that have most ofthese services actually working together in there.
Yeah and thenuse these different scenarios because sometimes all of these scenarios.
Are true for just onesolution.
That can definitely true.
Fantastic, this is areally good overview in a great table.
Yeah, so if you want tolearn which others Azure services there are, you can goto this URL which shows you all of the Azure services, notonly the messaging services.
Fantastic, I appreciate youdoing that Azure Berry.
I'm learning all about the wealthof messaging options that are available to me on Azure andAzure berries.
Just demystified a bunch of themfor me today on Azure Friday.