Latest / Appropriate Proper Reasonable / 138: AWS Compute
Transcript
- 0:00Welcome back to the Deep Dive. Today we are strapping
- 0:03ourselves in really getting into the engine room
- 0:06of the AWS cloud. Yeah, absolutely. Forget databases,
- 0:10storage, networking for a minute. We're focusing
- 0:12just on compute. The core stuff. Exactly. These
- 0:15services, they're the foundation, right? The
- 0:17virtual servers, containers, the places your
- 0:20code actually runs. If compute's the engine,
- 0:23then well... understanding it is like having
- 0:26the driver's manual for a cloud architecture.
- 0:28You just can't build anything scalable or resilient
- 0:32or, you know, cost -effective without getting
- 0:35this layer right. So our mission today is pretty
- 0:38specific. Yeah, we want to give you that critical
- 0:40shortcut, sort of distill the must -know info
- 0:43about EC2, Lambda, ELB, auto scaling. And how
- 0:46they all work together. Exactly. For scalability,
- 0:49elasticity, and crucially, keeping costs down.
- 0:51And for you, listening, this is probably the
- 0:53area to focus on for quick expertise gains. It's
- 0:56not just knowing the names. No, not at all. It's
- 0:58about understanding the trade -offs. The why
- 1:01behind choosing one over another. If someone
- 1:03asks where we run this code, well, the answer
- 1:05is always complex. Always. But for traditional
- 1:08apps, the kind that are always on, the starting
- 1:10point is almost always the same thing, isn't
- 1:12it? It is. Amazon EC2. Elastic compute cloud.
- 1:16Right. When you think virtual machine or server
- 1:18in the cloud, nine times out of 10, you're thinking
- 1:21EC2. Honestly, it's probably the single most
- 1:25important service to really get your head around
- 1:27first. Because it's infrastructure as a service.
- 1:30Exactly. It gives you that secure, resizable
- 1:32compute capacity. Those virtual servers are called
- 1:35instances. It's the closest thing you get to,
- 1:38like, bare metal in the cloud. OK. Let's unpack
- 1:40that, then. EC2, the virtual server. Launching
- 1:44one isn't just a button click, though. You have
- 1:46to define things. The recipe, the power, the
- 1:48access. Right. You need to configure it. We can
- 1:50break it down into three core components you
- 1:53must define. OK. First up, the Amazon machine
- 1:55image, or AMI. AMI. Think of the AMI as the template.
- 2:00It's the recipe for the server's brain, basically.
- 2:02OK. It contains all the software config, the
- 2:05OS, maybe an application server like Apache or
- 2:08applications. It defines what the server actually
- 2:10is. So the AMI sets the software blueprint. Got
- 2:14it. But servers need hardware, too. How do we
- 2:16define the horsepower for this virtual machine?
- 2:19That's the instance type. And this is where.
- 2:21Frankly, architects spend a lot of time optimizing.
- 2:24Makes sense. The instance type determines the
- 2:27whole hardware profile of the computer it's running
- 2:29on. We're talking virtual CPUs, vCPUs, RAM, storage
- 2:33options, network performance. It's the whole
- 2:35package. And it's not just one size fits all,
- 2:38right? AWS has loads of these. Different families.
- 2:41Oh, absolutely. Tons. And knowing the families
- 2:43is key, it often gets glossed over. You really
- 2:46need to pick the right tool for the job. So what
- 2:48are the main ones we should know? Well, The most
- 2:51common you'll bump into are probably the M, C,
- 2:53and R families. MCR, OK. M family, think M for
- 2:57main, or maybe multipurpose. It's general purpose.
- 3:00Good balance of CPU, memory, network. Great starting
- 3:04point for web servers, small databases, that
- 3:06kind of thing. OK, general stuff. Then the C
- 3:08family. C for compute optimized. These are CPU
- 3:11powerhouses, high -performance computing, batch
- 3:14jobs, video encoding, anything that really hammers
- 3:18the processor. Got it. CPU heavy. And conversely,
- 3:22the R family. R for RAM. Memory optimized. These
- 3:25are for things that need loads of memory. Big
- 3:28databases, memory caches, data analytics that
- 3:31chew through RAM. So M for balanced, C for CPU,
- 3:33R for RAM. That makes sense. So if I'm running
- 3:35just a standard website, probably start with
- 3:37an M. But if I'm doing heavy data crunching...
- 3:39You'd look at an R, definitely. Or maybe a C
- 3:42if the crunching is CPU bound. Making that choice
- 3:45right saves money. You're not paying for RAM
- 3:47you don't need. or a CPU you're not using. That
- 3:50makes a lot of sense. Are there other important
- 3:51types? Yeah, a couple of others worth mentioning.
- 3:54The T family, like T2, T3, T4G, those are the
- 3:56burst instances. Burst. Yeah, they have a baseline
- 3:59CPU level but can burst higher for short periods.
- 4:02Great for dev test environments, things that
- 4:03are mostly idle but need occasional power. Very
- 4:06cost effective for that. OK. And then you get
- 4:08into the really specialized stuff. PNG families
- 4:11for machine learning with GPUs, X families for
- 4:14massive memory needs, but MC, R, and T cover
- 4:18a huge range of use cases. Choosing the instance
- 4:21type is fundamentally about performance versus
- 4:24cost. Right. OK, so we have the recipe AMI and
- 4:28the power instance type. We need to weigh in
- 4:31securely. That's the third piece. That's the
- 4:33key pair. absolutely essential for secure admin
- 4:36access, like SSHing into a Linux box or RDPing
- 4:40into Windows. How does that work? It's a pair
- 4:42of cryptographic keys. There's a public key,
- 4:45which AWS stores and puts on the instance when
- 4:47it launches. And then there's a private key.
- 4:48And that's the one I keep. That's the one you
- 4:50keep. And you guard it carefully on your own
- 4:52machine. AWS doesn't keep the private key, lose
- 4:55it, and you can't log in. Oh, OK. And this is
- 4:58a perfect, really clear example of the shared
- 5:00responsibility model. Right. AWS secures the
- 5:03cloud itself. The hardware, the network, the
- 5:05facilities. But I'm responsible for security
- 5:07in the cloud. Exactly. Managing that private
- 5:09key, patching your OS, configuring firewalls.
- 5:12It's on you. That distinction is so important.
- 5:15Okay, let's pivot now. We know what an EC2 instance
- 5:18is, how do we pay for it? Because this is where
- 5:21decisions have huge financial impact for pricing
- 5:25models. Yep, four main ways. And getting this
- 5:27right is, like, foundational for cost optimization,
- 5:31which is a pillar of the well -architected framework.
- 5:33Let's start with the default, the most flexible
- 5:35one, on -demand instances. Simplest model. Pay
- 5:39by the hour, or even by the second now, for Linux
- 5:41instances. Zero upfront commitment. Need capacity.
- 5:45You get it immediately. So when would I use that?
- 5:47Perfect for short term stuff. Irregular workloads.
- 5:50Things you can't predict. Development. Testing.
- 5:53Anything where you need capacity now, you don't
- 5:55want it interrupted, but you don't know how long
- 5:57you'll need it for. But you pay the highest price
- 5:59for that flexibility. You do. It's the baseline
- 6:01rate. OK. So if on -demand is about flexibility,
- 6:03the next one is about commitment for savings.
- 6:05Reserved instances and the newer savings plans.
- 6:08Exactly. This is the core strategy if you know
- 6:11you need servers running long term. Think steady
- 6:13state. predictable workloads. Like my main production
- 6:17web servers. Precisely. If you commit to using
- 6:19compute for a one -year or three -year term,
- 6:23AWS gives you a significant discount, up to 72
- 6:26% off the on -demand price. 72%. That's massive.
- 6:29It really is. And the newer savings plans are
- 6:32generally better, more flexible than the older
- 6:34IIs. How so? Well, traditional IIs locked you
- 6:37into a specific instance, family, size, region,
- 6:40OS. Quite rigid. Savings plans are more flexible.
- 6:43You commit to a certain dollar amount of spend
- 6:46per hour, say $10 an hour, for one or three years.
- 6:49Okay. And that discount applies much more broadly.
- 6:52If you change instance families within that commitment,
- 6:54say from an M5 to an M6, or even move region
- 6:57sometimes, the savings plan discount often still
- 6:59applies. Much easier to manage. So the bottom
- 7:02line, if it runs 247, commit to a savings plan.
- 7:05Absolutely. That's a primary way to save big
- 7:08on predictable usage. Okay, now the extreme end
- 7:10of savings, the one that sounds almost too good
- 7:12to be true, spot instances. Up to 90 % off. Yep,
- 7:16a spot can offer truly massive discounts. You're
- 7:18basically bidding on spare, unused EC2 capacity
- 7:21that AWS has lying around. So what's the catch?
- 7:24There's always a catch with 90 % off. The catch
- 7:26is interruption. Because it's bare capacity,
- 7:30AWS can reclaim it whenever they need it back
- 7:32for on -demand or reserves customers. Reclaim
- 7:34it, like, just turn it off. Pretty much. They
- 7:36give you a two -minute warning and then boom,
- 7:38the instance is terminated. Two minutes? That's
- 7:41not a lot of time. It's not. Which means Spot
- 7:43is only suitable for certain types of workloads.
- 7:46Like, what? How do you use that warning? Your
- 7:49application has to be genuinely fault tolerant
- 7:51and, ideally, stateless. It needs to be able
- 7:55to handle that interruption gracefully, meaning
- 7:58it shouldn't store critical data only on that
- 8:01instance. It needs to be able to, say, checkpoint
- 8:04its work, save its state somewhere durable, like
- 8:07S3 or a database, and shut down cleanly within
- 8:09those two minutes. Then another instance, maybe
- 8:12the spot instance and on -demand one, can pick
- 8:14up where it left off. OK, so things like batch
- 8:16processing, big data jobs, rendering. Exactly.
- 8:21Tasks that can be stopped and restarted without
- 8:24losing everything. Things that are maybe distributed
- 8:26across many instances anyway. If it's your main
- 8:29customer -facing database or a critical web server
- 8:32that absolutely cannot go down unexpectedly.
- 8:34Use Spot. Never use Spot for that. It's a huge
- 8:37architectural trade -off. Stability versus massive
- 8:40cost savings. Got it. Okay, one more pricing
- 8:43model. The niche one. Dedicated hosts. Right.
- 8:47A dedicated host is just what it sounds like.
- 8:49A physical server in an AWS data center that's
- 8:52entirely dedicated to your use. No other AWS
- 8:56customer shares that underlying hardware. Why
- 8:58would someone need that? Isn't the whole point
- 9:00of cloud -shared infrastructure? Usually it's
- 9:02not about cost savings. It's almost always about
- 9:04compliance or licensing. Ah, licensing. Like
- 9:07software that's licensed per physical core? Exactly.
- 9:10Some legacy software, maybe... Bring your own
- 9:12license BYOL scenarios. Have licensing terms
- 9:16tied to physical hardware sockets or cores. Dedicated
- 9:19hosts let you meet those terms. Or, sometimes,
- 9:22very strict regulatory requirements might mandate
- 9:24physical isolation. So it's a compliance tool,
- 9:27not really a cost -saving tool. Primarily, yes.
- 9:29It's more expensive than other options. OK, that
- 9:32covers the single server EC2 really well. But
- 9:35like we said, one server isn't resilient. It
- 9:36can't handle big traffic swings. So we need to
- 9:38move up a level, domain two, scaling and high
- 9:42availability. Right. Moving beyond the single
- 9:44instance to the services that make your application
- 9:47resilient, available, and able to handle fluctuating
- 9:50demand. This naturally brings us to elastic load
- 9:54balancing. The load balancer. So this sits in
- 9:57front of my EC2 instances. Correct. It acts as
- 9:59the single front door, the single point of contact
- 10:01for all your users or clients. Its main job is
- 10:04to take that incoming traffic and distribute
- 10:07it intelligently across your fleet of EC2 instances
- 10:10running the application. Distributing the load
- 10:12makes sense. But it does more than that, right,
- 10:14for availability? Absolutely. Its second key
- 10:17function is ensuring high availability. The best
- 10:19practice is to run your EC2 instances across
- 10:22multiple availability zones, or AZs. And AZs
- 10:25are separate data centers within a region. Physically
- 10:28separate, yes. Independent power, cooling, networking.
- 10:32So the ELB spreads the traffic across instances
- 10:35in, say, AZ1 and AZ2 if something catastrophic
- 10:39happens, and the entire AZ1 goes offline. The
- 10:43load balancer just sends traffic to the instances
- 10:45still healthy in AZ2. Precisely. Your application
- 10:48stays up. That's high availability in practice,
- 10:51enabled by the ELB. You said it's a single point
- 10:53of contact, but there isn't just one type of
- 10:55load balancer anymore, is there? This trips people
- 10:58up. That's a really important point. There are
- 11:00a few types, but the main two you need to understand
- 11:02are the application load balancer, ALB, and the
- 11:05network load balancer, NLB. ALB and NLB. Difference.
- 11:09They operated different layers of the network
- 11:10stack. The ALB works at layer 7, the application
- 11:13layer. Meaning it understands HTTP, HTTPS. Exactly.
- 11:16It's smart. It can look inside the request at
- 11:18the URL path, the host name, HTTP headers, and
- 11:22make sophisticated routing decisions based on
- 11:24that content. Want to send images traffic to
- 11:26one set of servers and AP to another? ALB could
- 11:28do that. perfect for modern microservices or
- 11:31complex web apps. OK. ALB is the smart one for
- 11:34web traffic. What about NLB? NLB operates a layer
- 11:374, the transport layer, TCP UDP. So it doesn't
- 11:40look inside the application request? Nope. It
- 11:42just looks at IP address and port information.
- 11:45It's incredibly fast and designed for ultra high
- 11:48performance, millions of requests per second
- 11:50with very low latency. Because it's simpler.
- 11:53it's faster. Great for TCP traffic, UDP, or situations
- 11:57where you need extreme throughput or a static
- 11:59IP address for your load balancer endpoint. So
- 12:02ALB for smart application routing, NLB for raw
- 12:05speed and throughput. Got it. And the load balancer
- 12:07also checks if the instances behind it are actually
- 12:10working. Health checks. Critically important,
- 12:12yes. The ELB constantly pings its registered
- 12:15targets, your EC2 instances, using configured
- 12:17health checks. Could be checking a specific web
- 12:20page, a port. And if an instance fails that check,
- 12:22maybe the app crashed. The ELB immediately marks
- 12:25it as unhealthy and stops sending any new traffic
- 12:27to it automatically, instantly. It routes traffic
- 12:30only to the healthy instances. This is key for
- 12:32user experience. Nobody wants to hit a dead server.
- 12:35OK, that covers spreading the load and staying
- 12:37highly available. But what about handling those
- 12:39traffic spikes? Staling up for a sale, scaling
- 12:42down overnight, that elasticity part. Ah, that's
- 12:46where the partner service comes in. Amazon EC2
- 12:48auto scaling, ASG. Auto scaling. This is the
- 12:52magic behind true elasticity. And honestly, probably
- 12:56the single biggest cost optimization tool for
- 12:59workloads with variable traffic. ASG automatically
- 13:02adds more EC2 instances that scale out when demand
- 13:06goes up and removes instances scale in when demand
- 13:09drops. So you're only paying for the capacity
- 13:11you actually need right now. Exactly. No more
- 13:13over -provisioning massive fleets just to handle
- 13:15peak load, which was the old data center nightmare.
- 13:18ASG matches capacity to demand dynamically. How
- 13:21do you set it up? You must tell it how to scale.
- 13:23You do. You define an auto -scaling group, and
- 13:27there are three key capacity settings you can
- 13:29figure. The minimum capacity. the absolute smallest
- 13:33number of instances you always want running,
- 13:35maybe for base availability. The maximum capacity,
- 13:38the upper limit, your cost ceiling stops it running
- 13:41away. And the desired capacity, what the ASG
- 13:45should aim for under normal conditions or what
- 13:47it starts with. Min, max, desired, the boundaries.
- 13:51And what actually triggers the scaling? Adding
- 13:53or removing instances. Those are the scaling
- 13:55policies you define the conditions It could be
- 13:57a simple policy like if average CPU across the
- 14:00fleet goes above 70 % for five minutes add two
- 14:03instances Okay, but the more modern and usually
- 14:06recommended approach is target tracking scaling
- 14:09target tracking Yeah, it's much simpler to manage.
- 14:11You just tell the ASG. I want to maintain an
- 14:13average CPU utilization of say 60 % across all
- 14:17instances. And the ESG does the math automatically
- 14:19adding or removing instances as needed to keep
- 14:22that target metric stable. You can target CPU,
- 14:25network traffic, request count per instance from
- 14:27the ELB. It's quite powerful. Oh, that sounds
- 14:30much easier to set the target. It generally is.
- 14:32So we see the synergy here. The ELB takes the
- 14:35incoming traffic, spreads it across AZs for availability.
- 14:38The ASG watches the instances behind the ELB
- 14:42and automatically adjusts the fleet size to match
- 14:45the demand the ELB is seeing based on metrics
- 14:48like CPU. That's a classic bread -and -butter
- 14:51architecture for a scalable, resilient web application
- 14:54on AWS. You see two instances managed by an ASG
- 14:58sitting behind an ELB, usually an ELB. You'll
- 15:00see that pattern everywhere. Okay, but... What
- 15:03if I don't want to manage any of that? No EC2
- 15:05instances, no AMIs, no OS patching, no configuring
- 15:09ASGs. Ah, now you're talking about fundamental
- 15:12shift. That brings us neatly into Domain 3. Serverless
- 15:15compute, and the poster child for that is AWS
- 15:18Lambda. Serverless, which as you always have
- 15:21to point out, doesn't mean no servers. Right.
- 15:23It's a bit of a misnomer. The servers definitely
- 15:24exist. The crucial difference is you don't manage
- 15:26them. AWS handles all the underlying infrastructure.
- 15:29And Lambda is the core service here, function
- 15:31as a service or face. Exactly. Lambda lets you
- 15:34run your code without thinking about provisioning
- 15:36or managing servers at all. What's the key principle?
- 15:38What burden does it lift? Basically everything
- 15:40related to infrastructure management. AWS handles
- 15:43provisioning the compute capacity, the automatic
- 15:46scaling, patching the operating systems, all
- 15:48the underlying administration. You, the developer,
- 15:52just focus on writing the code for your function.
- 15:54That's it. That sounds like a massive reduction
- 15:56in operational work. It is. Huge. And unlike
- 15:59an EC2 web server that's running 24 -7 waiting
- 16:02for requests, Lambda works differently. Fundamentally
- 16:05different. Lambda is event -driven. Event -driven.
- 16:08Meaning... Your Lambda function sits there, dormant,
- 16:11until something triggers it. An event happens
- 16:13in your AWS environment, and that event invokes
- 16:16the function. What kind of events? All sorts.
- 16:19An image file gets uploaded to an S3 bucket,
- 16:21a message arrives on an SQS queue, a record gets
- 16:24updated in a DynamoDB table, a user logs in via
- 16:28Cognito, or very commonly an HTTP request comes
- 16:31in through API Gateway. The function only runs
- 16:33in response to these triggers. It's reactive.
- 16:35Totally reactive. It sleeps until woken up by
- 16:38an event. And that has a huge impact on cost,
- 16:40right? Yeah. The pay -per -use billing. This
- 16:42is the killer feature for cost optimization on
- 16:44intermittent workloads. If your Lambda function
- 16:47isn't running, if it's idle, you pay absolutely
- 16:50nothing. Zero. Wow. You only get charged for
- 16:53two things. The number of times your function
- 16:56is invoked, the number of requests, and the total
- 16:59time your code spends executing, measured in
- 17:01milliseconds. Milliseconds. Down to the millisecond.
- 17:04If your function runs for, say, 500 milliseconds,
- 17:08you pay for exactly 500 milliseconds of compute
- 17:11time. Compare that to an EC2 instance that you
- 17:14pay for 247, even if it's idle 90 % of the time.
- 17:18The efficiency is incredible for the right workload.
- 17:21And scaling. So I'd only get 1 ,000 S3 uploads
- 17:24at once. The scaling is also totally different
- 17:26from EC2. It's automatic and near instantaneous.
- 17:29Lambda has massive built -in concurrency. If
- 17:31the thousand events hit simultaneously, Lambda
- 17:34will try to spin up a thousand parallel execution
- 17:36environments to run your function concurrently
- 17:38to handle that burst. You don't configure min
- 17:40-max instances or scaling policies like with
- 17:42ASG. It just happens. It just handles it. Up
- 17:45to your counts concurrency limits, of course,
- 17:47but those are typically very high. That seamless
- 17:49scaling sounds amazing, but there must be a trade
- 17:52-off. What about performance? Especially for
- 17:55that first request, I've heard about cold starts.
- 17:58Ah, yes, the cold start. That is the main operational
- 18:02trade -off you need to be aware of, especially
- 18:04for latency -sensitive applications. What is
- 18:07it exactly? Well, if your Lambda function has
- 18:10been invoked for a while, AWS might tear down
- 18:13the underlying container or execution environment
- 18:15to save resources. When the next request comes
- 18:18in, Lambda has to do some setup work first. Find
- 18:21capacity, provision the environment, download
- 18:23your code, initialize the runtime. Before your
- 18:26code even starts running. Exactly. That initialization
- 18:29phase is the cold start. It can add latency sometimes
- 18:32just tens or hundreds of milliseconds, but sometimes
- 18:35for complex functions or certain runtimes, it
- 18:37could be a second or two. And that extra latency
- 18:39happens only on the first request after a period
- 18:41of inactivity. Generally, yes, or when scaling
- 18:44up rapidly requires new environments. Subsequent
- 18:47requests to a warm environment are usually much
- 18:49faster. So that cold start latency could be unacceptable
- 18:53for, say, a real -time API endpoint where users
- 18:56expect an instant response. It absolutely could.
- 18:59You're essentially trading potentially higher,
- 19:02unpredictable latency on some invocations for
- 19:05the benefit of lower cost and zero server management.
- 19:07So it's a conscious choice based on the workload's
- 19:10priorities. Always. Is consistent low latency
- 19:12paramount? Maybe EC2 is better. Is cost efficiency
- 19:16and minimal ops overhead the driver? Lambda looks
- 19:18very attractive. This leads us right into the
- 19:21core comparison, EC2 versus Lambda. Let's really
- 19:24nail down the key differences, because this comes
- 19:26up all the time. Definitely. Let's break it down.
- 19:28OK, first, the basic model. EC2 is Infrastructure
- 19:31as a Service, IAS. You rent the virtual server
- 19:34hardware. Lambda is Function as a Service, AAS,
- 19:38or Serverless. You rent code execution time.
- 19:41Server management. With EC2, it's all you. OS
- 19:43patching, installing software, managing scaling,
- 19:46security hardening, Lambda. AWS manages everything
- 19:48under the hood. You just manage your function
- 19:50code. EC2 needs you to configure auto -scaling
- 19:53groups. To find policies, set min -max limits.
- 19:56Lambda scaling is built -in, automatic, instantaneous.
- 19:59Billing. EC2. Pay while it's running, even if
- 20:02idle. You pay for that standby capacity. Lambda.
- 20:06Pay only for requests and execution time in milliseconds.
- 20:10Zero costs when idle. And the big constraint.
- 20:12How long can they run? EC2 instances can run
- 20:15indefinitely, 247 for years if you want. Lambda
- 20:18functions have a maximum execution timeout. Currently,
- 20:21it's 15 minutes. 900 seconds. Only 15 minutes.
- 20:24Yep. If your task takes 16 minutes to complete,
- 20:26lambda is simply not an option. You'd need EC2
- 20:28or maybe containers. OK. So that clearly defines
- 20:31the sweet spot for each, EC2 -4. long -running
- 20:34applications, web servers, APIs needing consistent
- 20:37low -latency databases, anything that needs to
- 20:39run continuously or for longer than 15 minutes,
- 20:42persistent services. That distinction is critical.
- 21:04Get that wrong, and you're either overspending
- 21:06or using the wrong tool. Absolutely fundamental.
- 21:09Okay, moving on. We've done VMs, EC2, functions,
- 21:12Lambda. What about containers? Docker is huge
- 21:14now. Packaging apps and dependencies together.
- 21:17That brings us to domain four. Container services.
- 21:20Right. Containers solve that classic, well, it
- 21:22works on my machine problem by packaging everything
- 21:25needed into a single unit. Ensures consistency.
- 21:28But running containers at scale, that needs management.
- 21:31An orchestrator. And AWS gives us choices for
- 21:34orchestration. Two main ones. First, there's
- 21:36Amazon Elastic Container Service, ECS. ECS. That's
- 21:39AWS's own one. Yep. Their native homegrown container
- 21:43orchestration service. It's highly scalable,
- 21:46fast, and designed for really tight integration
- 21:48with other AWS services like IAM, VPC, load balancers.
- 21:52Often preferred if you're already deep in the
- 21:54AWS ecosystem and want something simpler to manage.
- 21:58than the alternative. And the alternative is?
- 22:00The industry standard, Kubernetes. AWS offers
- 22:04Amazon Elastic Kubernetes Service, EKS. EKS for
- 22:08Kubernetes. Right. EKS is a managed service that
- 22:10lets you run standard open source Kubernetes
- 22:13on AWS without having to deal with the nightmare
- 22:15of installing and managing the Kubernetes control
- 22:17plane yourself, which is notoriously complex.
- 22:21Teams already using Kubernetes or wanting that
- 22:23open source portability, often choose EKS. So
- 22:26ECS is the AWS native way. EKS is the managed
- 22:28open source Kubernetes way. But with both of
- 22:31these, traditionally, you still had to run your
- 22:32containers on something, right? Like on EC2 instances?
- 22:35Exactly. You'd set up ECS or EKS, but then you'd
- 22:37also need to provision and manage a cluster of
- 22:40EC2 instances to actually host your container
- 22:44tasks or pods. You still have to worry about
- 22:47patching those EC2 instances, scaling them with
- 22:49ASG's, optimizing the instance types. Which sounds
- 22:52like we're back to managing servers again, even
- 22:55with containers. It does, yeah. And that's where
- 22:57the real game changer comes in, combining containers
- 22:59with that serverless idea we talked about, AWS
- 23:02Fargate. Fargate. Okay, what is Fargate? Is it
- 23:05another orchestrator? No, that's the key thing.
- 23:08Fargate is not an orchestrator. It's a serverless
- 23:10compute engine that works with both ECS and EKS.
- 23:13A serverless engine for containers? Precisely.
- 23:16When you use Fargate, you completely eliminate
- 23:18the need to provision, manage, patch, or scale
- 23:21that underlying cluster of EC2 virtual machines.
- 23:24How does that work? You just define your container
- 23:26task for ECS or pod for EKS as usual. You specify
- 23:29the CPU and memory resources your container needs.
- 23:32Then you tell ECS or EKS to launch it using the
- 23:35Fargate launch type. And Fargate just runs it
- 23:37without me picking an EC2 instance. Exactly.
- 23:40Fargate finds the capacity and runs your container
- 23:43on fully managed infrastructure. You don't see
- 23:45or manage any EC2 instances at all. It's like
- 23:48Lambda. but for containers. Wow. So the takeaway
- 23:51is Fargate is the serverless way to run containers
- 23:54on AWS using either ECS or EKS as the orchestrator.
- 23:58That's the perfect summary. You choose your orchestrator,
- 24:01ECS or EKS, and then you choose your launch type,
- 24:04either EC2 if you want control over the VMs or
- 24:07Fargate if you want serverless. That feels like
- 24:09a really powerful option for teams who love containers
- 24:12but hate managing VMs. It really is. It simplifies
- 24:15operations massively. Focus on your containers,
- 24:17not the infrastructure they run on. Okay, we've
- 24:20covered the big three execution models. IAS with
- 24:23EC2, FAS with Lambda, and serverless containers
- 24:25with Fargate. Let's quickly touch on Domain 5,
- 24:29other key compute -related services. These seem
- 24:31like tools for specific situations. Yeah, these
- 24:34are more specialized, often providing higher
- 24:36levels of extraction or solving niche problems
- 24:38like location. Let's start with AWS Elastic Beanstalk.
- 24:42I hear this described as Patas platform as a
- 24:44service. That's exactly what it is. Elastic Beanstalk
- 24:47sits between raw IS like EC2 and pure Fados like
- 24:52Lambda. What's its job? Its core function is
- 24:55to make it super easy to deploy and scale standard
- 24:57web applications and services. Think apps written
- 25:00in Java, .NET, PHP, Node .js, Python, Ruby, Go,
- 25:05Docker. Okay, so how does it make it easy? The
- 25:08magic of Beanstalk is abstraction. You basically
- 25:10just upload your application code. My war file
- 25:12or my Python code. Yep. And Elastic Beanstalk
- 25:15automatically handles provisioning and managing
- 25:17the entire underlying environment stack needed
- 25:20to run it. The whole stack, what does that include?
- 25:22It provisions the EC2 instances, sets up the
- 25:25auto scaling group. configures the elastic load
- 25:28balancer, creates security groups, manages application
- 25:31versions, handles deployments like rolling updates
- 25:33or immutable deployments. All of that infrastructure
- 25:36complexity is managed for you based on your application
- 25:39type. So it's using EC2, ASG, ELB under the covers,
- 25:43but hiding the configuration details. Precisely.
- 25:46It abstracts away that lower -level infrastructure
- 25:48configuration, letting developers focus just
- 25:51on writing code, not on wiring together AWS services.
- 25:55So, if you hear about a developer wanting to
- 25:57deploy a web app quickly, needing scaling and
- 25:59load balancing, but explicitly not wanting to
- 26:02manage the underlying AWS resources, Elastic
- 26:05Beanstalk sounds like the answer. It's very often
- 26:08the answer in that scenario. The perfect big
- 26:10yeast is middle ground. Okay. Next up, something
- 26:13quite different. AWS Outposts. This sounds like
- 26:17bringing AWS home. It kind of is. Outposts is
- 26:21a unique service that literally extends AWS infrastructure,
- 26:25the same hardware services, APIs, and tools you
- 26:27use in an AWS region, directly into your own
- 26:30on -premises data center or co -location facility.
- 26:33Why would you need to do that? Isn't the point
- 26:35of cloud not running stuff in your own data center?
- 26:37Usually for two main reasons. Latency or data
- 26:40residency? Latency. Yeah. Imagine you have an
- 26:42application that requires extremely low latency,
- 26:45like single -digit millisecond response times
- 26:47maybe for factory automation or real -time financial
- 26:50trading. The physical distance of the nearest
- 26:52AWS region might introduce too much network latency.
- 26:55Outposts lets you run those AWS services locally
- 26:58right next to your end users or equipment. And
- 27:00data residency. Some industries or countries
- 27:03have very strict regulations that require certain
- 27:05data to physically remain within a specific location,
- 27:09like the customer's own building or country.
- 27:11Outposts allows you to process that data using
- 27:14familiar AWS services while ensuring it never
- 27:17leaves your premises. So outposts is the answer
- 27:20when you need AWS compute locally. Exactly. Cloud
- 27:23infrastructure. on your turf. Okay, one more
- 27:25in this category. Amazon LightSail. This sounds
- 27:28simpler. Much simpler. LightSail is designed
- 27:31to be the absolute easiest way to get started
- 27:33with a virtual private server, VPS, on AWS. Easier
- 27:37than EC2. Way easier. Think of people coming
- 27:39from traditional VPS providers like DigitalOcean
- 27:42or Linode. EC2, with all its auctions, AMIs,
- 27:45instance types, security groups, EBS volumes,
- 27:48VPCs, can be overwhelming for beginners. So how
- 27:50does LightSale simplify it? It bundles everything
- 27:53you need into a single, simple package with a
- 27:55predictable low monthly price. You choose a plan
- 27:57like $5 per month, and it includes a virtual
- 28:00machine with a set amount of CPU, RAM, SSD storage,
- 28:03and data transfer allowance, plus networking
- 28:05and a static IP address. Ah, fixed monthly cost.
- 28:08Very predictable. Very predictable. It's perfect
- 28:11for beginners, students, developers wanting to
- 28:14run a simple website, blog, dev environment,
- 28:17or small application without needing the granular
- 28:20control and potential cost variability of full
- 28:23EC2. Simple fixed price VPS. Got it. Easy mode
- 28:28VPS. Okay, that was a whirlwind tour of the compute
- 28:31landscape. Let's try to bring it all together
- 28:33in Domain 7, Application and Core Cloud Concept
- 28:36Review. How do these services map back to those
- 28:38key cloud pillars we started with? Right, this
- 28:40is where we connect the dots. The pillars guide
- 28:42our choices. Let's start with elasticity, scaling
- 28:45up and down automatically. The key service for
- 28:47EC2 is Amazon EC2 Auto Scaling, ASG. That's what
- 28:51provides the automatic adjustment. For serverless,
- 28:54like Lambda and Fargate, elasticity is built
- 28:56in, handled by the platform. Okay. What about
- 28:59scalability, handling growth over time? For EC2
- 29:02-based applications, scalability is really achieved
- 29:04by the ELB and ASG working together. The ELB
- 29:07distributes increasing load, and the ASG adds
- 29:10instances to handle that load. High availability,
- 29:12running across multiple AZs surviving failures.
- 29:15The linchpin there is the elastic load balancer,
- 29:18ELB. It's what distributes traffic across those
- 29:21multiple AZs and routes around failures. And
- 29:24the big one, cost optimization, getting the best
- 29:27bang for your buck. Here, the choices are critical,
- 29:30using spot instances for fault -tolerant work
- 29:32for massive savings, committing via savings plans
- 29:35or IIs for predictable workloads, or choosing
- 29:38lambda for intermittent tasks to eliminate idle
- 29:41costs entirely. It's about matching the pricing
- 29:43model to the workload pattern. And that final
- 29:45concept, serverless, where AWS manages the infrastructure.
- 29:49That's embodied by AWS Lambda for functions and
- 29:52AWS Fargate for containers, shifting operational
- 29:55responsibility to AWS. Okay, let's make this
- 29:57really concrete. Scenario time. Let's force ourselves
- 30:00to pick the right service. Ready? Let's do it.
- 30:02Scenario one, an e -commerce site. Global traffic,
- 30:05huge spikes during sales, needs to be always
- 30:07up, needs to scale automatically. Okay, variable
- 30:10traffic, high availability needed, automatic
- 30:12scaling. That classic pattern, you need the trifecta.
- 30:15EC2 instances for the compute, managed by an
- 30:18auto -scaling group for the elasticity and cost
- 30:20savings, sitting behind an application load balancer,
- 30:23ALB, for the intelligent traffic distribution
- 30:25and HA across AZs. Makes perfect sense. Scenario
- 30:282, a simple script. Resizes images whenever they
- 30:31land in an S3 bucket. runs for maybe 10 seconds,
- 30:34needs to be super cheap. Keywords, event -driven
- 30:37S3 upload, short execution time 10 seconds, cost
- 30:40is paramount. That screams AWS Lambda. EC2 would
- 30:45be massive overkill and way more expensive because
- 30:47you'd pay for idle time. Lambda only charges
- 30:49for those 10 seconds. Perfect. Scenario 3. A
- 30:52big bank runs an analytics app using Docker containers.
- 30:55The ops team loves containers but hates managing
- 30:57VMs. They want the simplest possible way to run
- 30:59these containers. Containers, yes. No VM management.
- 31:02That points directly to AWS Fargate. They've
- 31:05used Fargate as a launch type with either ECS
- 31:07or EKS as their orchestrator. Serverless containers.
- 31:10Got it. Takes the EC2 burden away. Scenario 4.
- 31:14A developer has a new Ruby on Rails web app.
- 31:17needs HA, load balancing, scaling, the works.
- 31:20But they don't want to mess with cloud formation
- 31:23or manually configure ASGs and ELBs. They just
- 31:26want to deploy the code. They're asking for that
- 31:28platform as a service abstraction. The answer
- 31:31is AWS Elastic Beanstalk. Upload the Ruby code.
- 31:35Beanstalk builds and manages the whole scalable
- 31:38load balanced environment automatically. Excellent.
- 31:40Those scenarios really help crystallize the choices.
- 31:44Well, that brings us towards the end of this
- 31:45deep dive. We've really traced the evolution,
- 31:47haven't we? From managing the virtual machine
- 31:50completely yourself with EC2. Right. Maximum
- 31:52control, maximum responsibility. To outsourcing
- 31:55a lot of that configuration complexity with Elastic
- 31:57Beanstalk. Picking up some control for operational
- 32:00ease. All the way to letting AWS handle basically
- 32:03the entire operational environment for your code
- 32:05with Lambda, Faylis, or Fargate. Minimum operational
- 32:08overhead, maximum focus on code, but with certain
- 32:11constraints like execution time or cold starts.
- 32:13Understanding those three models, IES, PICE,
- 32:16Face Serverless, is really the core takeaway,
- 32:18isn't it? It absolutely is. Because your choice
- 32:21isn't just technical. It's a strategic decision
- 32:23about where your team invests this time and effort,
- 32:27managing infrastructure or building features.
- 32:29And that really sets up our final provocative
- 32:31thought for you, the listener, to mull over.
- 32:34The deepest insight here isn't just knowing what
- 32:36EC2 or Lambda is. It's understanding that every
- 32:39single architectural choice you make, using Spot,
- 32:43accepting a Lambda cold start, paying for a dedicated
- 32:46host. It's all fundamentally a trade -off. A
- 32:49trade -off between operational control on one
- 32:51side and cost optimization on the other. So the
- 32:55question to leave you with is, which of those
- 32:57two sides control or cost matters most to you
- 32:59for your next project or your biggest bottleneck
- 33:01right now? Where are you willing specifically
- 33:03to maybe give up some fine -grained control to
- 33:06slash operational overhead and cost? And conversely,
- 33:09where is that absolute control, maybe over latency
- 33:11or specific hardware, so critical that it justifies
- 33:14the higher cost and management effort? We hope
- 33:16this dive has given you a clearer framework for
- 33:18making those crucial decisions.