In this Course, you will learn about Microsoft Azure, one of the main cloud service vendors.
Now that we have a good idea of what services are available in Azure, let's see how we can put them together to create a more complex solution. One of the best ways to get started is to look at the examples in the Azure Architecture Center. If you click on reference architectures, you'll see some recommended architectures for particular types of solutions. You can also check out these example workloads for specific business and technical challenges. I'm going to walk you through this e-commerce example.
The scenario in this example is that we need to build an Azure-based solution for customers who want to buy concert tickets. The diagram they use is a bit confusing, so we'll use our own.
The first service we need to use is Azure App Service because it's the easiest way to host a web app. To buy concert tickets, our customers will connect to our website, which will be hosted on Azure App Service.
The website won't be able to do very much, though, until we add more services. For example, it would be pretty difficult to have a continually updated list of concerts without using a database. We could connect our website to a variety of databases, such as MySQL or Cosmos DB. But the most obvious choice is to use Azure SQL database. We can store concert information there and then have a list of upcoming concerts appear on the website.
If we're going to have a lot of concerts to choose from, then we should also allow customers to search for specific concerts. Azure Cognitive Search is a good choice for that. It indexes your content so it can provide quick responses to search queries.
Next, we'll want to give customers the ability to purchase tickets. This example solution for Microsoft doesn't include the actual payment handling part of the transaction, but it does include a couple of the important pieces. First, we'll want to give customers the option to create an account so they don't have to re-enter their information every time they use our app to purchase tickets. The good solution is to use Azure Active Directory, B2C. The B2C stands for business to consumer. It provides everything you need to handle authentication for people outside of your organization.
When we receive custom orders, we should put them in a queue. Then we can have a separate component that pulls orders from the queue and processes them. This is one of the best ways to pass data from one component to another because it makes applications more reliable and scalable. Even if a component goes down, the data will be buffered in the queue until that component comes back up. Microsoft has a special type of storage to handle this need, and it's called, not surprisingly, Queue Storage. It scales up and down as needed.
To retrieve orders from the queue and process them, we can use an Azure Function. The function will be triggered automatically whenever a new item is added to the queue. The function then creates a printable concert ticket for the customer. When it's done, it stores the ticket in Blob Storage, which is the perfect place for image files. The ticket will then be sent to the customer, although that's not shown in this example app.
Okay, now we have a complete solution (other than the couple of missing pieces that I mentioned), but we can add more functionality to our app. Another feature we can add is to allow people to post a review after they've seen a concert.
This can be handled in a similar way to the order processing feature. We'll add new concert reviews to another queue and have an Azure Function that retrieves those concert reviews from the queue. And then it will store the reviews in SQL Database so they can be displayed on the website.
All right, now we have all the functionality we need, but we can add some more services to make our app better.
First, we can add Azure Cache for Redis and use it to cache concert information. This will make searches faster when customers are looking for concerts.
Another important way to make our app faster is to use the Azure Content Delivery Network. It'll cache our website static files, so they'll come up faster when customers access our site.
Yet another way to improve responsiveness is to use a service called Azure Traffic Manager. If we create multiple copies of our web app and host them in different regions around the world, then we can configure traffic manager to serve each customer from the web app instance that's closest to the customer on the internet. So now not only do they get the static website files from the closest point on the content delivery network, but they also interact with the web app using the nearest instance.
To ensure that our app is functioning properly, we can use the application insight service. It takes care of monitoring the app and alerting us if there are issues. It also provides us with analytics to help diagnose issues and to understand how users are interacting with our app.
Finally, if we want to automatically classify concert reviews as positive or negative, we can use the Text Analytics component of cognitive services. We'll have an Azure Function that runs a sentiment analysis on each concert review and then updates the concert review in the database to show whether it's positive or negative.
That's a lot of services for one application. So how much will everything cost? Thankfully, Microsoft provides sample pricing on the solution example page. It even has options for small, medium, and large implementations, depending on how much customer traffic we think we'll get. Let's try the medium option, which can handle up to 100,000 users per month.
This brings up the pricing calculator, which is a really handy feature for estimating the price of nearly any Azure service. I'm going to click the "Collapse all button" so we can see a summary of all the costs. The total is up here. It's around $900 per month for everything.
If you look through the breakdown of the price, you might be surprised to see that app service is not the number one cost on this list. Considering that it hosts the core application, it seems like it should have the highest cost. But actually Azure Active Directory, B2C, and Azure Cognitive Search are higher. That's a bit misleading, though, because this pricing example only includes app service hosting in one region. If we want to host the app in multiple regions and use traffic manager to make it more responsive for users around the world, then we'll pay at least this much for each region, which would easily make app service the most expensive component.
And that's it for designing a solution.
A world-leading tech and digital skills organization, we help many of the world’s leading companies to build their tech and digital capabilities via our range of world-class training courses, reskilling bootcamps, work-based learning programs, and apprenticeships. We also create bespoke solutions, blending elements to meet specific client needs.