Skip to main content

4-1. Serverless Container Options

ยท 7 min read
Nitya Narasimhan

Welcome to Week 4 of #CloudNativeNewYear!

This week we'll go further with Cloud-native by exploring advanced topics and best practices for the Cloud-native practitioner. We'll start with an exploration of Serverless Container Options - ranging from managed services to Azure Kubernetes Service (AKS) and Azure Container Apps (ACA), to options that allow more granular control!

What We'll Coverโ€‹

  • The Azure Compute Landscape
  • Serverless Compute on Azure
  • Comparing Container Options On Azure
  • Other Considerations
  • Exercise: Try this yourself!
  • Resources: For self-study!

Going further with cloud-native: Serverless container options by Nitya Narasimhan.


We started this series with an introduction to core concepts:

  • In Containers 101, we learned why containerization matters. Think portability, isolation, scalability, resource-efficiency and cost-effectiveness. But not all apps can be containerized.
  • In Kubernetes 101, we learned how orchestration works. Think systems to automate container deployment, scaling, and management. But using Kubernetes directly can be complex.
  • In Exploring Cloud Native Options we asked the real questions: can we containerize - and should we?. The first depends on app characteristics, the second on your requirements.

For example:

  • Can we containerize? The answer might be no if your app has system or OS dependencies, requires access to low-level hardware, or maintains complex state across sessions.
  • Should we containerize? The answer might be yes if your app is microservices-based, is stateless by default, requires portability, or is a legaacy app that can benefit from container isolation.

As with every technology adoption decision process, there are no clear yes/no answers - just tradeoffs that you need to evaluate based on your architecture and application requirements. In today's post, we try to look at this from two main perspectives:

  1. Should you go serverless? Think: managed services that let you focus on app, not infra.
  2. What Azure Compute should I use? Think: best fit for my architecture & technology choices.

Azure Compute Landscapeโ€‹

Let's answer the second question first by exploring all available compute options on Azure. The illustrated decision-flow below is my favorite ways to navigate the choices, with questions like:

  • Are you migrating an existing app or building a new one?
  • Can you app be containerized?
  • Does it use a specific technology (Spring Boot, Red Hat Openshift)?
  • Do you need access to the Kubernetes API?
  • What characterizes the workload? (event-driven, web app, microservices etc.)

Read the docs to understand how your choices can be influenced by the hosting model (IaaS, PaaS, FaaS), supported features (Networking, DevOps, Scalability, Availability, Security), architectural styles (Microservices, Event-driven, High-Performance Compute, Task Automation,Web-Queue Worker) etc.

Compute Choices

Now that we know all available compute options, let's address the second question: why go serverless? and what are my serverless compute options on Azure?

Azure Serverless Computeโ€‹

Serverless gets defined many ways, but from a compute perspective, we can focus on a few key characteristics that are key to influencing this decision:

  • managed services - focus on application, let cloud provider handle infrastructure.
  • pay for what you use - get cost-effective resource utilization, flexible pricing options.
  • autoscaling on demand - take advantage of built-in features like KEDA-compliant triggers.
  • use preferred languages - write code in Java, JS, C#, Python etc. (specifics based on service)
  • cloud-native architectures - can support event-driven solutions, APIs, Microservices, DevOps!

So what are some of the key options for Serverless Compute on Azure? The article dives into serverless support for fully-managed end-to-end serverless solutions with comprehensive support for DevOps, DevTools, AI/ML, Database, Storage, Monitoring and Analytics integrations. But we'll just focus on the 4 categories of applications when we look at Compute!

  1. Serverless Containerized Microservices using Azure Container Apps. Code in your preferred language, exploit full Dapr support, scale easily with any KEDA-compliant trigger.
  2. Serverless Application Environments using Azure App Service. Suitable for hosting monolithic apps (vs. microservices) in a managed service, with built-in support for on-demand scaling.
  3. Serverless Kubernetes using Azure Kubernetes Service (AKS). Spin up pods inside container instances and deploy Kubernetes-based applications with built-in KEDA-compliant autoscaling.
  4. Serverless Functions using Azure Functions. Execute "code at the granularity of functions" in your preferred language, and scale on demand with event-driven compute.

We'll talk about these, and other compute comparisons, at the end of the article. But let's start with the core option you might choose if you want a managed serverless compute solution with built-in features for delivering containerized microservices at scale. Hello, Azure Container Apps!.

Azure Container Appsโ€‹

Azure Container Apps (ACA) became generally available in May 2022 - providing customers with the ability to run microservices and containerized applications on a serverless, consumption-based platform. The figure below showcases the different types of applications that can be built with ACA. Note that it comes with built-in KEDA-compliant autoscaling triggers, and other auto-scale criteria that may be better-suited to the type of application you are building.

About ACA

So far in the series, we've put the spotlight on Azure Kubernetes Service (AKS) - so you're probably asking yourself: How does ACA compare to AKS?. We're glad you asked. Check out our Go Cloud-native with Azure Container Apps post from the #ServerlessSeptember series last year for a deeper-dive, or review the figure below for the main comparison points.

The key takeaway is this. Azure Container Apps (ACA) also runs on Kubernetes but abstracts away its complexity in a managed service offering that lets you get productive quickly without requiring detailed knowledge of Kubernetes workings or APIs. However, if you want full access and control over the Kubernetes API then go with Azure Kubernetes Service (AKS) instead.

Comparison

Other Container Optionsโ€‹

Azure Container Apps is the preferred Platform As a Service (PaaS) option for a fully-managed serverless solution on Azure that is purpose-built for cloud-native microservices-based application workloads. But - there are other options that may be suitable for your specific needs, from a requirements and tradeoffs perspective. Let's review them quickly:

  1. Azure Functions is the serverless Functions-as-a-Service (FaaS) option, as opposed to ACA which supports a PaaS approach. It's optimized for running event-driven applications built at the granularity of ephemeral functions that can be deployed as code or containers.
  2. Azure App Service provides fully managed hosting for web applications that may be deployed using code or containers. It can be integrated with other services including Azure Container Apps and Azure Functions. It's optimized for deploying traditional web apps.
  3. Azure Kubernetes Service provides a fully managed Kubernetes option capable of running any Kubernetes workload, with direct access to the Kubernetes API.
  4. Azure Container Instances provides a single pod of Hyper-V isolated containers on demand, making them more of a low-level "building block" option compared to ACA.

Based on the technology choices you made for application development you may also have more specialized options you want to consider. For instance:

  1. Azure Spring Apps is ideal if you're running Spring Boot or Spring Cloud workloads on Azure,
  2. Azure Red Hat OpenShift is ideal for integrated Kubernetes-powered OpenShift on Azure.
  3. Azure Confidential Computing is ideal if you have data/code integrity and confidentiality needs.
  4. Kubernetes At The Edge is ideal for bare-metal options that extend compute to edge devices.

This is just the tip of the iceberg in your decision-making journey - but hopefully, it gave you a good sense of the options and criteria that influences your final choices. Let's wrap this up with a look at self-study resources for skilling up further.

Exerciseโ€‹

Want to get hands on learning related to these technologies?

TAKE THE CLOUD SKILLS CHALLENGE

Register today and level up your skills by completing free learning modules, while competing with your peers for a place on the leaderboards!

Resourcesโ€‹