Cloud Engineering : Refactoring and Migrating away from the cloud to save costs

A Crowdfunding campaign in Colombia went viral and broke many records with 2 million sessions, more than 20 million pages visited and received more than 15 thousand supporters, which was 3 times more than the previous campaign! 

This was followed by a fantastic celebration, till they realised that they have spent more than 30K USD in just 72 hours for cloud services!  This was later found to be due to a code mistake – an expensive mistake that would have not happened if the hosting was on the client’s own server but probably the server would have crashed! 

The above is just an instance to highlight the need to constantly monitor cloud services and the costs associated with them.


Our client, a smart interview platform, was using Azure Video services as the backend to analyse videos. These videos were of candidates recorded during a recruitment and interview process and these were analysed to provide personality-based scores. The challenge that the client was facing is that their Azure credits expired and this was resulting in a huge cost centre for the client. The task ahead of DeepDive labs was to understand the system and provide the most optimal solution considering all the client’s requirements.

A thorough analysis of the usage pattern was studied by the DeepDive labs team to understand what and how the Azure services were used for analysing the videos, extracting information, and then calculating the personality scores. The solution proposed by DeepDive labs was a Cloud refactoring and migration to optimize costs and several other aspects.

While the reasons that many organizations move to the cloud like scalability, security, reliability, flexibility and most notably cost efficiently are well understood, there is a constant need for monitoring software services deployed on the cloud to optimize cloud cost and make use of the updated services that are being released constantly. 

For this client, DeepDive Labs Re-architected and migrated modules that were using the Video Services in Azure to in-house models and speech-only services on AWS, which only cost a fraction of the cost and increased processing time as well. 

A significant part of the decision was the Cloud cost, which could be quite complicated. When looking at a cloud transformation it can be tempting to simply compare the costs of current infrastructure compared to the costs of the future, cloud-enabled infrastructure, but it is slightly more complicated. 

It is necessary to compute the Total Cost of Ownership. Investopedia defines the Total Cost of Ownership (TCO) as the purchase price of an asset plus the costs of operation. TCO is made up of several factors like:

  • Operational hardware, software, utility, and labour cost

  • Migration costs beyond business as usual

  • Cost of inaction

To understand costs, DeepDive Labs looked at the value and return on investments. Due to economies of scale and better utilization of resources, cloud can be cheaper. But on the other hand, cloud could also be significantly expensive due to:

  • Misunderstood cost structures (storage measured not only by amount stored by also amount transferred)

  • Premium services beyond IaaS with lesser transparency and complications

  • Over usage due to over provisioning resources than needed

  • Possibility of vendor lock-in


The Previous and Refactored Flows

Before and After Cloud refactoring

As the diagram illustrates previously the Azure Video analyzer was processing a larger size file and the costs were significantly higher.

After refactoring as per DeepDive Labs solution, the audio file was with a much lower size and the text based analysis of it was done with AWS Transcribe service and cost much lower. The inhouse video analysis modules were retained on the frame images, to analyse the different interview scores. in brief, the processing video takes 20X more cost + additional storage cost as well than audio processing. 


Deepdive Labs re-architected and migrated modules from using the cloud Video Services to in-house models & speech services on AWS that 

  • Reduced cloud cost by 65% 

  • Increased processing time by approximately 50%.

The key considerations for DeepDive labs to propose the solution of re-architecting modules from Azure Video Services to an in-house solution were:

  • Cost Considerations: While cloud services like Azure Video Services offer convenience and scalability, they come with costs that can accumulate over time, especially as usage grows. In the case of this client, it was more cost-effective to build and maintain their video services in-house, particularly with their predictable usage patterns that could not be efficiently met by cloud services.

  • Performance and Customization Requirements: In-house solutions offered more control over performance and customization. Our client had specific performance requirements with the need to tailor the video services to integrate tightly with other internal systems or workflows. Building these capabilities in-house allowed for greater flexibility and customization.

  • Data Privacy and Compliance: Considering the strict regulations around data privacy and compliance, our client preferred to keep sensitive video data on-premises rather than relying on a third-party cloud provider like Azure. By re-architecting modules in-house, the client could maintain greater control over data privacy and ensure compliance with relevant regulations.

  • Long-Term Strategic Goals: This solution path in concurrence with our client’s long-term strategic goals of developing internal expertise or capabilities in certain areas, such as video processing and delivery. Building modules in-house helped foster the development of internal talent and expertise, which may be valuable for future projects or initiatives.

  • Integration with Existing Infrastructure: This solution allowed the client to better integrate the video service with their existing infrastructure and systems, minimizing disruption and ensuring seamless operation.

Overall, the decision to re-architect modules from Azure Video Services to an in-house solution depended on several factors such as cost, performance requirements, data privacy considerations, strategic goals, and integration needs. 

Previous
Previous

Extraction of unstructured data to generate crime knowledge graphs: Past, Present & Future

Next
Next

My conversations with GenAIs made me rethink our 'accepted' ways of evaluating answers to questions!