By converting processor-intensive tasks to externally-hosted functions, we took load off the main server - keeping the system responsive and functional while reducing costs.
One of the advantages of migrating a web-based application to a large cloud provider (Azure or AWS), is once the main work is done you have easy access to the vast range of services they offer. For instance, both Amazon (AWS Lambda functions) and Microsoft (Azure functions) offer services to host and execute Python functions without having to provision servers or set anything else up. There are a couple of places where we found this very useful during our intranet migration project.
The client uses Hubspot, an external CRM service, to manage all their data about external companies and individuals - we need to interact with the external APIs to keep these thousands of records up-to-date. The key here is to run the sychronisation routines regularly enough to capture new data, without bringing the application server to its knees.
Interacting with external APIs (or publishing your own) is a perfect use case for this kind of serverless function - you only pay for the processor cycles you use and the cloud provider can deal with any surges in traffic or processing capacity.
By migrating these processor-intensive tasks to serverless functions, we have saved a significant amount of money.
The intranet includes a technical library of over 10,000 PDFs - each one needs to be analysed for keywords, staff names and project titles. This process can be very heavy on processor resources, especially if the PDF is hundreds of pages long. While new documents are not added very regularly, when a user uploads a new one it should be analysed as soon as possible to extract the important linkages. Doing this on the main application server was sometimes causing it to slow down users' browsing.
The Azure function we use for document analysis grabs new PDF uploads from the Content Delivery Network via HTTP, analyses them, and puts the data directly into the Azure SQL database, completely bypassing the Virtual Machine hosting the application server. The documents are processed quickly without affecting overall application performance.
By migrating these processor-intensive tasks to serverless function services, we have saved a significant amount of money in extra processor capacity on the main virtual machine.
If you would like to find out more about serverless functions and other bespoke developments, please do not hesitate to get in touch.