question

Kman-9406 avatar image
0 Votes"
Kman-9406 asked Kman-9406 commented

Storage Queue with Web App and Azure SQL Database

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-webappsazure-sql-databaseazure-functionsazure-static-web-apps
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

MikeUrnun avatar image
0 Votes"
MikeUrnun answered Kman-9406 commented

Hi @Kman-9406 - 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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@MikeUrnun How do I use Azure Durable Function Fan Out and Fan In without using Fan In process. I heard of using Queue trigger function? How does that work?

0 Votes 0 ·
brtrachMSFT-0711 avatar image
0 Votes"
brtrachMSFT-0711 answered

Hello @Kman-9406 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://docs.microsoft.com/azure/architecture/best-practices/auto-scaling
Getting started with auto scaling: https://docs.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.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.