Storage Queue with Web App and Azure SQL Database

Kman 41 Reputation points
2021-05-21T20:45:10.537+00:00

Hi There.

I want to use Azure Web App and I want the content of the data to be in a message queue and then load the JSON into Azure SQL via Azure Function (Fan out Fan In) is this possible. Can the storage queue contain JSON data?

If not, what is the best approach? How can I have Web App and Azure SQL Database scale when the traffic is heavy there is likely to be over 100 people users at one time and I am worried how this will impact the Web App and Azure SQL.

Azure SQL Database
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,200 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,812 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
755 questions
0 comments No comments
{count} votes

Accepted answer
  1. Mike Urnun 9,641 Reputation points Microsoft Employee
    2021-05-25T23:40:54.897+00:00

    Hi @Kman - You're certainly on the right path and your design seems pretty close to the architecture guidance given here: Scalable web application

    I did want to add a couple of points though:

    • After a fan-out/fan-in pattern is run, you're left with an aggregated result. Instead, a simpler stateless function app might be a better fit?
    • The size of the message payload is limited at 64KB with Storage Queues and the Service Bus Queues have the limit of 256KB, and as such, your JSON payloads will probably exceed them. If this is a pain point, I recommend reviewing a Claim-Check pattern and utilizing a persistent store when dealing with large messages.

1 additional answer

Sort by: Most helpful
  1. brtrach-MSFT 15,171 Reputation points Microsoft Employee
    2021-05-26T04:22:54.257+00:00

    Hello @Kman to add to what Mike shared, in regards to scaling of the web app, you should consider setting up auto scaling rules. These rules can be based on one or more variables and once the variable is crossed, it'll add additional instance(s) for your web app in order to meet the growing traffic. Once the traffic slows down, it'll auto scale back down to keep costs manageable.

    You'll need to determine what variables spike when your site usage/visitors increase. Will it spike CPU, memory, or another variable? Once you have that determined, please read through the below documents, which lay out how to set up auto scaling so your site can handle increases/decreases in visitors.

    Best practices for auto scaling: https://learn.microsoft.com/azure/architecture/best-practices/auto-scaling
    Getting started with auto scaling: https://learn.microsoft.com/azure/azure-monitor/autoscale/autoscale-get-started

    Please let me know if there are further questions regarding auto scaling of the web app.

    0 comments No comments