Pereiti prie pagrindinio turinio

Journey to serverless

In this article I will tell more about the journey to serverless. I will explain the reasons why we have decided to move from traditional Virtual Machines to Serverless framework and AWS services, I will introduce components of architecture and lastly, I will reveal our future work.

Cloudblogmin

This blog post author Remigijus works in Visma IT & Communications team as a Cloud Engineer. He is a software technology enthusiast. Meanwhile, IT brings in a lot of fun he also finds offroad motorcycle is a good way to clear minds and helps to keep „work and life“ in balance.


I’ve joined my new team recently and it is quite a luck to start at a great moment – phase of moving workloads from traditional Virtual Machines to a nice combination of Serverless framework and a bunch of AWS services like API GW, Lambda, Fargate and many more to run the solution. What makes this so intriguing?

Reasoning

– pay as you go. Some of our workloads are relatively demanding for computing power: 15-180 minutes of intense heuristics. On the other hand, processing is required on a period basis only.
Data processing algorithms return initial results quite fast, meanwhile, each next calculation cycle gives more and more precise outcomes, however, this comes with a cost of time: each next cycle of calculation takes longer to complete compared to the previous iteration. So, at any moment customers can accept the current result as an eligible one therefore halting further processing.
We believe our existing setup utilizing large and expensive EC2 instances doing nothing most of the time is not the most cost-effective option.
– scalability. Our current architecture allows us to run 5 workloads per machine concurrently. With the current amount of customers/visitors requests are fulfilled with no delays. However, forecasts of service growth demands to be ready to serve 200 jobs simultaneously, which, according to our current design is 40 virtual machines at a minimum. Leaving costs alone, it’s also a technical challenge to configure auto-scaling, deal with “cold starts”, keep AMI patched up to date, etc…

Architecture

Components

  • AWS API gateway: the entry point for all the incoming requests, works as a ‘proxy’ between external service (requestor) and Lambda functions
  • AWS Lambda: to handle requests directing from API Gateway
  • Docker containers on AWS Fargate for “heavy” data processing
  • Elastic Container Registry, IAM, CloudWatch, S3, Aurora database to run and support our services
  • Infrastructure components defined with Terraform
  • Serverless framework for easier Lambda’s deployment
Data Flow
[Simplified] Data flow

Future work

Is it something new? No, within Visma group we already have production workloads configured in similar fashion.
Will it work for our use case? Yes, it will.
Will it meet our expectations – time will tell. 🙂
We already did POC at earlier stages, however, refactoring part of a service will also be an evaluation if such setup can be defined as a ‘blueprint’ aiming to apply the same principles on other units of our service.
Nevertheless, main building blocks and flows are defined, still there are a number of missing pieces to complete picture fully, so our plans for coming months are to address:

  • Observability – we think central logging is a must to make “our lives easier” during troubleshooting
  • Observability – with CloudWatch running Out Of the Box, we think we could benefit utilizing Grafana / Loki
  • CI/CD pipelines are still in a progress to its final “shape” with rollout/release strategy being defined

Populiariausi blog'ai

  • Migrating from Xamarin to .NET MAUI: A Comprehensive Guide

    The world of mobile application development is constantly evolving, and Microsoft’s .NET Multi-platform App UI (.NET MAUI) is at the forefront of this change. As an evolution of Xamarin.Forms, .NET MAUI offers developers a modern, cross-platform framework for building native device applications. This blog post will guide you through the process of migrating your existing Xamarin.Forms application to .NET MAUI.

  • My experience on taking the eWPTXv2 exam

    So a few months ago I had the joy of passing the eWPTXv2 exam. Well, it does not sound intriguing until you translate it into human language. The eWPTXv2 is actually eLearnSecurity Web Penetration Testing Extreme second version. Everything sounds better than you put extreme into it. Well, this is not that case since the exam is actually a bit hard.

  • Socialinis intranetas „Simoona“ – dabar prieinamas kiekvienam!

    Šiame blog’o įraše papasakosime apie vidinės komunikacijos įrankį, mūsų kurtą socialinį tinklą „Simooną“. Tik prasidėjus kūrybos procesui mums rūpėjo tik viena – kaip kuo daugiau įmonės kultūros perkelti į skaitmeninę erdvę. Ir prieš aštuonerius metus, net neįsivaizdavome, kad šis vidinis intranetas, bus toks svarbus kuriant glaudžius ryšius tarp kolegų ir tikrai net negalėjome nutuokti, kokia svarbi „Simoona“ bus užklupus pasaulinei pandemijai.