Develop Message-based Solutions Flashcards
Azure Queue Storage
High level, what would a message based architecture look like?
(1) User Sends Order
(2) Message received by Order Queue
(3) Order Fullfillment Service recevies messages and processes
(4) Message send to Post-Order Queue
(5) Analytics Ingestion Service
Azure Storage Queue
Benefits of a message-based architecture
(1) Encourages application logic modularity
(2) Enables fault tolerance between modules
(reduces data loss)
Azure Storage Queue
Define the Azure Storage Queue
A fully-managed service that is a part of the Azure Storage suite that enables you to create durable and configurable message queues to enable application modularity and fault tolerance
Azure Storage Queues
What are the capabilities of the Azure Storage Queue?
(1) Requires an Azure Storage Account
(general purpose v2)
(2) Queues are created within a single storage account
(3) Supports messages up to 64 KiB in size
(4) Number of messages limited only by size of the storage account
(5) Supports a configurable time-to-live per message
(default is 7 days)
Azure Storage Queues *
What are the data redundancies?
(1) Locally Redundant Storage (LRS)
(2) Zone-Redundant Storage (ZRS)
(3) Geo-Redundant Storage (GRS)
(4) Geo-Zone Redundant Storage (GZRS)
(5) Read-Access Geo-Redundant Storage (RA-GRS)
(6) Read-Access Geo-Zone-Redundant Access (RA-GZRS)
Zone means data is stored in more than one data center within a zone
Azure Storage Queues
Security Features in Azure Storage Queues
(1) Data in queues is encrypted by default
(2) Azure Storage stored access policies can work with queues
(3) Interactions with queue data via HTTP or HTTPS
(4) Supports the following authorization approaches
(a) Shared Key
(b) Shared Access Signature
(c) Azure AD
Azure Storage Queues
What is the Visibility Timeout?
Messages are delivered to consumers, butr are not immediately deleted from the queue. However, messages will not be visibile in the queue until a period of time has passed from the initial delivery.
Messages delivered to the consumer are not immediately deleted from the queue.
Azure Storage Queues
Scalability (queue, message, message support)
(1) Single queue < 500 TiB
(2) Single message cannot exceed 64 KiB
(3) No more than 5 access policies
(4) A storage account can support up to 20,000 messages per second
(based on 1 KiB message size)
(5) A single queue can support 2000 messages per second
(based on 1 KiB message size)
Azure Storage Queue
How to Create, Delete, View, Delete all messages a Storage Queue using Azure CLI
Create a Queue
az storage queue create –name $myqueue
Delete a Queue
az storage queue delete –name $myqueue
**View Messages **
az storage message peek –queue-name $myqueue
Delete All
az storage message clear –queue-name $myqueue
Azure Service Bus
Definition of Azure Service Bus
Full managed enterprise message broker service that enables multiple modes of messaging with integrations for common messing systems including Java Message Service (JMS)
Types of Azure Service Bus Messaging
(1) queue
(2) Topics
Azure Service Bus
Features of Azure Service Bus
(1) Supports both HTTP/HTTPS and AMQP protocols
(2) Includes messaging for both queues and topics
(3) Supports 3 different tiers
(basic, standard, and premium)
(4) Supports advanced Configurability
(Ordering, Batching, DLQ or Dead-letter queue, and duplication detection)
Basic tier DOES NOT support Topics
Azure Service Bus
What are some key differences between Standard and Premium Tiers for Azure Service Bus?
(1) Pay as you go vs. Fixed based on messaging units
(2) Throughput is varialble vs Throughput is fixed based on messaging units
(3) Shared vs dedicated resources
(4) Auto scaling vs configuration of scaling
(5) 256 kb vs 1 mb messages
(6) No support for geo-disaster recovery or availability zones
Azure Service Bus
URL Makeup
Azure Service Bus
Message Ordering
Azure Service Bus supports FIFO ordering by leverage sessions. This is supported in queue and topcis but must be enabled on the queue or topic
Azure Service Bus
Differeances in Scaling between Standard and Premium
(1) Standard supports partitioning on Queues and Topics
(2) Partitioning not supported on Premium
(3) Partitioning enables seperate messagings stores and brokers for a single entity
(4) Can use partition keys to determine partition
(5) Without a partition key, a round-robin algorithm is used by Azure
(6) Transactions on a partitioned entity must use a partition key
Azure Service Bus
What is the DLQ
Is supported in both Queues and Topics. This enables you to capture messages that were not processed during their lifetime, and act accordingly with those messages.
Can also configure notifications to inform of messages in the DLQ
Azure Service Bus
Select a message solutions between Storage Queue and Azure Service Bus
Storage Queue
(1) Total needs > 80GB
(2) Logs needed for all transactions execute again the queue
(3) Need to track progress of message processing
(4) Messages are not more than 64 KiB
Azure Service Bus
(1) Needs support for receiving messages withoug polling (with AMQP 1.0)
(2) FIFO
(3) Duplicate detection
(4) Message support up to 256K (compared to 65 KiB)
(5) You need to support topic based notifications (one to many)
(6) Need to publish and consume in batches
Azure Service Bus
Create a Service Bus Queue and Delete in Azure CLI
Create the Namespace
az servicebus namespace create –resource-group $rg –name $ns –location $loc
Create a Queue
az servicebus queue create –namespace-name $ns
Delete a Queues
az servicebus queue delete –namespace-name $ns
Currently the CLI doesnt have a way to view message like Storage Queues
Azure Service Bus (following will most likely be covered within exam)
Explain the importance of Topics in Service Bus
(1) Enables a one-to-many relationship between messages and consumers
(2) A consumer creates a subscription to a topic
(3)** Subscriptions act as a dedicated queues for a subscriber with the configurtation options **
(Really act with the subscription and not the topic directly)
(4) Topics can be filtered by
(a) Boolean Filters
(b) SQL Filters
(c) Correlation Filters
Azure Service Bus
Azure CLI commands to create a Topic
Create a Topic
az servicebus topic create –namespace-name $nsname –name $mytopic –resource-group $rgname
Delete a Topic
az servicebus topic delete –namespace-name $nsname –name $mytopic
Create a subscription
az servicebus topic subscription create –namespace-namce $nsname –name $mysubscription –topic-name $mytopic