Architecting Modern Web Apps using Microsoft Azure
I have always been asked this question when I go to customers site. What is the best architecture? How to design an application which is best in maintainability, performance, scale, security, and the list goes on and on. Off late, I’m preparing for my Azure Architecture certification so thought this will be a good thing blog about.
Well there is no best architecture or bad architecture it really depends on what you are doing and how you are architecting your application. Like how you travel or go to a specific destination, there could be multiple paths to reach your target and there could also be multiple modes to reach a destination. Now the question is, if I select a specific mode what is the optimal way to reach a destination. Again optimal is relative terminology for instance I might want to focus on Performance but I really don’t care about security or scale. So there is always a tradeoff between the parameters that you choose. I think I’m talking lot of Gyan here.
Okay let’s focus on some Azure architectural stuff; my intent is to keep an application architecture really simple meanwhile a solid one. So I’m writing my first blog on architecting an application which is an end to end ecommerce application which currently is the new trend in industry which can be developed using various Microsoft Dev technologies in Azure.
Let’s start Vroom Vroom.
Sample E-Commerce Case Study High level Requirements
1. I should be able to view and place an order in my ecommerce application. Let’s take for example the application is built using Asp.Net MVC.
2. My application should send a purchase copy in form of pdf and a text message to customer when he is done purchasing an item.
3. In addition to public facing website, the company also need have a backend web application again built in Asp.Net MVC to view the orders by the technicians and take new orders.
4. I also want an app for my companies delivery guys to keep track of the orders and other details with respect to order.
5. I want to test how my application in terms of how it behaves on peak load. Let’s say on a “Big Super Sale day for my E-Commerce site” or how do I scale the application to cater to the peak load.
6. Find out the performance issues, exceptions and want analytics in the application.
For the moment I want to restrict to this in terms of business requirements. Also, since the company is new we don’t want to focus on the infrastructure but want to put efforts on the core business value.
Okay, so now how would you architect this application?
Like, I said before any functionality can be achieved by multiple paths and modes even this can be architected in many ways. Microsoft Azure makes such tasks of companies life easier by giving the right set of PAAS offerings where you focus on App and Data and nothing else. In Azure we have something called as App services which we will take advantage of to solve this E-Commerce scenario.
Azure App Service lets developers rapidly build, deploy and manage powerful websites and web apps. Build standards-based web apps and APIs using .NET, NodeJS, PHP, Python and Java. Deliver both web and mobile apps for employees or customers using a single back-end. Securely deliver APIs enabling additional apps and devices.
- Web Apps: Create and deploy mission critical Web Applications that scale with your business previously known as Azure Website. Azure App Service Web Apps is a fully managed platform that enables you to build, deploy and scale enterprise-grade web apps in seconds. Focus on your application code, and let Azure take care of the infrastructure to scale and securely run it for you. Web Apps Gallery, Auto Scaling, Continuous Integration, Webjobs are some of top features in Web apps. We can use Web Apps for creating a customer site and Admin site for our operation team using any of the technologies that you love. I prefer Asp.net MVC but its again your choice.
- Mobile Apps: It’s easy to rapidly build engaging cross-platform and native apps for iOS, Android, Windows or Mac, store app data in the cloud or on-premises, authenticate users, send push notifications, as well as add your custom backend logic in C# or Node.js. This was previously known as Azure Mobile Service. So we can create a backend for our case study using Mobile Apps.
- API Apps: It’s a new app type in App Service that lets you easily build and consume Restful APIs in the cloud. With API Apps, teams can easily share APIs with other teams in your organization with your own private organizational gallery of APIs. APIs can also be shared publicly and monetized for third-party developers. API Apps makes it easy to secure your APIs. Secure your API Apps with support for Azure Active Directory, including single sign-on support for many third-party services. Rich support for social authentication to Google, Microsoft, Facebook, and Twitter is also available. We can create some API’s and expose it to be consumed by our logic apps or even by our Web Apps.
- Logic Apps: It’s a new app type in App Service that lets you easily automate business process. Logic apps enable you to develop and deliver powerful integration solutions with ease. With Logic apps now you can visually create business processes and workflows. Deliver integration capabilities in Web, Mobile and API apps. We can write the custom workflows in the applications right from placing an order to delivering an order to customers of my ecommerce engine.
Let’s continue to fit the customer scenario in line with the Azure App Services offerings. This is how I think you should architect your application.
Sample E-Commerce Architecture
App Insights: Visual Studio Application Insights monitors your live application to help you detect and diagnose performance issues and exceptions, and discover how your app is used. It can be used with a wide variety of application types including Asp.net Web Apps, Windows Phone or any other .Net Apps. It also works for apps that are hosted on your own on-premises IIS servers.
VSO Load Test: We can find performance problems in your app before customers do. We want to make that our app can handle traffic for your next launch or marketing campaign. We can run cloud-based load tests in almost no time with Visual Studio Online.
Cloud Service: Deploy highly-available, infinitely-scalable applications and APIs. You can use Web Roles and Worker roles of Cloud Service to implement PDF receipts generations. Remember you can also do this in the same Web App instance using Webjobs like I said it’s a choice that I would prefer to keep decouple the application for better performance.
Blob Storage: Azure Blob storage is a service for storing large amounts of unstructured data, such as text or binary data, that can be accessed from anywhere in the world via HTTP or HTTPS. You can use Blob storage to expose data publicly to the world, or to store application data privately. I’m proposing Blob for this scenario to store the files which has got the capability for Performing secure backup and disaster recovery of our files.
Hope this is a good read if you are planning to design or architect your modern applications for cloud. You can still add more business requirements and add features to this but I wanted to get started. Hope it’s a good start
Eager to know your thoughts and opinion on this, feel free to drop a comment if you have any questions or opinions below.
Cheers,
Goutham