Multicloud solutions with the Serverless Framework
Tirumala Rao Sodipalli
Cloud Architect @ Walmart | Ex-Microsoft - Azure Solution architect
This is an published article in the?#AzureArchitectureCenter??
Link to the Article: Multicloud solutions with the Serverless Framework - Azure Architecture Center | Microsoft Learn
This article describes how the Microsoft Commercial Software Engineering (CSE) team partnered with a global retailer to deploy a highly available serverless solution across both Azure and Amazon Web Services (AWS) cloud platforms, using the?Serverless Framework.?
Architecture
Components: The Serverless Framework
This solution uses the Serverless Framework, available from?Serverless, Inc. The free version of the Serverless Framework includes a CLI, more plugins, and limited monitoring services. The Pro edition features operational capabilities across clouds, such as enhanced monitoring and alerts. The framework supports Node.js and Python languages, and both AWS and Azure cloud hosts.
To use Azure with the Serverless Framework, you need:
The following figure shows the processing pipeline. The middleware layers represent any intermediate functionality needed before reaching the handler.
Cloud-agnostic APIs: The serverless implementation on each platform supports individual functions as microservices, one to each functional VM node, and executes processing as needed. Each AWS Lambda function has a corresponding Azure Functions function. The?Serverless Multicloud Library?builds analogous microservices from either cloud into a cloud-agnostic?normalized REST API?that client apps can use to interface with either platform. Because the abstracted API layer provides code to address the corresponding microservices for each platform, transactions don't need translation. The cloud-agnostic interface lets user apps interact with the cloud without knowing or caring which cloud platform they're accessing.?
The following diagram illustrates this concept:
CI/CD with GitOps: A primary job of the Serverless Framework is to abstract away all the infrastructure concerns of deploying an app to the cloud. By using a manifest-based approach, the Serverless Framework can deal with all deployment issues, allowing deployment to be automated as needed to support GitOps.?
Although this initial project used manual deployments, it's realistic to implement manifest-driven serverless builds, tests, and deployments within or across clouds. This process can use a GitOps developer workflow: building from Git, using quality gates for test and evaluation, and pushing serverless solutions onto both cloud providers. Performing all deployments using the Serverless Framework from the beginning of the project is the most efficient way to proceed.?
API manager: The API Manager can be an existing or custom application. The Apigee? API Manager in this implementation acted only as a router to provide a 50-50 transaction load balance to the two cloud platforms, and was underutilized for its capabilities.?
The API Manager must be able to:
领英推荐
Scenario details: In?serverless computing, the cloud provider dynamically allocates microservices resources to run code, and only charges for the resources used. Serverless computing abstracts app code from infrastructure implementation, code deployment, and operational aspects like planning and maintenance.
As with other services, each cloud provider has its own serverless implementation, and it's difficult for customers to use a different provider without considerable operational impact and costs. Potential customers may view this situation as weakening their bargaining position and agility. Vendor lock-in is one of the greatest obstacles to enterprise cloud adoption.
The open-source?Serverless Framework?is a universal cloud interface for developing and deploying serverless computing solutions across cloud providers. Open-sourcing and common APIs for serverless functions help providers, customers, and partners build cross-cloud solutions for best-of-breed services. The Serverless Framework reduces barriers to cloud adoption by addressing the problems of vendor lock-in and cross-cloud provider redundancy. Customers can optimize their solutions based on cost, agility, and other considerations.
CSE and the Azure product team collectively rewrote the?Serverless CLI?to support new Azure Functions features like Premium Functions, API Management, and KeyVault. The Serverless CLI now provides a standard interface for GitOps deployment to both Azure and AWS. The team also developed the?Serverless Multicloud Library, which provides a?normalized runtime API?to deploy serverless apps to both AWS and Azure.
This design provides high availability with?active-active?failover between multiple cloud platforms, as opposed to?active-passive?failover. If the service of one cloud provider becomes unhealthy or unavailable, this solution can reroute requests to another cloud platform.?
This project met the following technical goals:
Other potential benefits of using the Serverless Framework include:
Potential use cases: Write client-side applications for multiple platforms by using a cloud-agnostic API from the Serverless Multicloud Library.
Considerations: This article doesn't describe security solutions, although the initial deployment included them. There are many possible security solutions, some platform dependent, and this framework should accommodate any reasonable solution. User authentication is the minimum security assumed.
Deploy this scenario: A traditional?Blue-Green Deployment?develops and deploys an app to two separate but identical environments, blue and green, increasing availability and reducing risk. The blue environment is usually the production environment that normally handles live traffic, and the green environment is a failover deployment as needed. Typically, the CI/CD pipeline automatically deploys both blue and green environments within the same cloud platform. This configuration is considered an?active-passive?configuration.
In the multicloud solution, blue-green deployment is implemented in both cloud platforms. In the serverless case, two duplicate sets of microservices are deployed for each cloud platform, one as the production environment and the other as the failover environment. This active-passive setup within each cloud platform reduces the risk that this platform will be down, increasing its availability, and enabling multicloud?active-active?high availability.
A secondary benefit of blue-green deployment is the ability to use the failover deployment on each cloud platform as a test environment for microservices updates, before releasing them to the production deployment.
Enabling Engineers | Enterprise Solution Architect | Microsoft Certified Trainer | x9 Azure certifications | CPSA-F
1 年I'm curious, what is the problem being solved by this approach? ?? Why to do serverless multi-cloud?
Chief Technology Officer
1 年Thank you for sharing. What is your approach for keeping the data synchronized across the multi cloud solution? Not all data is created or managed equally, but a lot of use cases require synchronization (e.g. Inventory from the above reference architecture)