Businesses are now moving into the cloud for lower costs, lower maintanence, zero upfront cost & zero maintainability for hardware, better performance. The big dogs are AWS, Azure and Google cloud. Needless to say, Azure is preferred by Microsoft tech based businesses due to compatibility of languages, software, and easiness to stay in the same Eco system.
The days where you had to pay for an entire SQL server and the license upfront, maintaining unscalable monolithic applications, and worrying about the hardware not being able to handle your software are almost over. We’re transitioning into serverless functions, renting servers if still needed, and non relational databases such as CosmosDB.
Azure provides many benefits out of the box. The sql servers can be replicated across their regions. They guarantee a high up time. The serverless functions mean that the API endpoints on your servers don’t have to sit on the same box, or replicated across many boxes. Instead, they can sit separately as individual functions ‘somewhere’ in the cloud – you don’t have to worry about it. If you get 1 million unexpected requests to a end point, where you usually get 10k, Azure is going to take care of that by running them ‘somewhere’. You can still access your data in very similar ways. Rewriting the code does take some time to accommodate the serverless paradigm, but it’s easy once the foundation is down. Where do you get the data from, how, what do you have to return, who do you let have access to that endpoint and how do you authenticate the users?
How many web servers we need to host the API endpoints? 1. Oh, look, we get more requests now. Start another one, and another one to funnel the traffic between the two other machines. Now we have one reverse proxy machine, and then 2 api servers. More traffic? Easy, bring up more machines. However, even if you have access to unlimited number of VMs they still cost a lot more than serverless functions, and they do need time to get spun up and taken down. You’re paying for Windows licenses for those machines, and you might have to maintain the software. Just use serverless functions.
Serverless functions not only work for API endpoints, but also for processing queues. One such queuing service in Azure is called the service bus. If you’re uploading a video on youtube, that video file is taken through a multitude of steps before being showing to the users. First, it’s getting uploaded somewhere. Then, screenshots are taken for the thumbnail where you can choose which one you like most. Then, the video is converted to a smaller compressed size of the same resolution, as well as lower resolutions. These can be done in parallel, and they can be done with serverless functions. Recently azure container instances were introduced, with durable functions on their way.
To learn more, azure released serverless functions v2 out of beta not long ago. Go have a look.