Compute Platform Selection
Complete the full lesson to earn 25 points
Work through each section, then tap “Mark as Complete” on the last one.
Module: Accelerate Workload Migration and Modernization
Section: New Architecture Design
Lesson: Compute Platform Selection
Introduction: The Foundation of Modern Architecture
When we talk about migrating workloads to the cloud or modernizing existing applications, the compute platform is the bedrock upon which everything else rests. Choosing the right compute environment is not merely a technical preference; it is a fundamental decision that dictates your operational costs, your team’s cognitive load, your ability to scale, and the ultimate performance of your software. If you choose an environment that is too rigid, you will struggle to innovate; if you choose one that is too complex, your team will spend more time managing infrastructure than building features.
In the early days of cloud computing, the choice was simple: you either rented a virtual machine (VM) or you didn't. Today, the landscape is vast, ranging from bare-metal servers and virtual machines to containers, serverless functions, and managed orchestration layers. Each of these options serves a specific purpose, and the "correct" choice depends entirely on the nature of your workload, your performance requirements, and your organization's internal expertise.
This lesson explores how to evaluate these compute options systematically. We will move beyond marketing hype and look at the trade-offs between control, portability, and management overhead. By the end of this guide, you will be equipped to map your specific application requirements to the most appropriate compute strategy, ensuring that your migration or modernization effort is built on a sustainable foundation.
Understanding the Compute Spectrum
To make an informed decision, we must categorize compute options based on the level of abstraction they provide. The "abstraction" level refers to how much of the underlying hardware, operating system, and runtime environment you are responsible for managing.
1. Infrastructure as a Service (IaaS): Virtual Machines
Virtual Machines are the most traditional form of cloud computing. They provide a high degree of control, allowing you to install custom kernels, specific network drivers, and legacy software stacks. You are responsible for patching the OS, managing security updates, and configuring the runtime.
- Best for: Legacy applications that require specific OS settings, stateful applications that need persistent local storage, and workloads that require fine-grained control over the networking stack.
- The Trade-off: High operational overhead. You are effectively managing a data center slice.
2. Containerized Environments (CaaS)
Containers, typically managed via orchestrators like Kubernetes, offer a middle ground. You manage the application and its dependencies, while the platform manages the underlying OS and hardware scaling. This is the industry standard for modern, microservices-based architectures.
- Best for: Microservices, applications that need to run consistently across development, testing, and production, and teams that want a balance between control and automation.
- The Trade-off: Increased complexity in the orchestration layer. Kubernetes, while powerful, has a steep learning curve.
3. Serverless Computing (FaaS)
Serverless computing abstracts everything except the code itself. You provide a function or a container image, and the provider handles everything else: provisioning, scaling, patching, and availability. You pay only for the execution time.
- Best for: Event-driven tasks, asynchronous processing, APIs with bursty traffic patterns, and rapid prototyping.
- The Trade-off: Vendor lock-in and potential "cold start" latency issues. You lack control over the underlying environment.
Callout: The Control vs. Management Trade-off There is an inverse relationship between control and management overhead. As you move from Virtual Machines toward Serverless, your ability to fine-tune the environment decreases, but the operational burden of maintaining that environment also drops significantly. The goal of modernization is to move as far to the right of this spectrum as your application requirements allow.
Decision Matrix: Matching Workloads to Platforms
When deciding where a workload should live, do not start with the platform. Start with the application’s characteristics. Use the following table to guide your initial assessment:
| Workload Characteristic | Recommended Platform | Reasoning |
|---|---|---|
| Legacy / Monolithic | Virtual Machine | Requires OS-level access and stability. |
| Microservices | Containers / K8s | Excellent for modular scaling and deployment. |
| Event-Driven | Serverless | Cost-effective for intermittent tasks. |
| High Performance (HPC) | Bare Metal / Optimized VMs | Eliminates virtualization overhead. |
| Burst-Heavy Traffic | Serverless / Auto-scaling K8s | Scales rapidly based on demand. |
| Strict Compliance | Virtual Machines | Easier to audit and control security patches. |
Step-by-Step Selection Process
Selecting a compute platform is a process of elimination. Follow these steps to reach a logical conclusion for your migration.
Step 1: Define the Constraints
Before looking at cloud offerings, document what your application requires. Does it need a specific version of Linux? Does it rely on persistent local state (like a local file cache)? Does it have high memory requirements that only specific hardware can satisfy? If the answer is "yes" to these, you are likely looking at Virtual Machines or specialized container instances.
Step 2: Evaluate Operational Maturity
Be honest about your team’s skills. If your team has zero experience with Kubernetes, forcing a move to a container-orchestrated environment during a migration will likely result in a failed project. It is often better to migrate to a managed VM service first, then modernize to containers once the team is comfortable with the cloud environment.
Step 3: Analyze the Cost Model
Calculate the "Total Cost of Ownership" (TCO). A serverless function might look cheap because it costs pennies per execution, but if it runs 24/7 at high volume, it might be significantly more expensive than a reserved VM instance. Factor in the cost of engineering time required to maintain the platform.
Step 4: Pilot and Benchmark
Do not commit to a platform based on theory alone. Create a "Hello World" or a small module of your application and deploy it to your top two choices. Benchmark latency, deployment speed, and monitoring ease. This practical data is worth more than any vendor whitepaper.
Deep Dive: Containerization and Orchestration
For most modernization efforts, the target architecture is containerization. Let’s look at why this is the case and how to approach it. Containers package code, runtime, and libraries together, ensuring that the software behaves the same way regardless of where it runs.
The Kubernetes Reality
Kubernetes is the de facto standard for container management. However, running your own Kubernetes cluster (often called "vanilla K8s") is a massive undertaking involving networking, storage, security, and cluster upgrades. Most organizations should opt for managed services (like EKS, GKE, or AKS) where the cloud provider manages the "Control Plane" for you.
Example: A Simple Deployment Configuration Below is a basic Kubernetes deployment manifest. This file tells the orchestrator how to run your application.
apiVersion: apps/v1
kind: Deployment
metadata:
name: web-app-deployment
spec:
replicas: 3
selector:
matchLabels:
app: web-app
template:
metadata:
labels:
app: web-app
spec:
containers:
- name: web-app
image: my-registry/web-app:v1.0.0
ports:
- containerPort: 8080
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
- Explanation:
replicas: 3: Ensures that three copies of your application are always running for high availability.resources: This is critical. By setting requests and limits, you tell the orchestrator how much hardware to allocate, preventing one "noisy" container from starving others.
Warning: The Resource Limit Trap Many developers set resource limits too low, causing their applications to crash with "Out of Memory" (OOM) errors during traffic spikes. Always monitor your application’s actual usage in a staging environment before setting production limits.
Serverless: The Logic-First Approach
Serverless allows you to focus entirely on logic. If you have an application that processes images when they are uploaded to storage, you don't need a server running 24/7. You need a function that triggers on the "upload" event.
When to use Serverless
Serverless shines in asynchronous tasks. If your application sends emails, generates PDFs, or processes data streams, serverless is often the most efficient compute model. It is inherently event-driven.
Example: A Simple Function (Node.js)
// This function triggers when a file is uploaded to a storage bucket
exports.handler = async (event) => {
const fileName = event.Records[0].s3.object.key;
console.log(`Processing file: ${fileName}`);
// Logic to process the image or document
await performTask(fileName);
return {
statusCode: 200,
body: JSON.stringify('Processing complete'),
};
};
- Explanation: This code is entirely decoupled from the infrastructure. You do not define OS versions, CPU types, or network configurations. You simply write the business logic, and the cloud provider invokes it when the trigger occurs.
Best Practices for Platform Selection
Regardless of the platform you choose, there are universal practices that will prevent common pitfalls.
- Avoid Hard Dependencies: Try to keep your application code independent of the infrastructure. For example, use environment variables to configure database connections rather than hard-coding internal IP addresses or hostnames.
- Infrastructure as Code (IaC): Never configure your compute platforms manually in a web console. Use tools like Terraform or Pulumi to define your infrastructure. This makes your environment reproducible, version-controlled, and transparent.
- Observability is Non-Negotiable: You cannot manage what you cannot see. Ensure that your chosen platform integrates well with logging and monitoring tools. If you use containers, ensure you have centralized logging (like ELK or CloudWatch).
- Implement Security by Default: Follow the principle of least privilege. A container or function should only have the permissions it needs to perform its specific task—nothing more.
- Plan for Portability: Even if you choose a cloud-specific service, keep your core business logic separate from platform-specific code. This allows you to migrate to a different compute provider if your business needs change in the future.
Callout: Why "Lift and Shift" Often Fails A common mistake during migration is "Lift and Shift"—taking a legacy VM and moving it directly to a cloud VM without changes. While this is fast, it often results in higher costs and misses the opportunity to improve the system. Modernization requires rethinking how the application consumes compute resources, not just changing the host.
Common Pitfalls and How to Avoid Them
1. Underestimating Complexity
Developers often choose Kubernetes because it is "popular," not because their application needs it. If you have a simple application, start with a simpler platform (like a managed App Service or standard Virtual Machines). You can always migrate to Kubernetes later when the complexity of your application actually justifies it.
2. Ignoring "Cold Starts" in Serverless
If you choose serverless for a user-facing API, be aware of the "cold start" problem. When a function hasn't been called in a while, the provider spins down the environment. The next request will experience a delay while the environment spins back up. If your application requires sub-millisecond response times, serverless might not be the right choice.
3. Over-provisioning
A common habit from the on-premises world is to request twice the hardware you need "just to be safe." In the cloud, this is just burning money. Start with smaller instances and use auto-scaling to increase capacity only when the metrics show it is necessary.
4. Neglecting Networking
Compute does not exist in a vacuum. A fast compute platform is useless if it is trapped behind a slow, improperly configured network. Spend time understanding your Virtual Private Cloud (VPC) settings, subnet configurations, and egress/ingress rules.
Comparison of Popular Compute Choices
| Feature | Virtual Machines | Containers (K8s) | Serverless |
|---|---|---|---|
| Startup Time | Minutes | Seconds | Milliseconds |
| Scaling | Slow (requires boot) | Fast (pod scaling) | Instant (automatic) |
| Maintenance | High (OS/Patches) | Medium (Orchestration) | Low (Code only) |
| Portability | High | Very High | Low |
| Cost Model | Hourly/Monthly | Hourly/Resource usage | Per execution |
Industry Standards and Trends
The current industry trend is toward "Platform Engineering." Instead of developers having to choose between VMs or Containers, organizations are building internal platforms that abstract these choices. A developer might simply push code to a repository, and the platform automatically decides whether to deploy it to a container or a serverless function based on the application's profile.
This shift emphasizes that the "Compute Platform" is increasingly becoming a service provided by your own internal infrastructure team. As you design your architecture, think about how your developers will consume it. Can they deploy with a single command? Is the environment consistent? Does it have built-in security scanning? These factors are just as important as the underlying compute choice.
Conclusion and Key Takeaways
Selecting the right compute platform is a balancing act between the needs of your application and the capabilities of your team. There is no "best" platform—only the one that serves your current and near-future requirements most effectively.
Key Takeaways:
- Start with the Workload, Not the Platform: Analyze your application’s behavior—statefulness, traffic patterns, and dependencies—before choosing an environment.
- Embrace the Spectrum: Recognize that VMs offer maximum control, containers offer the best balance for modern microservices, and serverless offers the lowest management overhead for event-driven tasks.
- Prioritize Operational Maturity: Choose a platform your team can actually support. Do not adopt complex orchestration layers until your team has the skills to manage them safely.
- Use Infrastructure as Code (IaC): Regardless of your choice, ensure your infrastructure is defined in code to maintain consistency and enable disaster recovery.
- Monitor and Optimize: Compute costs can spiral if left unchecked. Use monitoring to identify underutilized resources and scale them down to match real-world demand.
- Don't Fear Modernization: While "Lift and Shift" is a valid starting point, it should be the beginning of your journey, not the end. Plan for iterative improvements to your architecture.
- Security is a Shared Responsibility: No matter which platform you choose, you are responsible for securing the code and the configurations running within that environment.
By following these principles, you will build a resilient, scalable, and cost-effective architecture that supports your business goals rather than hindering them. As you move forward with your migration, return to these steps to ensure that your compute strategy remains aligned with the evolving needs of your application.
Frequently Asked Questions (FAQ)
Q: Can I mix and match compute platforms? A: Absolutely. Most modern architectures are "polyglot" in their infrastructure. You might run your core API on Kubernetes, process background images using serverless functions, and host a legacy database on a dedicated Virtual Machine.
Q: How do I know when to move from VMs to Containers? A: You are ready for containers when you find yourself struggling to manage dependencies across multiple environments (Dev/Test/Prod) or when you need to deploy updates more frequently than your current VM image-creation process allows.
Q: Is serverless always cheaper? A: Not necessarily. For high-volume, consistent workloads, a reserved Virtual Machine is almost always cheaper than a serverless function. Serverless is most cost-effective for spiky, unpredictable, or low-frequency traffic.
Q: How do I avoid vendor lock-in? A: Use open standards like Docker for containers and Terraform for IaC. If your application code is written in a standard language and your infrastructure is defined in a provider-agnostic tool like Terraform, you can migrate to a different cloud provider with significantly less friction.
Q: What is the most important skill for a cloud architect? A: The ability to understand the trade-offs. Every technical decision in the cloud involves a compromise between cost, performance, and management effort. A great architect is one who can clearly articulate why they chose one path over another based on the specific constraints of the project.
Enjoying the courses?
Everything stays free. Pro shows fewer ads, doubles your daily points limit so you progress twice as fast, and lets you read each lesson on one page.
- ✓ Fewer advertisements
- ✓ 2× daily points limit
- ✓ Distraction-free lessons