Pass AWS Solutions Architect in 4 Hours (Full Course SAA-C03) — Transcript
Full transcript
- 0:00All right, let's talk about something
- 0:01that is no joke one of the most critical
- 0:04concepts in all of AWS. The shared
- 0:06responsibility model. If you want to
- 0:09build secure, reliable systems in the
- 0:10cloud, you absolutely have to get this
- 0:12right. So, let's dive in. So, picture
- 0:15this. You get that call you never want
- 0:17to get. It's 3:00 in the morning. Your
- 0:19company's main app running on AWS has
- 0:22just been breached. Sensitive customer
- 0:24data is everywhere. It's a total
- 0:26nightmare. So after the initial panic,
- 0:28you're left with this one burning
- 0:30question. Who's responsible here? Was it
- 0:33an AWS failure or was it our fault? The
- 0:36answer to that question is all about
- 0:38understanding this shared responsibility
- 0:40model. Okay, so how do we make sense of
- 0:43this? Well, the best way I found is to
- 0:45use a really simple analogy. Just think
- 0:47of AWS as your landlord and you as the
- 0:50tenant. Trust me, this is going to make
- 0:52everything click. It's actually super
- 0:54simple when you think about it. AWS,
- 0:57they're the landlord. They're
- 0:59responsible for the security of the
- 1:00entire apartment building. You know, the
- 1:03main entrance, the security guards, the
- 1:05foundation, making sure the building
- 1:06itself is safe. You, you're the tenant.
- 1:10Your job is security inside your
- 1:12apartment. You're the one who has to
- 1:14lock your front door, decide who gets a
- 1:16copy of your key, and keep your
- 1:17valuables safe. And that right there is
- 1:20the shared responsibility model in a
- 1:22nutshell. It's basically the rental
- 1:24agreement between you and AWS. It's a
- 1:27framework that draws a very clear line
- 1:29in the sand defining exactly what
- 1:31they're responsible for securing and
- 1:33what you are responsible for securing.
- 1:35So let's really nail down these two
- 1:37sides of the deal. AWS is responsible
- 1:40for security of the cloud. That means
- 1:42the physical stuff, their massive data
- 1:43centers, the actual servers, the global
- 1:45network cables, even the software that
- 1:47makes virtualization possible. Now you
- 1:49you're responsible for security in the
- 1:51cloud. This is all about your stuff,
- 1:53your data, your apps, and deciding who
- 1:55has permission to touch any of it. Okay,
- 1:58this is where it gets really
- 1:59interesting, and it's where a lot of
- 2:01people get tripped up. The amount of
- 2:03responsibility you have actually changes
- 2:05depending on which AWS service you use.
- 2:08Let's break that down. Let's start with
- 2:10EC2. Think of this as renting a totally
- 2:13empty, unfernished apartment. AWS gives
- 2:16you a secure space, but what you do
- 2:17inside is on you. You've got to patch
- 2:19the operating system, Windows, Linux,
- 2:22whatever you install. You have to
- 2:23configure the firewalls, what AWS calls
- 2:25security groups. You manage all the
- 2:27users. You encrypt your own data. You
- 2:29install your apps. You have all the
- 2:31control, which you guessed it, means you
- 2:33have all the responsibility. Okay. Now,
- 2:35what about something like RDS, the
- 2:37database service? This is more like
- 2:39renting a furnish department. The
- 2:42landlord, AWS, handles a bunch of the
- 2:44annoying stuff for you. They manage the
- 2:46hardware. They patch the operating
- 2:47system underneath and they even keep the
- 2:49database software up to date. That's a
- 2:51huge weight off your shoulders, but
- 2:53you're still responsible for your own
- 2:55things. You still have to control who
- 2:56can access the database. You still have
- 2:58to encrypt your sensitive data, and you
- 3:00still have to set up the network rules.
- 3:01And finally, we've got S3, the storage
- 3:04service. This isn't even an apartment
- 3:06anymore. It's like a super secure bank
- 3:08vault or storage locker. AWS manages
- 3:10pretty much everything. The hardware,
- 3:12the security of the facility, making
- 3:14sure your data is replicated and safe.
- 3:16It's incredibly robust. Your job is
- 3:18simple, but it is everything. You
- 3:21control the key. You decide who gets in
- 3:23by configuring your bucket policies and
- 3:25AM permissions. All right, enough with
- 3:27the theory. Let's put this to the test
- 3:29with a realworld scenario, something
- 3:31that happens all the time. So, here's
- 3:33the situation. An S3 bucket loaded with
- 3:36sensitive customer files was left wide
- 3:38open to the public. Someone found it.
- 3:40So, who's on the hook for this? Is it
- 3:42AWS's fault or the customers? And the
- 3:45answer, without a doubt, is the
- 3:47customer. Look, AWS did its job. The S3
- 3:50service itself, the storage facility,
- 3:52was rock solid. It wasn't breached. The
- 3:54customer, on the other hand, messed up
- 3:56their part of the deal. They failed that
- 3:58security in the cloud by misconfiguring
- 4:00the bucket policy. They basically left
- 4:02the door to their secure locker wide
- 4:04open with a sign on it saying, "Come on
- 4:06in." Okay, now that you've got the
- 4:07concept, let's just lay out the
- 4:09non-negotiable rules. These are the
- 4:11things that are always true no matter
- 4:12what service you're using. So on the AWS
- 4:15side of the table, they're always going
- 4:17to handle the physical world, the data
- 4:19centers, the hardware, the networking
- 4:20that connects everything. On your side,
- 4:22you are always responsible for your
- 4:24data. That means encrypting it. And you
- 4:26are always responsible for identity and
- 4:28access management. That's AM, which is
- 4:30just a fancy way of saying you control
- 4:32who can do what. You are the ultimate
- 4:34guardian of your data. All right, listen
- 4:36up because this is the classic trap, the
- 4:39number one thing people get wrong. AWS
- 4:42patches the layer under your EC2
- 4:44instance, the virtualization software,
- 4:46but they will never ever log into your
- 4:49virtual server. That means patching the
- 4:51guest OS, your Windows server, your
- 4:53Obunts and Linux. That is 100% on you.
- 4:57Always. Okay, let's bring it all home
- 4:59with a super quick handshake on what we
- 5:01learned. This is the stuff to lock in.
- 5:04Just remember this. AWS is the landlord.
- 5:07You're the tenant. They secure the
- 5:09building. You secure your apartment. AWS
- 5:12handles security of the cloud. You
- 5:14handle security in the cloud. Your slice
- 5:16of the responsibility pie changes
- 5:18depending on what you're renting, a
- 5:19barebones EC2 apartment or a fully
- 5:21managed S3 vault. But no matter what,
- 5:24you always, always control your data and
- 5:26who gets access to it. See, this isn't
- 5:29just some abstract concept. It's a
- 5:31partnership, a handshake. The only way
- 5:33cloud security truly works is if both
- 5:36sides do their part. So, I'll leave you
- 5:38with this. Knowing the rules of the
- 5:39game, how are you going to build your
- 5:41next system to make sure both you and
- 5:43AWS are holding up your end of the deal?
- 5:46All right, let's jump right in. We're
- 5:47talking about something that is no joke
- 5:49one of the most fundamental pieces of
- 5:51AWS identity and access management. You
- 5:53know it as AM. And look, this isn't just
- 5:56important. Getting this stuff right is
- 5:57literally the difference between having
- 5:59a secure cloud and well, a complete
- 6:01disaster just waiting to happen. And you
- 6:03know, it really all comes down to one
- 6:05big question. Imagine you've built this
- 6:07incredible kingdom up in the cloud,
- 6:08right? It's your business. But now you
- 6:11got to let people in and actually do
- 6:12their work. You need to let your team
- 6:14in. Even your applications need to get
- 6:16in. So, how do you hand out the keys
- 6:18without just giving away the keys to the
- 6:20entire castle? Okay, so to figure that
- 6:22out, we have to talk about the very
- 6:24first and honestly the biggest danger
- 6:27you're going to face. I call it the
- 6:29master key problem. See, when you first
- 6:31create an AWS account, you get this one
- 6:33special user, the root user. And let's
- 6:35be super clear, this is not just some
- 6:37admin account. It is the account. It can
- 6:40do absolutely everything. And I mean
- 6:42everything. It can delete your entire
- 6:44AWS setup with just a few clicks. So,
- 6:46using this thing for your day-to-day
- 6:47work, it's probably the single biggest
- 6:49security mistake you could ever make.
- 6:50So, what do you do? You lock it away.
- 6:52You slap multiffactor authentication on
- 6:54it, and you basically promise to never
- 6:55ever touch it again. Okay, so if the
- 6:58master key is totally off limits, what's
- 7:00the plan? Well, simple. We make copies
- 7:02of the key, but limited ones. And that's
- 7:05exactly what an IM user is. It's just a
- 7:07unique identity for one person, say a
- 7:10developer named Sarah, or maybe for a
- 7:12single application. This user gets its
- 7:14own password to log into the AWS console
- 7:17and it also gets a set of access keys
- 7:19and these are long-term keys. They don't
- 7:20expire unless you go in and change them
- 7:22yourself. This is kind of our first most
- 7:24basic tool we've got. All right, so
- 7:27we're making individual users for
- 7:28everyone. Sounds good. Problem solved,
- 7:31right? Eh, not so fast. Because the
- 7:34minute your team starts to grow, you run
- 7:36head first into a whole new problem.
- 7:39Just picture this. You've got 10
- 7:40developers on your team and they all
- 7:42need the exact same permissions to do
- 7:44their jobs. So you could one by one go
- 7:47into all 10 of their user accounts and
- 7:49click click click to attach the same say
- 7:5220 permissions. Then what happens when
- 7:54developer number 11 joins? Yep. You do
- 7:56it all over again. It's super slow. It's
- 7:59mind-numbingly repetitive. And worst of
- 8:01all, it's just asking for someone to
- 8:03make a mistake. It just doesn't scale.
- 8:05And this is exactly why AM groups were
- 8:08invented. Seriously, a group is nothing
- 8:11more than a container for users. That's
- 8:13it. You create a developer group. You
- 8:15attach all the permissions you need to
- 8:17the group and then you just drop your
- 8:19users into it. So, when that new
- 8:21developer Sarah joins, you just add her
- 8:24user to the group and bam, she instantly
- 8:26gets all the permissions she needs. It's
- 8:28so much more efficient. It's consistent
- 8:30and frankly, it keeps you from going
- 8:32insane. So, okay, we've got users for
- 8:35people and groups to manage them as
- 8:37teams. It's a pretty clean system,
- 8:39right? But there's a third piece to this
- 8:42puzzle. It's way more powerful and
- 8:44honestly a lot more interesting. We've
- 8:46got to talk about roles. This is where
- 8:48our nice little system kind of hits a
- 8:50wall. Because what happens when it's not
- 8:52a person that needs access, but an AWS
- 8:54service itself. Think about it. A
- 8:56virtual server, an EC2 instance, isn't a
- 8:59person. It can't log in with a password.
- 9:01Now, you could create an IM user for the
- 9:04server and just store its access keys
- 9:05right there on the machine. But that is
- 9:07the digital equivalent of leaving your
- 9:09house key under the doormat. If that
- 9:11server ever gets hacked, the attacker
- 9:12grabs those keys and they've got
- 9:13everything. That is a huge, huge risk.
- 9:16There has to be a better way. And that
- 9:18better, smarter way is an IM role. Now,
- 9:21here's the absolute key difference you
- 9:23have to get. A role isn't tied to one
- 9:25specific person or one app. Instead,
- 9:27it's a set of permissions that anyone or
- 9:29anything you trust, a user, an app,
- 9:32another AWS service can assume for a
- 9:35little while. The best way to think of
- 9:36it is like putting on a special hat to
- 9:38do a specific job. You put on your S3
- 9:41access hat, you go do your work with S3,
- 9:43and when you're done, you take the hat
- 9:44off. Those permissions were temporary,
- 9:46and AWS handles all the security stuff
- 9:48like rotating the keys for you in the
- 9:50background. It's genius. You know what?
- 9:53Let's make this even simpler with an
- 9:54analogy. I promise this will make it all
- 9:57click. Just imagine your AWS account is
- 10:00a big secure office building. Okay,
- 10:02let's break this down. An IM user,
- 10:05that's like an employee with their own
- 10:06permanent ID badge. It's got their
- 10:08picture on it. It's theirs. It lets them
- 10:10in the front door every day. An IM
- 10:12group, well, that's just the department
- 10:14they work in, like marketing or
- 10:15engineering. Everyone in that department
- 10:17gets access to the same floors. Easy
- 10:19enough. But the IM role, that's the
- 10:22special one. That's like the temporary
- 10:23key card you get from security to go
- 10:25into the server room. You don't get to
- 10:27keep it. You use it for one specific
- 10:28task. You give it back and your access
- 10:30is gone. It's temporary. It's for one
- 10:32job. And that's what makes it so secure.
- 10:35Okay. So, the analogy is great, but
- 10:37let's see how this actually plays out in
- 10:39a real AWS setup because this pattern
- 10:41I'm about to show you is something you
- 10:43are going to see everywhere in
- 10:45well-designed secure architectures. So,
- 10:48here's the classic example. you have an
- 10:50EC2 server and it needs to write some
- 10:52files to an S3 bucket. The old insecure
- 10:54way would be to put an access key on
- 10:56that server. But we're not going to do
- 10:58that. Instead, we create a role that has
- 11:01permission to write to S3. Then we tell
- 11:03our EC2 instance, hey, you are allowed
- 11:06to assume this role. And here's where
- 11:08the magic happens. The EC2 instance
- 11:10talks to a service called STS, the
- 11:13security token service. And STS gives it
- 11:15back a set of temporary credentials. The
- 11:18server uses those keys to talk to S3.
- 11:20They expire after a short time and
- 11:22that's it. What's the big deal here?
- 11:24There are no permanent keys stored on
- 11:26the server ever. That is a massive
- 11:29security win. All right, let's try a
- 11:31quick scenario to really hammer this
- 11:33home. Imagine you get a phone call. It's
- 11:35the one you never ever want to get. One
- 11:37of your lead developers laptops was just
- 11:39stolen. And on that laptop, sitting in a
- 11:41config file is an AWS access key, a
- 11:44permanent one. And this key has full
- 11:46admin access to your company's
- 11:47production database. Yeah, this is a
- 11:50full-blown emergency. So, take a second
- 11:53and think about that. Who's really to
- 11:55blame here? Is it the developer's fault?
- 11:57Is it a bad company policy? Or is
- 11:59something else fundamentally wrong? The
- 12:01real fault? It's the architecture. The
- 12:04fundamental mistake was ever allowing a
- 12:06permanent long-ived access key to live
- 12:08on a developer's machine in the first
- 12:09place. That key was a ticking time bomb
- 12:12just waiting to go off. The right way to
- 12:14do this would be for the developers
- 12:15tools to assume a role. That way, they
- 12:18only get temporary keys that expire in
- 12:20like an hour. So, if the laptop gets
- 12:22stolen, who cares? By the time the thief
- 12:24opens it, the keys are already useless.
- 12:26The risk wasn't the stolen laptop. The
- 12:28risk was created the second a permanent
- 12:30key was used where a temporary roll
- 12:31should have been. Okay, so now that you
- 12:34really understand the why behind all
- 12:35this, let's boil it all down to the most
- 12:37important takeaways and the common traps
- 12:40you need to avoid. All right, first the
- 12:42big takeaways. Users, one entity,
- 12:45long-term keys. Groups, just a way to
- 12:47organize users and make your life
- 12:49easier. Roles, temporary keys for
- 12:52trusted things to do a job. And
- 12:54remember, roles are the best and most
- 12:56secure way to let AWS services talk to
- 12:59each other. And underlying all of this
- 13:01is the golden rule, the principle of
- 13:03least privilege. Only give the absolute
- 13:06minimum permissions needed to get a job
- 13:08done, nothing more. And now for the
- 13:10traps. Trap number one, and you'll see
- 13:12this one everywhere. Somebody puts an IM
- 13:14user's access key onto an EC2 instance.
- 13:16Just don't do it. A role is pretty much
- 13:19always the right answer there. And trap
- 13:21number two is getting groups and roles
- 13:23mixed up. It's easy to do, but they're
- 13:24totally different. Groups organize your
- 13:26users. Roles delegate permissions. They
- 13:29solve two completely different problems.
- 13:31Look, if you forget everything else from
- 13:33this, just remember this one thing.
- 13:35Users are people, groups are teams, and
- 13:39roles are hats. Simple as that. If you
- 13:42can just hold on to that idea, you have
- 13:43truly mastered the foundation of
- 13:45security on AWS. All right, let's talk
- 13:48about one of the single most important
- 13:49ideas in all of cloud security. It's
- 13:52called the principle of least privilege.
- 13:54And look, if you get this one thing
- 13:56right, you are already miles ahead of
- 13:58the game. So, let me ask you a question.
- 14:01What do you think is the one single
- 14:02mistake behind most of the biggest
- 14:04headline grabbing cloud security
- 14:06breaches? I'll tell you, it's almost
- 14:08never some super complex Mission
- 14:09Impossible style hack. The truth, it's
- 14:12usually something way simpler. And it
- 14:14all comes down to giving someone or
- 14:16something way, way too much power. And
- 14:19that right there, that's what brings us
- 14:21to what I call the golden rule of
- 14:23security, the principle of least
- 14:25privilege. If you can really master this
- 14:27one concept, I promise you, you will
- 14:29immediately start building safer,
- 14:31stronger, and more resilient systems on
- 14:33AWS. So, what is it exactly? Well, it's
- 14:36actually a beautifully simple idea. The
- 14:39principle of lease privilege just means
- 14:40you give any user or any application or
- 14:43any service the absolute minimum set of
- 14:46permissions it needs to do its job. And
- 14:48that's it. Nothing more. Not one single
- 14:50extra permission. You can think of it as
- 14:52achieving security through precision.
- 14:54Now, I know that can sound a little
- 14:56abstract, so let's make it super
- 14:58concrete with a simple analogy that's
- 15:00going to make this whole concept just
- 15:01click for you instantly. Let's talk
- 15:03about a hotel key card. Okay, picture
- 15:05this. You check into a hotel, but
- 15:08instead of giving you a key to just your
- 15:09room, the person at the front desk hands
- 15:11you a master key. This thing opens every
- 15:14guest room, the kitchen, the gym, even
- 15:16the manager's private office. I mean,
- 15:19sure, it's convenient, but just think
- 15:20for a second. What happens if you lose
- 15:22that key? What if it falls into the
- 15:24wrong hands? And this right here
- 15:26illustrates the difference perfectly.
- 15:28That master key, that's what we call
- 15:30maximum privilege. It gives you access
- 15:32to literally everything. And one single
- 15:35mistake can compromise the entire
- 15:37system. But your normal room key, that
- 15:39is least privilege. It only grants you
- 15:41access to one specific room and only for
- 15:43a limited time. If you lose it, yeah,
- 15:46it's a pain, but the risk is contained.
- 15:48The blast radius is tiny. Okay, great
- 15:50analogy, right? But how does this
- 15:52actually translate into the real world
- 15:54of cloud architecture? Let's take that
- 15:56whole hotel keycard idea and map it
- 15:59directly to how things work in AWS. It's
- 16:01almost a perfect one toone mapping.
- 16:03Think of it this way. The hotel itself,
- 16:05that's your entire AWS account. The
- 16:07individual rooms, those are your AWS
- 16:09resources. You know, things like S3
- 16:11buckets full of data or your EC2
- 16:13servers. The key card itself, the thing
- 16:15that grants the access in AWS, we call
- 16:17that an AM policy. and the person or
- 16:19service holding that key, that's an IM
- 16:21role or an IM user. And this is where
- 16:24the rubber really meets the road. On the
- 16:26left, you've got that master key policy.
- 16:29Just look at those asterisks, those wild
- 16:31cards. S3/star
- 16:34means all possible S3 actions. Read,
- 16:36write, delete, everything. Resource star
- 16:39means on all of our buckets. Honestly,
- 16:42this is terrifyingly dangerous. But look
- 16:44at the right. That's our room key
- 16:46approach. It allows only one action. get
- 16:48object which is just reading an object
- 16:50and it only allows it on one specific
- 16:52bucket that's secure that's precise that
- 16:55is exactly our goal. So now you get the
- 16:58technical side of it, but as a solutions
- 16:59architect, it's not enough to just know
- 17:01the tech. You also have to understand
- 17:03responsibilities. So let's walk through
- 17:05a really common scenario to see why this
- 17:07is so important. So here's the
- 17:09situation, and I've seen this happen a
- 17:11hundred times. You've got an EC2
- 17:13instance, right? A virtual server. It
- 17:15needs to do one simple thing, read log
- 17:17files from one specific S3 bucket. But a
- 17:20developer on your team is in a hurry.
- 17:22instead of writing a nice tight specific
- 17:24policy, they just grab a pre-made one
- 17:26that gives full admin access to all of
- 17:28S3. Why? Because it's fast, it works,
- 17:30and they move on to the next ticket.
- 17:32Okay, so a few weeks go by, that EC2
- 17:35instance gets compromised by an
- 17:37attacker. And the attacker, seeing this
- 17:39gold mine of permissions, uses that EC2
- 17:42instances overly powerful access to
- 17:44steal sensitive customer data from a
- 17:46completely different S3 bucket. A bucket
- 17:49that instance should have never been
- 17:50able to touch. So the big question is
- 17:52who is responsible for this security
- 17:54failure? And the answer comes down to
- 17:56the AWS shared responsibility model.
- 17:59It's really simple. AWS is responsible
- 18:01for the security of the cloud. That
- 18:03means the physical data centers, the
- 18:05hardware, the networking. But you, the
- 18:07customer, you are responsible for
- 18:09security in the cloud. That means your
- 18:11configurations, your data, and your
- 18:12access policies. So in this scenario,
- 18:14the answer is crystal clear. The
- 18:16responsibility is yours. as the
- 18:18architect, you failed to enforce the
- 18:20principle of least privilege. So, now
- 18:22that you really get the core idea and
- 18:24just as importantly why it matters so
- 18:26much, let's just quickly nail down a few
- 18:28key terms you are absolutely going to
- 18:30run into. First up, IM roles. These are
- 18:34by far the best and most secure way to
- 18:36give temporary permissions to AWS
- 18:38services like an EC2 instance. Then you
- 18:40have IM policies. Those are the actual
- 18:43JSON documents that define the
- 18:45permissions just like we saw. You can
- 18:47also have resource policies which are
- 18:48just policies you attach directly to a
- 18:50resource itself like an S3 bucket. And
- 18:53finally, if you ever need to grant
- 18:54access between different AWS accounts,
- 18:56the secure way to do that is always with
- 18:58roles. All right, let's talk about how
- 19:00this idea often shows up on the exam
- 19:02because there is a very very common trap
- 19:04that a lot of people fall for and I
- 19:06don't want you to be one of them. So
- 19:08here's the trap they'll set for you.
- 19:10They'll give you a scenario and one of
- 19:12the multiple choice answers will be to
- 19:14use a broad pre-made AWS policy,
- 19:17something like Amazon S3 readonly
- 19:19access. And it sounds tempting, right? I
- 19:22mean, read only sounds pretty safe.
- 19:24Wrong. That policy gives read access to
- 19:27every single S3 bucket in your account.
- 19:30The correct answer, the least privilege
- 19:32answer is always the more specific one.
- 19:34Creating a custom customer manage policy
- 19:36that grants access only to the one
- 19:38specific resource that actually needs
- 19:40it. All right, let's bring it all home.
- 19:43If you forget everything else from this,
- 19:45please just remember these three simple
- 19:47steps to applying the principle of least
- 19:48privilege. Step one, always, always
- 19:51start with deny. By default, nobody and
- 19:55nothing should have access to anything.
- 19:57It's a clean slate. Step two, grant
- 20:00specifically from that zero access
- 20:02starting point. You explicitly and
- 20:04surgically add only the exact
- 20:06permissions needed for the job. And step
- 20:09three, use roles. Whenever possible,
- 20:11attach these policies to roles for your
- 20:13AWS services, not to longived static
- 20:16user accounts. So now you get it. You
- 20:19understand the principle. You know why
- 20:21it's so critical, and you know how to
- 20:22build with it from day one. But the
- 20:24final question is, what about the stuff
- 20:26you've already built? How do you go back
- 20:28and fix the problems that already exist?
- 20:30Well, your next step is to go and look
- 20:32into tools like AWS IM Access Analyzer.
- 20:35It's designed to do exactly that to help
- 20:37you find and get rid of all those
- 20:38dangerous master keys that might be
- 20:40lurking in your accounts right now.
- 20:42Today, we are going to nail one of the
- 20:44most important concepts for building
- 20:46secure stuff on AWS, cross account
- 20:48access. And look, this isn't just about
- 20:51passing an exam. This is a skill you're
- 20:53going to use all the time in the real
- 20:55world. So, let's jump right in. So,
- 20:58picture this. Your AWS account is a
- 21:00fortress. It's designed to be completely
- 21:02locked down, and that's a good thing.
- 21:04But what happens when someone else, a
- 21:06partner, a contractor, even another team
- 21:09in your company needs to get inside to
- 21:11do something? You can't just hand over
- 21:12your master keys, right? That would be
- 21:14an absolute security nightmare. So, how
- 21:17do you let them in, but only let them
- 21:19see what they need to see? Here's how
- 21:21we're going to tackle this. First, we'll
- 21:22look at the actual problem. Then we'll
- 21:24build the solution step by step. I've
- 21:26got a really simple analogy that's going
- 21:28to make it all click. Then we'll use it
- 21:29in a real scenario. And finally, we'll
- 21:32wrap up with what you really need to
- 21:33know. Let's do it. So to really get the
- 21:36solution, you've got to understand the
- 21:38problem it's solving. And it all starts
- 21:40with this idea of every AWS account
- 21:42being its own little walled garden. By
- 21:45default, your AWS account is totally
- 21:48isolated. Nothing gets in, nothing gets
- 21:50out. And you need to remember this is a
- 21:52feature, not a bug. It's great for
- 21:54security. It keeps your billing
- 21:56separate, but it also creates our big
- 21:58challenge. How do we work with others
- 22:00across these walls? So the answer is the
- 22:03secure controlled process. You can think
- 22:06of it like a digital handshake between
- 22:08two accounts. And to get how it works,
- 22:10we just need to understand the three
- 22:12pieces that make it happen. Let's break
- 22:14them down. Okay, first piece, the AM
- 22:17role. Now, this is crucial. A role is
- 22:20not a user. A user has permanent keys
- 22:22like a password. A role is well, it's
- 22:25more like a special ID badge or maybe a
- 22:28hat someone can borrow. It's just a set
- 22:30of permissions that someone you trust
- 22:32can temporarily wear to get a job done.
- 22:35So, if the role is the ID badge, then
- 22:37the trust policy, that's the bouncer at
- 22:39the door. Its only job is to check the
- 22:41ID of whoever is trying to get the
- 22:43badge. It asks one simple question. Are
- 22:45you on the list? Do I trust the account
- 22:47you're coming from? If the answer is no,
- 22:49you're not getting in. Simple as that.
- 22:51It's your first line of defense. Okay,
- 22:54so the bouncer lets you in and you've
- 22:56got the badge. Now what? What can you
- 22:58actually do? Well, that's where the
- 23:00permissions policy comes in. This is the
- 23:03rule book that's basically stapled to
- 23:04the ID badge. It lists out very clearly
- 23:07every single thing you're allowed to do.
- 23:10Things like readonly access to this one
- 23:12S3 bucket. This is how we make sure
- 23:15nobody gets more power than they
- 23:17absolutely need. Let's watch the
- 23:19handshake happen. Step one, a user over
- 23:21in account A needs to do something in
- 23:23account B. So, they make a call to a
- 23:25service called AWS STS, the security
- 23:28token service. Think of STS as the
- 23:30office that issues all the temporary ID
- 23:32badges. Step two, STS goes over to
- 23:35account B, finds the role, and checks
- 23:37the trust policy. It talks to the
- 23:38bouncer. It asks, "Hey, do you trust
- 23:40account A?" If the bouncer says yes,
- 23:42we're on to step three. STS creates a
- 23:44brand new set of temporary keys and
- 23:46sends them back to the user. Finally,
- 23:48step four, the user in account A uses
- 23:50those temporary keys to do their work in
- 23:52account B. But, and this is key, they
- 23:54can only do what the permissions policy
- 23:56rulebook allows. Okay, I know that was a
- 23:58bit technical. So, let's use a super
- 24:00simple analogy that will make this whole
- 24:02thing stick in your head for good. Think
- 24:04about your car key, your main key.
- 24:06That's like your permanent AM user. It
- 24:08does everything, right? starts the car,
- 24:10opens the trunk, gets in the glove box,
- 24:12it's yours, and it works forever. But
- 24:14you'd never hand that key to a valet,
- 24:16would you? No way. You give them the
- 24:19valet key. And that is the assumed role.
- 24:22It has super limited powers. It can
- 24:23maybe only start the car and lock the
- 24:25doors. It's temporary. It expires. And
- 24:27the trust you're giving is very specific
- 24:29and very limited. It's the perfect way
- 24:31to think about temporary limited access.
- 24:33All right, you get the pieces. You get
- 24:35the analogy. Now, let's put it into a
- 24:37realworld scenario to see how you'd
- 24:39actually think like an architect. So,
- 24:42here's the situation. An outside
- 24:44auditing company working from their own
- 24:46AWS account needs to read your log files
- 24:50which are sitting in an S3 bucket in
- 24:51your account. To make this happen,
- 24:53somebody has to create the AM role, the
- 24:56trust policy, and the permissions
- 24:58policy. So, who does it? Do you do it in
- 25:00your account or do they do it in theirs?
- 25:02The answer is always always always the
- 25:06account that owns the resources is
- 25:08responsible. Your logs are in your
- 25:10account, account A. So you create the AM
- 25:13role. You write the trust policy that
- 25:15says I trust account B and you attach
- 25:18the permissions policy that says allow
- 25:20read only on this specific bucket. You
- 25:23control your kingdom. You are granting
- 25:24the access. They're just assuming the
- 25:26role you made for them. So now you
- 25:29really get it. you understand how it
- 25:30works and more importantly why it works
- 25:32that way. With that solid foundation,
- 25:34let's just quickly boil it down to the
- 25:36key facts and common traps. Let's lock
- 25:39these in. One, roles are for temporary
- 25:41access. Two, the trust policy is all
- 25:44about who? Three, the permissions policy
- 25:46is all about what? Four, STS is the
- 25:49service that makes the magic happen and
- 25:51hands out the temp keys. And five, the
- 25:53big one for architects, the role is
- 25:55always created in the account that owns
- 25:57the stuff. Now, here is the number one
- 26:00way people get tripped up. They'll give
- 26:02you a scenario and tempt you to create
- 26:03an AM user for an outside person. Don't
- 26:07do it. Users have permanent keys. They
- 26:09belong inside your account. The second
- 26:12you read a question that talks about
- 26:13giving access to another AWS account, a
- 26:16light bulb should go off in your head.
- 26:18The answer is AM roll. It's the right
- 26:20tool for that job every single time. So,
- 26:23let's just say it one more time. Nice
- 26:24and simple. You need to give another
- 26:26account access. Okay, in your account,
- 26:28you create a role. You set the trust
- 26:30policy to point to them. You attach a
- 26:32permissions policy with the rules.
- 26:34That's it. You're done. You now have a
- 26:37rockolid understanding of a core AWS
- 26:40security concept. This opens up all
- 26:42kinds of cool architectures. Centralized
- 26:44logging, security tool, accounts, you
- 26:46name it. So, my question to you is, what
- 26:49are you going to build with this? All
- 26:50right, let's dive into one of the most
- 26:53powerful and honestly one of the most
- 26:55misunderstood tools in all of AWS. We're
- 26:58going to talk about how you govern a
- 27:00massive cloud environment without
- 27:01completely losing your mind. So, just
- 27:04picture this for a second. Your
- 27:06company's taking off. You've got an AWS
- 27:08account for the dev team, one for QA,
- 27:11you've got separate accounts for every
- 27:12single production app. It's starting to
- 27:14get messy, right? How in the world do
- 27:17you enforce one simple security role
- 27:19across all of them at the same time?
- 27:21Because let's be real, without that
- 27:23central control, this is what happens.
- 27:26Some team accidentally spins up a
- 27:28ridiculously expensive server. Another
- 27:30team makes an S3 bucket public without
- 27:32realizing it. And boom, suddenly you're
- 27:34dealing with security holes, shocking
- 27:35bills, and a massive compliance
- 27:37headache. This right here, this is what
- 27:40we call the multi-account problem. And
- 27:42it is a very very real challenge for any
- 27:45company that's scaling on AWS. But
- 27:47luckily AWS has an incredible solution
- 27:50for it. And that solution is AWS
- 27:53organizations. You can think of it as
- 27:55the master control panel for your entire
- 27:57AWS universe. It's a service built
- 28:00specifically for this one job, central
- 28:03governance. And the beauty of it is that
- 28:05it really breaks down into three simple
- 28:07ideas. First off, you get one single
- 28:10bill for all your accounts. Awesome.
- 28:12Second, you can group your accounts
- 28:13together in a way that makes sense. And
- 28:15third, and this is the real gamecher,
- 28:18you can apply central policies to those
- 28:20groups. Okay, so let's get into the nuts
- 28:23and bolts of how that grouping and
- 28:24policy stuff actually works. There are
- 28:27really two key pieces you need to
- 28:29understand. First up, we have
- 28:31organizational units or OUS. And
- 28:33honestly, the easiest way to think about
- 28:35these is just folders. That's it. You
- 28:37make a developers folder and you drag
- 28:39all your developer accounts into it. You
- 28:41make a production folder for your
- 28:42critical apps. Super simple, right? Now,
- 28:45what good are folders if you can't set
- 28:47rules for them? That's where service
- 28:49control policies or SCPs come into play.
- 28:52An SCP is like a set of rules you staple
- 28:55onto one of those folders. And it
- 28:57defines the absolute maximum permissions
- 28:59that anyone or anything in any of those
- 29:02accounts is allowed to have. This right
- 29:04here, this is the single most important
- 29:07idea you need to get. SCPs are not
- 29:09permissions. They are guard rails. They
- 29:12don't have a gas pedal. They don't steer
- 29:13the car. All they do is put up a wall to
- 29:16stop you from driving off a cliff. So,
- 29:18let's put these side by side cuz this is
- 29:20where people get tripped up. An IM
- 29:22policy, that's a permission. It's
- 29:24attached to a user and it says you can
- 29:26launch an EC2 instance. That's the gas
- 29:28pedal. An SCP, on the other hand, is a
- 29:30guardrail. It's attached to the OU and
- 29:33it says nobody in this entire group is
- 29:35ever allowed to do anything outside of
- 29:37the Ireland region. The IM policy lets
- 29:40you go. The SCP defines the road. I am
- 29:43going to say this one more time just to
- 29:46really hammer it home. SCPs
- 29:50do not grant permissions ever.
- 29:54All they do is define what's possible. A
- 29:58user still needs their own AM policy to
- 30:01actually do anything. Okay, enough
- 30:04theory. How does this actually play out
- 30:06in the real world with services we use
- 30:08everyday? Let's take a look. So, let's
- 30:10say you want to control costs. You could
- 30:13slap an SCP on your developer OU that
- 30:15says, "Hey, nobody in here can launch
- 30:18those crazy expensive bare metal
- 30:19instances." That's it. You've just
- 30:21prevented a massive accidental bill. Or
- 30:24maybe for compliance, you say you can
- 30:26only launch EC2 instances in the EU
- 30:29West1 region. Done. Or think about
- 30:31security with S3. This is huge. You can
- 30:35create a master rule for your entire
- 30:37organization that just says no S3 bucket
- 30:40can ever be made public. Period. I mean,
- 30:42think about how powerful that is. It
- 30:45doesn't matter what IM permissions a
- 30:46user has. The guardrail just says no.
- 30:49Okay, so let's put your understanding to
- 30:51the test. Here's a classic scenario that
- 30:53really shows how these two things work
- 30:54together. So you've got a senior
- 30:57developer. You give them an AM policy
- 30:59with allow star. Basically full admin
- 31:02rights. They can do anything they want.
- 31:04But the OU their account lives in has an
- 31:07SCP attached that explicitly says deny
- 31:10S3 star. So the question is can that all
- 31:13powerful developer do anything in S3?
- 31:16The answer is a big fat no. Not a
- 31:20chance. And here's the simple reason
- 31:22why. In the world of AWS permissions, an
- 31:26explicit deny is the ultimate trump
- 31:28card. It always always wins. So when AWS
- 31:32calculates the final permissions, it
- 31:34looks at the IM policy that says allow
- 31:36and the SCP that says deny. And the deny
- 31:39wins every time. The powerful engine in
- 31:42the car doesn't matter if the guardrail
- 31:44is blocking the road. Okay, let's boil
- 31:46all of this down into the absolute must
- 31:49know facts. If you're going to remember
- 31:51anything from this, make it these
- 31:53points. First, AWS organizations is your
- 31:56central control tower. Second, SCPs are
- 31:59just guardrails. They never ever grant
- 32:02permissions. Third, and this one trips
- 32:04people up, they apply to everyone in an
- 32:07account, even the root user. Fourth, an
- 32:09explicit deny is king. It always wins.
- 32:12And finally, just know that by default,
- 32:14everything is allowed. You have to be
- 32:16proactive and add these restrictive
- 32:18guardrails yourself. And here it is.
- 32:21This is the number one trap people fall
- 32:22into. They see an SCP with an allow
- 32:25statement and their brain automatically
- 32:27thinks, "Oh, okay. It's granting
- 32:29permission." It's not. All it's doing is
- 32:32saying the guard rail on this side of
- 32:34the road is open. You still need that
- 32:36separate amic, the car's engine to
- 32:38actually move forward. All right, let's
- 32:41do a super quick recap. The problem,
- 32:43managing tons of accounts is total
- 32:45chaos. The solution, AWS organizations
- 32:48to bring it all under one roof. Your
- 32:50tools, OUS to act like folders and SCPs
- 32:53to set the rules for those folders. And
- 32:55the golden rule, SCPs are just guard
- 32:57rails, not permissions. And a deny will
- 32:59always win. So that leaves us with one
- 33:02final thought. Now that you understand
- 33:05how to build these incredibly powerful,
- 33:07unbreakable guard rails across your
- 33:09entire cloud, what's the very first rule
- 33:11you'd put in place to protect your
- 33:13organization. So imagine this. You've
- 33:16got hundreds, maybe even thousands of
- 33:18employees and they all need access to
- 33:20your AWS account. How in the world do
- 33:22you manage that without creating a huge
- 33:24security risk and just an administrative
- 33:25nightmare? Honestly, this is one of the
- 33:27biggest problems in cloud security and
- 33:29solving it is what separates a truly
- 33:31secure architecture from a really
- 33:32vulnerable one. The solution, it's
- 33:34called identity federation, and we're
- 33:36going to break down exactly how it works
- 33:38right now. So, here's what we're going
- 33:40to cover. We'll start with the login
- 33:42problem itself. You know, why this is
- 33:44even a thing. Then, we'll get into how
- 33:46federation actually works. And I've got
- 33:48a super simple analogy that'll make it
- 33:49click. After that, we'll see how it all
- 33:51plays out on AWS, look at what you need
- 33:53to know for the exam, and then do a
- 33:55quick final recap. All right, let's kick
- 33:58things off by really defining the core
- 34:00problem we're trying to solve here. So,
- 34:02let's just pretend your company has a
- 34:04thousand people. You've got developers,
- 34:06data scientists, managers, the whole
- 34:08crew, and they all need to get into AWS.
- 34:11How do you give them access securely
- 34:13without creating a total mess? What's
- 34:15the first thing that pops into your
- 34:16head? Well, you could just go into the
- 34:18AWS console and manually create 1,000
- 34:21different AM users. But let me tell you,
- 34:24this is an absolute security nightmare.
- 34:26You'd have to manage a thousand sets of
- 34:28passwords and access keys. And what
- 34:30happens when someone leaves the company?
- 34:32You have to remember to go in and
- 34:33manually delete their user. If you
- 34:35forget, which can happen, you've now got
- 34:37what's called an orphaned credential.
- 34:38Basically, an active key just floating
- 34:40out there, which is a massive security
- 34:42risk. There's no central login
- 34:44management. It's just chaos. This whole
- 34:46approach just doesn't scale. So, if the
- 34:48manual way is a disaster, what's the
- 34:51right way? The answer is identity
- 34:53federation. And it's all about building
- 34:55this bridge of trust between your
- 34:58company's system and AWS. At its very
- 35:01core, federation is all about one simple
- 35:04word, trust. It's really just an
- 35:07agreement. Your company basically says
- 35:09to AWS, "Hey, listen. We'll handle
- 35:11figuring out who our employees are. If
- 35:13we say someone is legit, just trust us."
- 35:15And AWS says, "Okay, sounds good. If you
- 35:18vouch for them, we'll let them in based
- 35:20on the rules we have set up on our end."
- 35:22So the process kind of looks like this.
- 35:24First, your employee, let's call her
- 35:25Sarah, she just logs into her normal
- 35:27company portal. Same password she uses
- 35:29every day. Nothing new for her. Now,
- 35:32behind the scenes, her company's system
- 35:34after it makes sure she is who she says
- 35:35she is, generates the special temporary
- 35:38security pass. Then Sarah's browser
- 35:40takes that pass and shows it to AWS. AWS
- 35:43looks at it, sees it came from a trusted
- 35:45source, her company, and boom, lets her
- 35:47in. Now, notice Sarah never enters an
- 35:50AWS password. AWS never ever sees her
- 35:53corporate password. Now, if that still
- 35:56feels a little abstract, don't worry.
- 35:58Let's use a real world analogy that
- 36:00makes this whole thing crystal clear.
- 36:03Okay, imagine your company rented out an
- 36:05exclusive nightclub for a party. To get
- 36:07in, you first have to find your boss
- 36:08standing outside. You show her your
- 36:10company ID badge. That's you
- 36:12authenticating. Your boss recognizes you
- 36:14and gives you a special wristband that's
- 36:16only good for tonight. That wristband,
- 36:18that's your temporary pass. Now you walk
- 36:20up to the club's bouncer who was playing
- 36:22the part of AWS here. You don't show him
- 36:24your company ID. He doesn't need to see
- 36:26it. Doesn't even care what your name is.
- 36:28He just looks at that official
- 36:29wristband, nods, and lets you in. The
- 36:31bouncer trusts the wristband because he
- 36:33trusts your boss who gave it to you.
- 36:35That is federation. Okay, so that's the
- 36:37concept. Now, let's connect that whole
- 36:39nightclub thing to the actual AWS
- 36:41services that make all of this happen.
- 36:44And this really shows the perfect
- 36:45separation of duties. Your company is
- 36:48responsible for authentication. That's
- 36:50just proving who someone is. You manage
- 36:52the user list, the passwords, and the
- 36:54identity provider or IDP. You can think
- 36:56of the IDP as your boss outside the
- 36:58club. It's the system that hands out the
- 37:00wristbands. Meanwhile, AWS is
- 37:02responsible for authorization. That's
- 37:04deciding what someone is allowed to do.
- 37:07They control AM and they define the
- 37:08roles a user can step into or assume
- 37:11like a developer role or an auditor role
- 37:13and all the specific permissions that
- 37:15come with those roles.
- 37:17All right, let's put this to the test
- 37:18with a quick scenario. We have an
- 37:20employee, Jane, who uses Federation to
- 37:23get into an S3 bucket. Today is her last
- 37:25day. The second she walks out the door,
- 37:28HR deactivates her corporate account.
- 37:30So, the big question is, whose job is it
- 37:33to make sure Jane can't get back into
- 37:34that S3 bucket tomorrow? Is it your
- 37:37responsibility or is it AWS's? The
- 37:40answer is it's your responsibility. But
- 37:43here's the beautiful part. You've
- 37:45already done it. Just by deactivating
- 37:47her corporate account, you've cut off
- 37:49her ability to get a wristband. The next
- 37:51time she tries to log in, her company's
- 37:53system will just say, "Sorry, who are
- 37:55you?" And she'll never even get to the
- 37:57point of talking to AWS. AWS doesn't
- 38:00have to do a single thing because it
- 38:01only trusts the people that your system
- 38:03vouches for. You control the single
- 38:05source of truth for who's who. So, now
- 38:07that you actually get the why and the
- 38:09how of it, let's boil this all down to
- 38:11the specific laser focus points you'll
- 38:14need for the exam. First up, Federation
- 38:16uses an external identity provider. This
- 38:19next part is critical. Your users do not
- 38:22have permanent IM user accounts in AWS.
- 38:25Instead, they get temporary credentials
- 38:27from a service called the AWS Security
- 38:29Token Service or STS. With those
- 38:32temporary credentials, they then assume
- 38:34an AM role. And it's that role that
- 38:36holds all the permissions. The key
- 38:39services to have in your head are AM,
- 38:41STS, and AWS IM identity center, which
- 38:44is what helps you manage this whole
- 38:46setup. And here it is, the single
- 38:49biggest trap you can fall into on the
- 38:50exam. They will give you scenarios where
- 38:53you might be tempted to pick an answer
- 38:55that talks about creating or syncing a
- 38:57bunch of AM users from your company
- 38:59system. That is almost always the wrong
- 39:02answer. Remember this, federation is
- 39:04about roles, not users. You map your
- 39:07corporate groups to AM roles and that's
- 39:09it. No individual user accounts are ever
- 39:11created in AWS. All right, let's lock
- 39:14this in for good with a final super fast
- 39:16recap of the whole flow. One, a user
- 39:19logs into their normal company portal.
- 39:22Two, the identity provider sends a
- 39:24secure message to AWS basically saying,
- 39:26"Yep, we've checked this person out.
- 39:28They're good." Three, AWS security token
- 39:31service issues temporary credentials.
- 39:33And four, the user takes those
- 39:34credentials to assume a predefined AM
- 39:37role and gets all the permissions that
- 39:38come with it. It's simple, it's secure,
- 39:41and it's scalable. And that, my friends,
- 39:43is identity federation. But here's a
- 39:46final thought I want to leave you with.
- 39:47This whole idea of granting temporary
- 39:50role-based trust is a really powerful
- 39:52security pattern. It's not just for
- 39:54people. Think about your applications,
- 39:56your EC2 instances, your containers. How
- 39:59could you apply this exact same
- 40:00principle to then so they never have to
- 40:02store long-term credentials? That is the
- 40:05real key to building truly secure
- 40:06architectures on AWS. All right, let's
- 40:09talk about AWS key management service or
- 40:12KMS. And just so we're clear, this isn't
- 40:14just about passing an exam. This is
- 40:16about the one service that can literally
- 40:18be the difference between a secure cloud
- 40:21and a catastrophic data breach. If you
- 40:23get this right, you're building on solid
- 40:25rock. So, picture this. I'm not talking
- 40:28about one or two secret files. Imagine
- 40:31you're a company with a million
- 40:32sensitive customer records, financial
- 40:34reports, you name it. How in the world
- 40:37do you actually protect every single one
- 40:39of them from prying eyes? Because here's
- 40:41the secret. Locking the files, you know,
- 40:43encrypting them. That's the easy part.
- 40:46The real nightmare, the thing that keeps
- 40:47security folks up at night is managing
- 40:49all the keys. If you have a million
- 40:51locked boxes, you now have a million
- 40:53keys. What do you do with them? How do
- 40:55you control who uses them? That's the
- 40:57real problem we need to solve. So, how
- 41:00do we solve this absolute mess of a
- 41:03million keys? Well, the solution is
- 41:05built on one core incredibly clever
- 41:08idea. Let's break it down step by step.
- 41:11Okay, so it starts out super simple. You
- 41:13take your data, which we call plain
- 41:15text. You use a secret key, let's call
- 41:17it a data key, to scramble it all up.
- 41:20And the result is just unreadable
- 41:22garbage to anyone else. We call this
- 41:24cipher text. Easy enough, right? But
- 41:27hold on a second. We've kind of just
- 41:29traded one problem for another, haven't
- 41:31we? See, to unlock that data, you need
- 41:34the data key. So, where do you put it?
- 41:37You can't just store it right next to
- 41:38the encrypted file. That's exactly like
- 41:40locking your front door and leaving the
- 41:42key under the doormat. It's completely
- 41:44pointless. And this this is the
- 41:47brilliant part. What if we use a key to
- 41:50encrypt the key itself? We generate a
- 41:54second way more powerful key. We'll call
- 41:56it a master key. We use that master key
- 41:59to encrypt our little data key. Now we
- 42:02can safely store the encrypted data key
- 42:04right alongside our data. Think about
- 42:06it. It's a locked key for a locked box.
- 42:10A thief can find the key, but they can't
- 42:12use it. So, this whole clever process,
- 42:15it actually has a name and it's called
- 42:17envelope encryption. It's just like
- 42:19putting a secret letter in a locked box
- 42:21and then putting the key to that box
- 42:23inside another even more secure locked
- 42:26box. This is the fundamental idea behind
- 42:28pretty much everything KMS does. Now, to
- 42:31make sure this concept is crystal clear
- 42:32and sticks in your brain forever, let's
- 42:34use an analogy that everybody gets, a
- 42:37bank fault. And check this out. The
- 42:40mapping is just perfect. Your valuable
- 42:42data is the jewelry in your box. The key
- 42:45to your specific safe deposit box,
- 42:47that's your data key. The bank manager's
- 42:49master key, which by the way, never
- 42:51leaves the vault, that's your KMS key.
- 42:53And the entire ultra secure bank vault
- 42:55itself, that's the AWS key management
- 42:58service. Now, here is the most important
- 43:00rule of all. You never get to touch or
- 43:02even see the bank manager's key. You can
- 43:05only ask the manager to use it for you.
- 43:07That separation is the absolute heart of
- 43:09KMS security. Okay, so we've got the
- 43:12theory, we've got the analogy. Now,
- 43:14let's see how this stuff is actually
- 43:15applied all across the AWS cloud.
- 43:18Because believe me, this isn't some
- 43:19niche service. It is everywhere. You
- 43:22know, when you tick that little enable
- 43:23encryption box on an S3 bucket or an EBS
- 43:26volume for your EC2 instance or even an
- 43:29RDS database, this is what's happening
- 43:31behind the scenes. AWS is using KMS to
- 43:35perform envelope encryption on your data
- 43:37whenever it's just sitting there
- 43:38securing everything from your files to
- 43:40your database backups. Now, this is
- 43:42where you have a really crucial choice
- 43:44to make. You can use an AWS managed key.
- 43:47It's easy, it's free, and AWS handles
- 43:50everything for you. Or you can create
- 43:52what's called a customer managed key.
- 43:54Now, with this, you get super granular
- 43:57control. You write the access policies.
- 43:59You can disable the key to instantly
- 44:01shut off access to all your data and you
- 44:03control when it gets rotated. It does
- 44:05cost a little bit per month, but for
- 44:07your most sensitive data, that level of
- 44:09control is absolutely priceless. All
- 44:11right, let's put this new knowledge to
- 44:13the test with a quick real world
- 44:15scenario. This is exactly the kind of
- 44:17situation you'll face as an architect.
- 44:19So, imagine this nightmare scenario. A
- 44:22developer messes up the permissions and
- 44:24an S3 bucket with super sensitive files
- 44:26is now public. Yikes. However, every
- 44:30single object in that bucket was
- 44:31encrypted using a customer-managed KMS
- 44:34key that you control. A hacker stumbles
- 44:36across a direct link to one of your
- 44:39secret files. They click on it. The big
- 44:42question is, can they actually open it
- 44:45and read what's inside? And the answer
- 44:47is a huge resounding no. Your data is
- 44:51completely safe. This is the power of
- 44:53KMS in action. The hacker has the locked
- 44:56box, the file, and they even have the
- 44:58locked key, the encrypted data key. But
- 45:01to unlock that key, they have to go to
- 45:03the bank manager, which is KMS, and ask
- 45:05for permission. And because the hacker
- 45:07is not on your approved access list, KMS
- 45:10will basically slam the door in their
- 45:11face. Access denied. The data stays
- 45:14safe. Okay, now that you really get the
- 45:16why and the how, let's boil this all
- 45:19down into the core principles you need
- 45:20for designing secure architectures.
- 45:23These are the big takeaways. First, KMS
- 45:26is all about centralized control of your
- 45:28keys. Second, it all works because of
- 45:31envelope encryption. And remember, you
- 45:33never see the master key itself. Third,
- 45:36encrypting your data at rest is your
- 45:37best friend for defense. And finally,
- 45:40you have to understand the two layers of
- 45:42permissions. An IM policy is like the
- 45:44security guard at the bank's front door.
- 45:46It controls who can even enter the
- 45:47building to ask for a key. The key
- 45:49policy which is attached directly to the
- 45:51key itself is the bank manager who
- 45:53decides if the person asking is actually
- 45:55authorized to use that specific key. You
- 45:57need both to get access. Speaking of
- 46:00which, there's a very specific trap that
- 46:02catches so many people. Let's make sure
- 46:05you see it coming a mile away. The trap
- 46:08is confusing permission to access the
- 46:10data with permission to use the key.
- 46:12See, a user might have an AM policy that
- 46:15gives them full S3 read access, but if
- 46:17that S3 object is encrypted and they
- 46:19don't also have permission to use that
- 46:21specific KMS key, their request is going
- 46:24to fail. You always always need both.
- 46:26Permission to grab the locked box and
- 46:28permission to ask the manager to help
- 46:30you unlock it. So, let's boil this whole
- 46:33thing down to one single sentence. With
- 46:35KMS, you use a main KMS key that you
- 46:38can't see to encrypt the smaller data
- 46:40keys that are then used to encrypt your
- 46:42actual data. That is envelope encryption
- 46:44in a nutshell. So, I'll leave you with a
- 46:47final thought to chew on. Now that you
- 46:50understand how KMS separates access to
- 46:52the key from access to the data, how
- 46:55would you design a key policy that lets
- 46:56your application, say running on an EC2
- 46:59instance, decrypt data, but explicitly
- 47:02denies that same permission to any human
- 47:04user, even the most powerful
- 47:06administrator. The answer to that, well,
- 47:08that's where true powerful cloud
- 47:10security really begins. All right, let's
- 47:13talk about a choice in AWS that seems
- 47:15really simple on the surface, but is
- 47:17actually one of the most critical
- 47:18security decisions you can make. Secrets
- 47:20manager versus parameter store.
- 47:22Seriously, getting this wrong could be
- 47:23the one thing that leads to a massive
- 47:25security headache. So, let's make sure
- 47:27that never happens to you. So, why do we
- 47:30even need these services in the first
- 47:31place? Well, they exist to solve a huge
- 47:34and honestly a surprisingly common
- 47:36problem in the world of software
- 47:37development. And that problem is the
- 47:39danger of hard coding. And believe me,
- 47:41that is not an exaggeration. Picture
- 47:43this. A developer accidentally pushes
- 47:45some code to a public GitHub repo and
- 47:48buried inside is a database password or
- 47:50an API key. You know what happens next?
- 47:53Automated bots find it sometimes in
- 47:55seconds and start exploiting it. This
- 47:57happens all the time and the fallout can
- 48:00be absolutely catastrophic for a
- 48:02company. So what exactly is hard-
- 48:04coding? It's just what it sounds like.
- 48:06writing your secrets, your passwords,
- 48:08your keys directly into your
- 48:10application's source code. Honestly,
- 48:12it's like taping your house key right to
- 48:13your front door. Yeah, it's convenient
- 48:15for about 5 seconds, but it's a total
- 48:17disaster waiting to happen. So, rule
- 48:19number one of building secure stuff, get
- 48:22your secrets out of your code. Okay, so
- 48:24if we can't put credentials in our code,
- 48:27where in the world do they go? Well, AWS
- 48:29gives us two fantastic options to solve
- 48:31this. the Systems Manager Perimeter
- 48:34Store and AWS Secrets Manager. Now, I
- 48:37know they sound similar, but they are
- 48:38built for fundamentally different jobs.
- 48:40At first glance, you might think they're
- 48:42the same thing. I mean, they both just
- 48:44store key value pairs, right? But it's
- 48:46all about the intent. What are you using
- 48:48it for? Parameters are for your general
- 48:51configuration data, things like an S3
- 48:53bucket name, a URL for an endpoint, or
- 48:55maybe a feature flag. Secrets, on the
- 48:58other hand, are for well, secrets. We're
- 49:01talking about the highly confidential
- 49:02stuff like database passwords and API
- 49:04keys that absolutely must have the
- 49:06highest level of protection. You know
- 49:08what? To really make this click, I've
- 49:10got a simple analogy for you that I
- 49:12promise you will not forget. It's really
- 49:15this simple. Parameter store is your
- 49:17everyday wallet. And Secrets Manager,
- 49:19that's the highsecurity reinforced steel
- 49:21safe deposit box you keep at the bank.
- 49:24Let's break that down. You use your
- 49:26wallet for things you need to get to all
- 49:28the time, right? your debit card, maybe
- 49:30some cash. That's parameter store. It's
- 49:33secure. Don't get me wrong. It's
- 49:34encrypted with AWS's key management
- 49:36service, but it's designed for easy,
- 49:38frequent access. Now, the safe deposit
- 49:40box, that's for your crown jewels, your
- 49:43passport, the deed to your house. Access
- 49:45is super strict. Everything is logged.
- 49:47Everything is audited. That is secrets
- 49:49manager. It's for stuff that doesn't
- 49:51just need to be stored securely. It
- 49:53needs to be managed securely through its
- 49:55entire life cycle. So, diving a little
- 49:57deeper into parameter store, it's
- 49:59actually part of a bigger service called
- 50:01AWS Systems Manager, and it's incredibly
- 50:04versatile. You can organize all your
- 50:05config data into a nice hierarchy, kind
- 50:08of like folders, which is really
- 50:09helpful, and it's super cost-effective.
- 50:11It's really the perfect general purpose
- 50:13tool. It's our wallet. And now for
- 50:15Secrets Manager. This is where we see
- 50:18its true superpower. See, it's not just
- 50:20a place to store secrets. It's a full
- 50:23life cycle management service and its
- 50:26killer feature, the one thing you
- 50:28absolutely have to remember is automated
- 50:30secret rotation. It can literally
- 50:32connect to your RDS database and change
- 50:35the password automatically on a schedule
- 50:37you set, all without a human ever
- 50:39touching it. That is a gamecher for
- 50:41security. Okay, you've got the theory.
- 50:43Let's put it to the test. We're going to
- 50:45walk through a quick practical scenario.
- 50:47This is the kind of thing you'd see in
- 50:49the real world every day. So, the setup
- 50:52is pretty standard. We've got an app. It
- 50:54needs a database password to connect to
- 50:55RDS. But here's the kicker. Here's the
- 50:58critical requirement. Company policy
- 51:00says that password has to be changed
- 51:02automatically every single month. So,
- 51:05what do you think? Based on that one key
- 51:07feature we just talked about, what's the
- 51:09obvious choice here? Yep, it's got to be
- 51:11AWS Secrets Manager. The second you see
- 51:14a requirement for rotation or life cycle
- 51:17management or automatically changing
- 51:19credentials, your brain should just
- 51:21scream secrets manager. Parameter store
- 51:24is great, but it just can't do this on
- 51:25its own. That native rotation capability
- 51:28is the single biggest reason you'd
- 51:30choose one over the other. All right,
- 51:32you get the why behind it now, which is
- 51:34awesome. So, let's just boil this all
- 51:36down into the sharpest, clearest point
- 51:37so you can make the right call every
- 51:39single time. Here are the big tells.
- 51:42First, if a scenario mentions rotation,
- 51:44just stop. It's secrets manager. Period.
- 51:46If the main thing they care about is
- 51:48cost and it's for simple config data,
- 51:50you're probably leaning toward parameter
- 51:52store. If you need that deep
- 51:53integration, like automatically changing
- 51:55a password on an RDS database, that's
- 51:57secrets manager all day long. And the
- 51:59simplest rule of thumb, parameter store
- 52:01is for config. Secrets manager is for
- 52:03credentials. Now, listen up because here
- 52:05is a classic trap. You might see a
- 52:07question that mentions parameter stores
- 52:09advanced tier. Now, this advanced tier
- 52:12is cool. It lets you store way more
- 52:14parameters and use larger values, but
- 52:16it's easy to think it adds more security
- 52:18features, and it doesn't. Advanced
- 52:20parameter store is not a substitute for
- 52:22secrets manager. It does not have
- 52:24automated rotation. Don't let that one
- 52:26fool you. Okay, let's wrap this all up.
- 52:29If you walk away from this remembering
- 52:31just three things, make it these three.
- 52:33First, never ever hardcode credentials.
- 52:37get them out of your code and put them
- 52:39in a managed service. Second, choose the
- 52:42right tool for the job. Your wallet for
- 52:44everyday config, the safe deposit box
- 52:46for your most valuable secrets. And
- 52:48third, the second you see the word
- 52:50rotation, you know the answer is always
- 52:53secrets manager. And that's really the
- 52:55bottom line here. Getting this choice
- 52:57right isn't just about an exam question.
- 52:59It's a fundamental part of designing
- 53:00secure, modern, and reliable
- 53:02applications in the cloud. So, I'll
- 53:04leave you with a question to chew on.
- 53:06Think about your own projects, your own
- 53:08work. Where are you maybe using a simple
- 53:11parameter when you really need the full
- 53:12life cycle management of a true managed
- 53:14secret? It's definitely something to
- 53:16think about. All right, let's dive into
- 53:18one of the most fundamental concepts in
- 53:20all of cloud security. We're talking
- 53:22about the difference between protecting
- 53:23data that's just sitting there versus
- 53:25protecting data that's on the move. And
- 53:27trust me, getting this right is
- 53:29absolutely crucial. So, let's break it
- 53:31all down. Okay, let me ask you a
- 53:33question to get us started. Imagine
- 53:35someone, and I mean physically, breaks
- 53:37into a data center and just walks out
- 53:38with a server. If that server has all
- 53:40your company's most important data on
- 53:42it, is that it? Is it game over? Well,
- 53:44the answer, it really depends entirely
- 53:47on the two ideas we're going to cover
- 53:48right now. See, to really get a handle
- 53:50on the risk, you've got to understand
- 53:51that your data isn't just, you know,
- 53:53data. From a security point of view, it
- 53:56pretty much always exists in one of two
- 53:58states. And each one has its own set of
- 54:00things to worry about. And honestly,
- 54:02it's super simple when you break it
- 54:03down. On one side, you've got data at
- 54:06rest. Just think of this as data that's
- 54:08well at rest. It's sitting there stored
- 54:10on a physical disk, like an object in an
- 54:13S3 bucket or on an EBS volume. It's not
- 54:16going anywhere. Then on the other side,
- 54:18you have data in transit, and that's the
- 54:20total opposite. This is data that's on
- 54:22the move, zipping across the internet
- 54:24from your app to a user's browser, or
- 54:26maybe shuffling between services inside
- 54:28your own network. Okay, so at rest in
- 54:31transit, these terms can feel a little,
- 54:34I don't know, abstract. So, let's use a
- 54:37really simple analogy that'll make this
- 54:38click instantly. A highsecurity bank.
- 54:42So, think of it like this. Data at rest,
- 54:45that's like a pile of cash locked away
- 54:46deep inside a bank vault. It's
- 54:48stationary and it's protected by that
- 54:50big, heavy vault door. Now, data in
- 54:53transit, that's like that same cash
- 54:55being driven across town in an armored
- 54:57truck. It's moving. It's exposed in a
- 54:59totally different way and it needs a
- 55:01completely different kind of protection,
- 55:02right? I mean, you wouldn't try to
- 55:04protect an armored truck by welding a
- 55:05vault door to it and you wouldn't
- 55:07protect the vault by putting wheels on
- 55:08it. Different states, different
- 55:10protection. And this brings us right to
- 55:12our first big idea, encryption at rest.
- 55:15All this means is scrambling your data
- 55:17when it's just sitting on a disc. So, if
- 55:19someone does steal that physical hard
- 55:21drive, all they get is a bunch of
- 55:22unreadable gibberish unless they have
- 55:24the secret key. In our analogy, this is
- 55:27the super complex lock on the bank vault
- 55:29door. The vault itself is tough, but
- 55:31it's the lock that really secures what's
- 55:33inside. So, it makes sense then that
- 55:36encryption in transit is how we protect
- 55:38our data while it's moving. It scramles
- 55:40the data before it gets sent across the
- 55:42network and then unscramles it on the
- 55:43other side. So, if some attacker manages
- 55:45to intercept it mid-flight, all they get
- 55:47is a stream of nonsense. This is the
- 55:50armored plating on our truck. It's the
- 55:51guards inside. It's the protection
- 55:53designed specifically from movement.
- 55:55Okay, so we've got our safe and we've
- 55:58got our armored truck. The concepts are
- 55:59clear. So now let's bring this into the
- 56:02real world. How does this all actually
- 56:04work inside the AWS cloud? What tools
- 56:06does AWS give us for both of these jobs?
- 56:09Okay, for data at rest, our bank vault,
- 56:12the main tool AWS gives you is the key
- 56:15management service or KMS. You can
- 56:18seriously just think of KMS as your own
- 56:20personal highly secure, super resilient
- 56:22master locksmith. It creates and manages
- 56:25the encryption keys that serve as the
- 56:26locks for all your data safes. So where
- 56:29do you actually use this thing? Well, a
- 56:31couple of common places. In Amazon S3,
- 56:34you enable something called serverside
- 56:36encryption with KMS or SSEKMS to protect
- 56:39all the objects in your bucket. And for
- 56:41your EC2 instances, when you're creating
- 56:43an EBS volume, you know, the virtual
- 56:45hard drive, you literally just tick a
- 56:47box that says encrypt this volume.
- 56:49Behind the scenes, both of these super
- 56:51simple actions are using KMS to manage
- 56:53the keys and lock that data down while
- 56:55it's at rest. All right. Now, what about
- 56:57data in transit, our armored truck? The
- 57:00industry standard tech for this is
- 57:01called TLS, which stands for transport
- 57:04layer security. You probably know it by
- 57:06its old name, SSL. It's literally the S
- 57:09in HTTPS that you see in your browser's
- 57:11address bar. What TLS does is create a
- 57:14secure encrypted tunnel for your data to
- 57:16travel through. Now, to use TLS, you
- 57:19need a special thing called a TLS
- 57:20certificate. This is what proves your
- 57:22server is who it says it is, and it
- 57:24allows that secure encrypted connection
- 57:26to get set up in the first place. And
- 57:28the AWS service for this, that's AWS
- 57:30Certificate Manager or ACM. ACM
- 57:33basically handles all the headaches of
- 57:35getting, managing, and deploying these
- 57:37certificates for you. It's the service
- 57:38that provides the unique keys and
- 57:40credentials for your armored truck. And
- 57:42you see this thing in action all over
- 57:44the place. For example, when you attach
- 57:46a certificate from ACM to an elastic
- 57:48load balancer, that's what allows the
- 57:50load balancer to handle all that
- 57:51incoming HTTPS traffic, securing the
- 57:54connection all the way from the user to
- 57:55your infrastructure. Same deal with
- 57:57Amazon CloudFront. You use an ACM
- 58:00certificate to make sure your content is
- 58:01delivered securely over HTTPS to your
- 58:04users, no matter where they are in the
- 58:05world. So AWS gives us the locks and AWS
- 58:10gives us the armored trucks. But this
- 58:12brings up what is probably the single
- 58:14most important question of all, one that
- 58:16plugs directly into the AWS shared
- 58:18responsibility model. Who's actually
- 58:20responsible for, you know, using them?
- 58:23Let's go right back to that scenario
- 58:25from the beginning. A company has a
- 58:27bunch of customer data sitting on an EBS
- 58:29volume. They're in AWS, but they just
- 58:32never bothered to enable encryption on
- 58:33that volume. Then an attacker manages to
- 58:36get into the physical AWS data center
- 58:38and steals the disc. Is that data
- 58:40compromised? What do you think? The
- 58:42answer is absolutely 100% yes. That data
- 58:46is completely exposed. And this is why
- 58:49it is so so critical to understand this.
- 58:51Under the shared responsibility model,
- 58:53AWS is responsible for the security of
- 58:56the cloud. That means the physical
- 58:58buildings, the servers, the networking
- 58:59gear. But you, the customer, are
- 59:01responsible for security in the cloud.
- 59:04AWS gives you the encryption checkbox,
- 59:06but you are responsible for ticking it.
- 59:08They provide the lock, but you have to
- 59:10be the one to turn the key. All right,
- 59:12now that we've got the whole picture,
- 59:14the concepts, the tools, the
- 59:15responsibility, let's boil this all down
- 59:17to the absolute key takeaways you want
- 59:19to have locked in. Okay, here are the
- 59:22core connections you need to have down
- 59:23cold. First, when you see data at rest,
- 59:26data on services like S3 or EBS, your
- 59:29mind should immediately jump to AWS KMS.
- 59:32Second, when you see data in transit,
- 59:34anything about securing network
- 59:35connections, you should be thinking TLS
- 59:37and AWS Certificate Manager or ACM. Just
- 59:40remember, KMS manages encryption keys
- 59:42for stored data. ACM manages TLS
- 59:45certificates for network connections.
- 59:47And the big one, you are always
- 59:49responsible for enabling encryption. And
- 59:51here is the classic exam trap. They love
- 59:54to try and confuse the tools. So, an
- 59:56exam question might suggest, I don't
- 59:57know, using an ACM certificate to
- 1:00:00encrypt an EBS volume. And that's just
- 1:00:02nonsense. That's like trying to use your
- 1:00:04armored truck sign key to open a bank
- 1:00:06vault. Or maybe it'll suggest using a
- 1:00:08KMS key to enable HTTPS on a load
- 1:00:11balancer. Again, wrong tool for the job.
- 1:00:14You have to know which tool belongs to
- 1:00:15the vault and which one belongs to the
- 1:00:17truck. So, let's do one last super fast
- 1:00:20recap to tie it all together. Step one,
- 1:00:22your data is either sitting still in a
- 1:00:24safe that's at rest or it's moving in a
- 1:00:26truck that's in transit. Step two, you
- 1:00:29lock the safe using the keys that are
- 1:00:30managed by AWSKMS.
- 1:00:32Step three, you secure the armored truck
- 1:00:34using TLS and you get the certificates
- 1:00:36for that from ACM. And the most
- 1:00:38important part, step four, remember it
- 1:00:40is always your job to actually turn the
- 1:00:42key and use these tools. So encryption
- 1:00:45is awesome, right? It stops attackers
- 1:00:47from being able to read your data if
- 1:00:48they manage to get their hands on it.
- 1:00:50But that leads to an even deeper
- 1:00:52question for any architect out there.
- 1:00:54What about the people who are authorized
- 1:00:56to see the data? How do you stop them
- 1:00:57from misusing it? How do you control
- 1:00:59what they can and can't do? Well, that's
- 1:01:02a whole other story, and it all comes
- 1:01:03down to identity and access management.
- 1:01:06All right, let's talk about two things
- 1:01:07in AWS that trip up almost everyone.
- 1:01:10Security groups and network ACL. They
- 1:01:13both kind of act like firewalls, right?
- 1:01:15But here's the deal. If you mix them up,
- 1:01:16you could accidentally leave your whole
- 1:01:18application wide open. So, let's get
- 1:01:20this cleared up once and for all. So,
- 1:01:23picture this. Your app is the hottest
- 1:01:25new club in town, and it's running on
- 1:01:27AWS. Every single connection, every
- 1:01:30little packet of data is basically
- 1:01:32someone trying to get in. And that
- 1:01:33brings up the big question, right? Who
- 1:01:35are you going to let pass that velvet
- 1:01:36rope? And who gets told, "Sorry, not
- 1:01:38tonight." Because think about it, in the
- 1:01:41cloud, every single app needs to be a
- 1:01:43fortress. You just can't leave the doors
- 1:01:44unlocked and hope for the best. You've
- 1:01:46got to have layers of defense to control
- 1:01:48exactly who gets to talk to your servers
- 1:01:50and well, what they're allowed to talk
- 1:01:51about. And when you're building that
- 1:01:53fortress in AWS, these are your two main
- 1:01:56tools, security groups and network
- 1:01:58access control lists. We just call them
- 1:02:00knackles. Now, on the surface, they
- 1:02:02sound like they do the exact same thing.
- 1:02:04And that's exactly where everybody gets
- 1:02:05confused. But trust me, they have very,
- 1:02:08very different jobs. And both are super
- 1:02:10important. Okay, to really get this to
- 1:02:12stick, let's just forget all the
- 1:02:14technical stuff for a second. Let's use
- 1:02:16a super simple analogy. Imagine your
- 1:02:18whole setup is like a secure apartment
- 1:02:20complex. You've got a main gatekeeper at
- 1:02:22the entrance to the whole property and
- 1:02:24then you've got a personal bouncer at
- 1:02:25every single apartment door. Let's start
- 1:02:27with the security group. What is it?
- 1:02:29Well, it's basically a firewall for your
- 1:02:32individual server, your EC2 instance.
- 1:02:34It's attached right to it. Think of it
- 1:02:35as your personal uplose and personal
- 1:02:38security detail. So, in our apartment
- 1:02:40analogy, the security group, that's the
- 1:02:42bouncer. He's standing right at the door
- 1:02:44of one specific VIP apartment. His only
- 1:02:47job is to protect that door. He doesn't
- 1:02:50care about what's happening down the
- 1:02:51hall, just his apartment. So, how does
- 1:02:54this bouncer work? Well, first, he's at
- 1:02:56the apartment door, right? That's the
- 1:02:58instance level. Second, and this is
- 1:03:01probably the most important thing to
- 1:03:02remember, he is stateful. What does that
- 1:03:04mean? It means he has a great memory. If
- 1:03:06he lets you in, he remembers you. So,
- 1:03:09when you leave, you can just walk right
- 1:03:10out. The return trip is automatically
- 1:03:12allowed. No one checks your ID on the
- 1:03:14way out. And third, our bouncer is
- 1:03:16pretty positive. He only has an allow
- 1:03:18list. If your name isn't on his list,
- 1:03:20you're not getting in. That's it. Okay,
- 1:03:23so that's the bouncer. Now, let's zoom
- 1:03:26out a bit and talk about the network
- 1:03:27ACL, the NAC.
- 1:03:30This is not personal security for one
- 1:03:32server. Nope. This is the firewall for
- 1:03:35the entire neighborhood or in AWS
- 1:03:37language, your whole VPC subnet. This is
- 1:03:41our gatekeeper. He's standing at the
- 1:03:43main gate to the entire apartment
- 1:03:45complex. So before you can even get
- 1:03:46anywhere near an apartment door to talk
- 1:03:48to one of those bouncers, you have to
- 1:03:49get past this guy first. And this is
- 1:03:52where things get really different. The
- 1:03:54gatekeeper works at the subnet level.
- 1:03:56And he is stateless. That means he has a
- 1:03:59terrible memory, like zero memory. He
- 1:04:02checks your ID when you come in and then
- 1:04:04he checks it all over again when you go
- 1:04:05out, every single time. And another huge
- 1:04:08difference from the bouncer, this
- 1:04:09gatekeeper has both an allow list and a
- 1:04:12denial list. So you can tell him, "Hey,
- 1:04:14let these people in." And you can also
- 1:04:16say, "See that guy? Block him. I don't
- 1:04:18ever want to see him here." So the
- 1:04:19analogy is pretty straightforward,
- 1:04:21right? What's cool is that the AWS
- 1:04:23architecture lines up with it perfectly.
- 1:04:25Let's actually put this on a map and see
- 1:04:27how it all works. Okay, so here's what a
- 1:04:29typical setup looks like. You've got
- 1:04:31your VPC, your virtual private cloud.
- 1:04:33That's your own private walledoff
- 1:04:35section of AWS. Inside that you have a
- 1:04:38subnet. Think of it as a fencedin
- 1:04:39neighborhood. The NACL, that's our
- 1:04:42gatekeeper, acts as the firewall for
- 1:04:44that entire subnet. It is the absolute
- 1:04:46first line of defense. Now, if traffic
- 1:04:48makes it past the NACL, then it has to
- 1:04:50deal with the security group, our
- 1:04:52bouncer, which is wrapped super tightly
- 1:04:53around the individual EC2 instance. You
- 1:04:56see, it's all about layers of security.
- 1:04:58So, let's just lay this all out nice and
- 1:05:00clean. First, scope. The security group
- 1:05:03is focused on just one instance. The
- 1:05:05knackle, it covers the whole subnet.
- 1:05:07Next up, rules. Security groups can only
- 1:05:10have allow rules, but knackles, they can
- 1:05:12have both allow and deny rules. Then
- 1:05:14there's state. And this is the big one.
- 1:05:16Remember, security groups are stateful.
- 1:05:18They remember you. Knackles are
- 1:05:20stateless. They check every single thing
- 1:05:22coming in and going out. And finally,
- 1:05:24what happens right out of the box? Well,
- 1:05:26a brand new security group blocks
- 1:05:28everything by default. It's super
- 1:05:29paranoid. A new knackle on the other
- 1:05:31hand allows everything by default. It's
- 1:05:34way more trusting to start with. Okay,
- 1:05:36theory's done. You've got the concepts.
- 1:05:38Now, let's see how this works in the
- 1:05:39real world. I'm going to give you a
- 1:05:40scenario. You're the architect here.
- 1:05:42You've got to make the call. So, here's
- 1:05:44the situation. You're looking at your
- 1:05:46monitoring dashboard and an alarm goes
- 1:05:48off. There's a specific IP address
- 1:05:50that's a known bad actor and it's just
- 1:05:52hammering one of your web servers over
- 1:05:54and over. You need to shut this down
- 1:05:57now. So, here's my question for you.
- 1:06:00Which tool are you going to grab? What's
- 1:06:02the best choice to block this one single
- 1:06:05IP address from ever reaching any server
- 1:06:07in your subnet? Think about it. Are you
- 1:06:10using the bouncer or the gatekeeper? If
- 1:06:12you said the network ACL, you got it.
- 1:06:15And the why here is the most important
- 1:06:16part. You need to explicitly deny that
- 1:06:19IP address. A security group just can't
- 1:06:22do that. Remember, it only has an allow
- 1:06:24list. It can't say no. Only the NACL,
- 1:06:27our gatekeeper, has the power to create
- 1:06:29a deny rule and say, "Nope, you are not
- 1:06:32allowed in. Period." It blocks them
- 1:06:34right at the front gate of the subnet
- 1:06:36way before they can even get near one of
- 1:06:38the apartment doors. Okay, we have
- 1:06:40covered a lot of ground. So, let's boil
- 1:06:42this down to the absolute mustnoss. If
- 1:06:44you remember nothing else, remember
- 1:06:46these things. Let's lock this in. First,
- 1:06:49security groups are stateful. They have
- 1:06:51a memory. Knackles are stateless. They
- 1:06:53forget everything instantly. Second,
- 1:06:56security groups are for the instance.
- 1:06:57Knackles are for the subnet. And third,
- 1:07:00security groups can only allow. Knackles
- 1:07:02can both allow and deny. Seriously, if
- 1:07:05you just get those three points, you are
- 1:07:0790% of the way there. And look, if there
- 1:07:09is only one thing you remember from all
- 1:07:11of this, please let it be this. Stateful
- 1:07:14versus stateless. The fact that security
- 1:07:16groups remember connections and knackles
- 1:07:18don't. That is the number one reason
- 1:07:20people get confused. If you can get that
- 1:07:22down cold, you've basically mastered
- 1:07:24this whole concept. So, right about now,
- 1:07:27you might be thinking, "Okay, so which
- 1:07:30one do I use?" And that's actually the
- 1:07:32wrong question. See, it's not a choice
- 1:07:34between one or the other. The whole
- 1:07:36point is to use them together. It's all
- 1:07:39part of your security playbook. Real
- 1:07:41solid layered security means you're
- 1:07:43using both. You use the knack, the
- 1:07:46gatekeeper for those big broad rules,
- 1:07:49things like block these known bad IPs
- 1:07:51from the whole neighborhood. Then you
- 1:07:53use the security groups, the bouncers
- 1:07:55for the really specific detailed rules
- 1:07:57like only let web traffic on port 443
- 1:08:01into this specific web server. They're
- 1:08:03designed to work as a team. And there
- 1:08:05you have it. A really clear way to think
- 1:08:07about two of the most important security
- 1:08:09tools in AWS. They're not the same
- 1:08:12thing. They're a team. You've got the
- 1:08:14gatekeeper for the whole neighborhood
- 1:08:16and a bouncer for every single door. So,
- 1:08:18the only question left for you is now
- 1:08:20that you really get the difference, how
- 1:08:22are you going to design your next VPC?
- 1:08:24>> All right, let's talk about something
- 1:08:26that is absolutely fundamental to AWS
- 1:08:29security, public versus private subnets.
- 1:08:32Seriously, getting this one concept
- 1:08:34right, it changes everything. Let's get
- 1:08:37into it. So, why should you care? Well,
- 1:08:40how about this? One single wrong
- 1:08:43setting, one little checkbox can expose
- 1:08:45your entire company's data to the whole
- 1:08:47internet. No joke. This isn't just some
- 1:08:50abstract idea. This is the difference
- 1:08:52between building a digital fortress and
- 1:08:54well, leaving the front door wide open
- 1:08:56with locomat out. If you're building
- 1:08:58anything in the cloud, this is job
- 1:09:00number one. So, let's start from the
- 1:09:03beginning. We're going to break down the
- 1:09:04core difference between public and
- 1:09:06private. We're going to build this from
- 1:09:07the ground up so you really truly get
- 1:09:09not just what it is, but why it all
- 1:09:11works the way it does. Okay, so before
- 1:09:14we can even get to subnets, we got to
- 1:09:16start with the bigger picture. The VPC.
- 1:09:18That stands for virtual private cloud.
- 1:09:20Think of it like this. AWS is this giant
- 1:09:23sprawling digital landscape, right? When
- 1:09:25you create a VPC, you're basically
- 1:09:27carving out your own private isolated
- 1:09:30piece of that landscape. It's your plot
- 1:09:31of land. You put a big fence around it
- 1:09:33and absolutely nothing gets in or out
- 1:09:35unless you are the one who opens the
- 1:09:37gate. Now, on your new plot of land, you
- 1:09:39wouldn't just throw everything into one
- 1:09:41big messy pile. No, you'd create
- 1:09:44different zones, right? You'd have the
- 1:09:46house over here, the front yard over
- 1:09:48there. These zones inside your VPC are
- 1:09:50called subnets. They're just a way for
- 1:09:52you to divide up your network and apply
- 1:09:54different rules to different areas for,
- 1:09:56you guessed it, security. And here it
- 1:09:58is, the single most important
- 1:10:01difference. If you remember one thing
- 1:10:02from this whole explainer, make it this.
- 1:10:05A public subnet can talk directly to the
- 1:10:07internet. A private subnet absolutely
- 1:10:10cannot. It has no direct route. It is
- 1:10:12completely intentionally walled off.
- 1:10:15That's it. Seriously, that is the entire
- 1:10:17game right there. But you know, how does
- 1:10:20that actually work under the hood? It's
- 1:10:22all about two little things. First,
- 1:10:25something called an internet gateway or
- 1:10:27IGW. This is literally the main gate
- 1:10:29from your plot of land out to the public
- 1:10:31road, the internet. Second, every single
- 1:10:34subnet has something called a route
- 1:10:36table. It's just a little rule book,
- 1:10:38like a GPS telling traffic where to go.
- 1:10:41So, for a subnet to be public, its rule
- 1:10:43book simply says, "Hey, any traffic
- 1:10:45trying to get to the internet, send it
- 1:10:47over to the internet gateway." A private
- 1:10:49subnet's rule book, it just doesn't have
- 1:10:51that rule. No rule, no pathway. Simple
- 1:10:53as that. Okay, so that was the technical
- 1:10:56bit. Now, let's make it unforgettable
- 1:10:58with a simple analogy. We're going to
- 1:11:00build a digital fortress. Let's make
- 1:11:03this stick. Imagine your whole setup is
- 1:11:05a digital fortress. Your private subnet,
- 1:11:08that's the house. That's where you keep
- 1:11:09all the good stuff, right? The
- 1:11:10valuables, your databases, your secret
- 1:11:12keys, all that critical data. Now, the
- 1:11:14public subnet, that's like your front
- 1:11:16yard. It's the part of your property
- 1:11:17that's accessible from the street. It's
- 1:11:19where you meet people. And that main
- 1:11:21gate to your property, that's the
- 1:11:22internet gateway. It lets visitors come
- 1:11:24into the front yard, but it does not
- 1:11:26give them a key to the house. So, you
- 1:11:28might be thinking, "Okay, but what if
- 1:11:30the stuff inside my secure house needs
- 1:11:32to get online? Like, what if it needs to
- 1:11:34download a software update?" Well, it
- 1:11:36can't just walk out the front gate.
- 1:11:37That's too risky. This is where a NAT
- 1:11:39gateway comes in. In our fortress
- 1:11:41analogy, think of this like a super
- 1:11:43secure one-way delivery door. It lets
- 1:11:46things go out of the house to the
- 1:11:47internet, but it will never ever let an
- 1:11:49uninvited connection come back in. It's
- 1:11:51outbound only. So, let's put this into
- 1:11:54practice. Where do you put your stuff?
- 1:11:56Your web servers, your EC2 instances
- 1:11:58serving your website, they have to go in
- 1:12:00the public subnet, that front yard. They
- 1:12:02need to be reachable. But your
- 1:12:03databases, the crown jewels with all
- 1:12:05that sensitive user data, they go deep
- 1:12:07inside the house in that private subnet.
- 1:12:10The web servers out in the yard can talk
- 1:12:11to the database in the house, but the
- 1:12:13outside world can't. This is the
- 1:12:15absolute bedrock of secure cloud
- 1:12:17architecture. Okay, quick pop quiz. A
- 1:12:20developer on your team, total mistake,
- 1:12:22launches a brand new database right into
- 1:12:24a public subnet. A week goes by and
- 1:12:27surprise, it gets breached. So, who's
- 1:12:30responsible here? Is that on AWS? The
- 1:12:32answer, and this is a big one, is you
- 1:12:35are 100%. This is all about the AWS
- 1:12:39shared responsibility model. See, AWS
- 1:12:42takes care of security of the cloud. The
- 1:12:44physical buildings, the servers, the
- 1:12:46cables, but you you are responsible for
- 1:12:49security in the cloud. That means your
- 1:12:51network settings, your firewall rules,
- 1:12:53and yeah, your decision about where you
- 1:12:55place your data. That's on you. All
- 1:12:58right. Now that you've got the core idea
- 1:12:59down cold, let's talk about how this
- 1:13:01stuff shows up on the exam. Let's lock
- 1:13:04in exactly what you need to know. Here's
- 1:13:06the cheat sheet. A subnet is public if
- 1:13:08it has a route to an internet gateway.
- 1:13:10period. A private subnet does not. For
- 1:13:13things inside that private subnet to get
- 1:13:15out for, say software updates, they use
- 1:13:17a NAT gateway for outbound traffic only.
- 1:13:20And architecturally, it's always the
- 1:13:22same pattern. Userfacing stuff like web
- 1:13:24servers in the public subnet and the
- 1:13:26important backend stuff like databases
- 1:13:28in the private subnet. Okay, listen up
- 1:13:30because this is a huge exam trap. They
- 1:13:33love to use this one to see if you were
- 1:13:34really paying attention. You might see a
- 1:13:37question where an EC2 instance has a
- 1:13:39public IP address and your brain might
- 1:13:41instantly think, "Oh, public IP, it must
- 1:13:44be public." Wrong. If that instance is
- 1:13:47sitting in a private subnet, one with no
- 1:13:50route to the internet gateway, that
- 1:13:52public IP address does absolutely
- 1:13:54nothing. The instance is totally
- 1:13:56unreachable from the internet. Remember,
- 1:13:58the subnet's route table is king. It's
- 1:14:01the ultimate source of truth. All right,
- 1:14:03let's boil this all down. If you forget
- 1:14:05everything else, just burn these three
- 1:14:07things into your brain. Number one,
- 1:14:10public means one thing and one thing
- 1:14:12only. It has a route to an internet
- 1:14:14gateway. That's the definition. Number
- 1:14:17two, private means it is isolated. It
- 1:14:20has no direct path to or from the
- 1:14:22internet. And number three, this is how
- 1:14:25you build things. Always, always protect
- 1:14:27your valuables, your databases, your
- 1:14:29application secrets by putting them in a
- 1:14:31private subnet. Look, at the end of the
- 1:14:34day, this isn't just about theory. It's
- 1:14:36about how you build things that are safe
- 1:14:38and reliable. You now have the
- 1:14:40foundational knowledge to design a
- 1:14:42secure network from the ground up. So,
- 1:14:44the real question is, what are you going
- 1:14:46to go build?
- 1:14:47>> All right, let's dive into three AWS
- 1:14:50security services that are absolutely
- 1:14:52critical, but let's be honest, can get a
- 1:14:54little confusing. WAFT, Shield, and
- 1:14:57Firewall Manager. We're going to make it
- 1:14:59super simple. So, picture this. You've
- 1:15:01just launched your masterpiece
- 1:15:03application. It's running perfectly on
- 1:15:05AWS. It's fast and your users love it.
- 1:15:08But the second it went live, you painted
- 1:15:10a giant target on its back. The real
- 1:15:13question isn't if you'll face some kind
- 1:15:15of attack. It's what happens when you
- 1:15:17do. Are you ready? To get our heads
- 1:15:20around this, we're going to use one
- 1:15:21simple analogy through this whole thing.
- 1:15:23Imagine your application is the hottest
- 1:15:25nightclub in the city. There's a huge
- 1:15:27line outside and your biggest job is
- 1:15:29managing that crowd to keep everything
- 1:15:31safe and running smoothly. Now, your
- 1:15:33first problem isn't just one or two
- 1:15:35troublemakers. It's the sheer chaos of
- 1:15:37an unruly crowd. Imagine tens of
- 1:15:40thousands of people showing up out of
- 1:15:42nowhere, all trying to smash through
- 1:15:44your front door at the exact same time.
- 1:15:46Your real customers can't even get near
- 1:15:48the place. In the world of AWS, that mob
- 1:15:51is a distributed denial of service
- 1:15:52attack, or DOS for short. Its goal is
- 1:15:55just pure chaos. It wants to flood your
- 1:15:57application with so much garbage traffic
- 1:15:59that your servers get overwhelmed, they
- 1:16:01slow down, and then they crash. And just
- 1:16:03like that, your nightclub is shut down
- 1:16:05for business. So, how in the world do
- 1:16:07you deal with a massive outofcrol mob?
- 1:16:10You don't ask the person taking tickets
- 1:16:12to handle it, right? No, you need some
- 1:16:14serious crowd control. And that's where
- 1:16:17your first line of defense comes in.
- 1:16:19Meet AWS Shield. Think of Shield as your
- 1:16:22club's head bouncer. a really big
- 1:16:24nononsense bouncer. Their one and only
- 1:16:26job is to stand at the front and manage
- 1:16:28the sheer volume of the crowd, making
- 1:16:30sure a stampede never happens. They're
- 1:16:32there to absorb the big brute force
- 1:16:34hits. The cool thing is every single AWS
- 1:16:38customer gets a basic bouncer for free.
- 1:16:39That's Shield Standard. It's on by
- 1:16:41default, protecting you from the most
- 1:16:42common large-scale network attacks. But
- 1:16:45if your nightclub is a high-profile VIP
- 1:16:47spot, you might want to hire an elite
- 1:16:49security team. That's Shield Advanced.
- 1:16:51It's a paid service, but it gives you
- 1:16:53way more sophisticated protection. And
- 1:16:55get this, 24/7 access to AWS's own DOS
- 1:16:58response team if things get really
- 1:17:00hairy. Okay, great. Our bouncer, Shield,
- 1:17:04has handled the huge mob. The flow of
- 1:17:06people is now manageable. But that just
- 1:17:08solves the volume problem. What about
- 1:17:10the kind of people who are in that line?
- 1:17:13See, the bouncer is awesome at stopping
- 1:17:15a stampede, but they aren't looking at
- 1:17:17every single person and inspecting their
- 1:17:18ID. They're not checking to see if
- 1:17:20someone's trying to sneak in with a
- 1:17:22hidden weapon. These are the sneaky
- 1:17:24targeted attacks that hide inside what
- 1:17:26looks like normal traffic. And this is
- 1:17:28where AWS WFT comes in. WAFT is the web
- 1:17:31application firewall. So if Shield is
- 1:17:34the bouncer managing the crowd outside,
- 1:17:36WFT is the detailoriented security guard
- 1:17:38right at the velvet rope inspecting
- 1:17:40every single guest who tries to come
- 1:17:42inside. The way it works is actually
- 1:17:44pretty simple. A request comes into your
- 1:17:47application. WAFT looks at it and checks
- 1:17:49it against a list of rules that you get
- 1:17:51to define. It's like a security
- 1:17:53checklist. Is this person on our block
- 1:17:55list? Does the request look suspicious
- 1:17:57or contain some malicious code? And
- 1:17:59based on those rules, WAFT makes a call.
- 1:18:01Either they're allowed in or they're
- 1:18:03blocked right there. So, what is WFT
- 1:18:05really looking for? Well, it's designed
- 1:18:07to stop nasty stuff like SQL injection,
- 1:18:10which is kind of like someone trying to
- 1:18:11whisper a secret command to your
- 1:18:13bartender to get them to open the cash
- 1:18:15register. or it stops cross-sight
- 1:18:17scripting which is like a guest passing
- 1:18:18a malicious note to another guest. And
- 1:18:20here is the key, you are in control. You
- 1:18:23can write your own custom rules like say
- 1:18:25block all traffic from this specific
- 1:18:27country or you can use pre-built rule
- 1:18:28sets from AWS that protect against all
- 1:18:30the common threats right out of the box.
- 1:18:33Okay, our nightclub is looking pretty
- 1:18:35secure now. Shield is handling the mob
- 1:18:37and WFT is inspecting every single
- 1:18:39guest. But what happens when your
- 1:18:41business takes off? I mean really takes
- 1:18:43off. Suddenly, you don't have just one
- 1:18:45nightclub. You have a global franchise
- 1:18:47with hundreds of locations. Imagine
- 1:18:49trying to make sure that your security
- 1:18:51rules are identical at every single one
- 1:18:53of your hundreds of clubs, which might
- 1:18:55be running in dozens of different AWS
- 1:18:57accounts. It would be a total nightmare.
- 1:19:00A new threat comes out and you have to
- 1:19:01run around telling each security guard
- 1:19:03what to do. No way. This is precisely
- 1:19:06the problem that AWS Firewall Manager
- 1:19:09solves. It's not another bouncer. It's
- 1:19:11not another security guard. It's the
- 1:19:12head of security sitting at the
- 1:19:14corporate headquarters. Their job is to
- 1:19:16write the security playbook and make
- 1:19:17sure every single club follows it to the
- 1:19:19letter. So, here's how it works. From
- 1:19:21one single central AWS account, you
- 1:19:24define your master security policy. You
- 1:19:27say things like all of our applications
- 1:19:29must be protected by these specific DAFF
- 1:19:31rules or every public application must
- 1:19:33have shield advanced enabled. Then you
- 1:19:35apply that policy across your entire
- 1:19:37organization. Firewall Manager just
- 1:19:39takes care of the rest, automatically
- 1:19:41pushing out those rules and making sure
- 1:19:43they're enforced everywhere, even on
- 1:19:44brand new accounts you spin up tomorrow.
- 1:19:47All right, let's lock this in with a
- 1:19:49quick scenario. It's the grand opening
- 1:19:51of your nightclub. The pressure is on.
- 1:19:54Let's see how your team handles the
- 1:19:55heat. First up, out of nowhere, a
- 1:19:58massive flood of bogus traffic tries to
- 1:20:01crash your front door. Whose job is it
- 1:20:03to take that hit and absorb all that
- 1:20:05volume? You got it. That's your bouncer,
- 1:20:08AWS Shield. Okay, next. The crowd is now
- 1:20:12under control, but a single request
- 1:20:13comes in that contains some malicious
- 1:20:15code trying to trick your app. Who's
- 1:20:17inspecting the content of that request
- 1:20:18and stopping it? Yep, that's a job for
- 1:20:21your security guard, AWS WAF. And last
- 1:20:24one, corporate just sent down a memo.
- 1:20:26There's a new no hats rule, and it has
- 1:20:29to be enforced at all 100 of your clubs,
- 1:20:31effective immediately. Who do you call
- 1:20:33to get that rule deployed everywhere
- 1:20:35instantly and consistently? Of course,
- 1:20:38that's the head of security, AWS
- 1:20:40firewall manager. Perfect. Now, let's
- 1:20:43just nail these concepts down with a
- 1:20:45final summary. Getting these
- 1:20:47distinctions right is so important, not
- 1:20:48just for an exam, but for making smart
- 1:20:51architecture choices in the real world.
- 1:20:53This table really says it all. Shield
- 1:20:56protects against DOS attacks, and it
- 1:20:58operates at the network edge. Your main
- 1:21:00job is just to decide if you need to pay
- 1:21:01for the advanced version. WFT protects
- 1:21:04against application layer attacks like
- 1:21:06SQL injection and your job there is to
- 1:21:08define the specific inspection rules.
- 1:21:10And finally, firewall manager protects
- 1:21:13you from having inconsistent security
- 1:21:14policies. Your job is to define those
- 1:21:17central policies that then get applied
- 1:21:18everywhere. Now, listen up because here
- 1:21:21is a classic exam trap. You'll see
- 1:21:24questions that try to trick you into
- 1:21:25thinking WFT can manage rules across
- 1:21:27your whole organization. It can't. Waff
- 1:21:30is the guard at one door doing the
- 1:21:31enforcing. Firewall manager is the boss
- 1:21:34who writes the rulebook and gives a copy
- 1:21:35to all the guards. Just remember that
- 1:21:37difference. W enforces. Firewall manager
- 1:21:40distributes. So if you remember nothing
- 1:21:42else from this, remember these three
- 1:21:44words. Shield is for scale, handling
- 1:21:46huge attacks. W is for substance,
- 1:21:48inspecting the content of individual
- 1:21:50requests. And firewall manager is for
- 1:21:52strategy, deploying your security plan
- 1:21:54everywhere. Scale, substance, and
- 1:21:57strategy. You get that and you've got
- 1:21:58this.
- 1:21:59>> Okay, let's be honest. Cloud Trail and
- 1:22:01AWS Config, they can be a little
- 1:22:04confusing, right? But getting them
- 1:22:06straight isn't just about passing an
- 1:22:07exam. It's absolutely fundamental to
- 1:22:09knowing what's actually happening inside
- 1:22:11your AWS account. So, today we're going
- 1:22:13to make sure you understand these two
- 1:22:15critical services once and for all.
- 1:22:18Here's what we're going to do. We'll
- 1:22:19start with the problem we're all trying
- 1:22:21to solve. Then, we'll meet our two
- 1:22:23security detectives. I've got a super
- 1:22:25simple analogy that'll make it all
- 1:22:27click. We'll put them to work in a real
- 1:22:29scenario, cover what you really need to
- 1:22:31know, and then finish up with a quick
- 1:22:33debrief. Sound good? Let's go. All
- 1:22:35right. First up, the security blind
- 1:22:38spot. We have to understand the why
- 1:22:40before we get to the what. I want you to
- 1:22:42imagine this for a second. You get an
- 1:22:44alert. A critical S3 bucket, the one
- 1:22:47with all the sensitive customer data was
- 1:22:49just made public. Your heart just stops,
- 1:22:52right? The first questions screaming in
- 1:22:55your mind are, "Who did this and when
- 1:22:57did it happen?" Without the right tools,
- 1:22:59you are totally flying blind. This is
- 1:23:01the exact problem we're here to solve.
- 1:23:04So, to solve mysteries like this, AWS
- 1:23:06gives us two specialized detectives.
- 1:23:09Let's meet them. Cloud Trail and AWS
- 1:23:11Config. Now, they work together, but
- 1:23:13you've got to understand they have very,
- 1:23:15very different jobs. First up is Cloud
- 1:23:17Trail. The easiest way to think about
- 1:23:19Cloud Trail is that it's the official
- 1:23:21recordkeeper. It's focused on the who,
- 1:23:23what, and when. For every single action
- 1:23:25taken in your account. You know,
- 1:23:27anything that happens through an API
- 1:23:28call. And in AWS, pretty much everything
- 1:23:31is an API call. Cloudt trail is there
- 1:23:34logging it. It's all about the actions.
- 1:23:37And the way it works is actually
- 1:23:39beautifully simple. So a user or maybe a
- 1:23:42service makes an API call. Let's say run
- 1:23:44instances to fire up an EC2. Cloud trail
- 1:23:47immediately grabs all the details of
- 1:23:49that call. who did it, what time it was,
- 1:23:51their IP address. Then it just writes
- 1:23:53that event into a log file and drops it
- 1:23:55securely into an S3 bucket that you
- 1:23:57control. It's just a non-stop
- 1:23:59chronological paper trail of everything.
- 1:24:02Okay, now for our second detective, AWS
- 1:24:04config. And this is where it gets
- 1:24:07interesting. If Cloud Trail is all about
- 1:24:09the action, config is all about the
- 1:24:11state of your resources. Its whole job
- 1:24:14is to ask, hey, is this thing built
- 1:24:16right? Is it configured according to my
- 1:24:18rules? It's not watching the actions
- 1:24:20happening. It's inspecting the results
- 1:24:22of those actions. So, how does config do
- 1:24:26its thing? Well, whenever a resource
- 1:24:28changes, like a security group gets
- 1:24:30updated, config swoops in and takes a
- 1:24:32snapshot of its new setup. This snapshot
- 1:24:35is called a configuration item. Then,
- 1:24:38and this is the magic part, config looks
- 1:24:40at that snapshot and compares it against
- 1:24:42the rules you've defined, like, hey, no
- 1:24:44security groups should allow port 22
- 1:24:46open to the world. It then flags that
- 1:24:48resource as either compliant or you
- 1:24:50guessed it, non-compliant. Okay, this
- 1:24:52slide right here, this is the whole
- 1:24:54ballgame. This is what you really need
- 1:24:56to lock in. Cloud trail is all about
- 1:24:59actions, the API calls. It answers who
- 1:25:02did what and when. It's for auditing and
- 1:25:05forensics. AWS config on the other hand
- 1:25:08is all about the resource state, its
- 1:25:10configuration. It answers what does my
- 1:25:12stuff look like right now and is it
- 1:25:14compliant? It's for well compliance.
- 1:25:17See, two different detectives, two
- 1:25:19totally different jobs. All right, so
- 1:25:21that's the technical breakdown. But to
- 1:25:23make this difference really truly stick
- 1:25:24in your brain, you can't beat a good
- 1:25:26analogy. I want you to think of Cloud
- 1:25:29Trail as your building's CCTV system. It
- 1:25:31records every single thing that happens.
- 1:25:34It sees who came in the door, what time
- 1:25:35they came in, which door they used. It
- 1:25:37doesn't care if they were supposed to be
- 1:25:39there. It just records the facts. It
- 1:25:41gives you an unchangeable chronological
- 1:25:43video log of every single action. Now,
- 1:25:46AWS Config, totally different job.
- 1:25:49Config is the building inspector. The
- 1:25:51inspector doesn't sit there watching the
- 1:25:53CCTV tapes all day. Nope. They show up
- 1:25:56with a clipboard and a checklist. Those
- 1:25:58are your config rules. They walk through
- 1:26:00the building and check its current state
- 1:26:02against the building code. Is the fire
- 1:26:04and zip locked? Are the sprinklers
- 1:26:05working? They're assessing the state of
- 1:26:07the building to see if it's up to code.
- 1:26:09Okay. analogy locked in. Let's step out
- 1:26:12of the building and get back into the
- 1:26:13AWS console to see how our two
- 1:26:15detectives work together on a realworld
- 1:26:17resource. Let's take something super
- 1:26:20common, an EC2 instance. Here's how
- 1:26:22they'd split up the work. Cloud Trail is
- 1:26:24going to tell you who made the run
- 1:26:26instances API call to launch it or who
- 1:26:28ran stop instances to shut it down. It's
- 1:26:30tracking the verbs, the actions. AWS
- 1:26:33config, meanwhile, is checking the
- 1:26:35adjectives, the state. It's answered
- 1:26:37questions like, "Is this a T2 micro like
- 1:26:39our policy says it should be? Does it
- 1:26:40have the project blue tag? Is the
- 1:26:42storage attached to it encrypted?" All
- 1:26:44right, time for a quick mini scenario. A
- 1:26:48developer, maybe they're trying to speed
- 1:26:50something up, changes a small T2.micro
- 1:26:53test instance into a monstrously
- 1:26:54expensive M5.24x
- 1:26:57large. This totally violates your
- 1:26:59company's policy on which instance types
- 1:27:01you're allowed to use for development.
- 1:27:03So, which service tells you what? Take a
- 1:27:06second. Which one tells you that the
- 1:27:07modify instance attribute API call was
- 1:27:09made by that developer at 2:15 in the
- 1:27:11afternoon? Well, that's the action,
- 1:27:13right? So that's cloud trail. And which
- 1:27:15service tells you that the EC2 instance
- 1:27:17is now in a non-compliant state because
- 1:27:18its instance type is wrong? That's the
- 1:27:20state. So that's AWS Compig. You see,
- 1:27:22this shows you perfectly why you need
- 1:27:24both to get the whole story. Okay. Now
- 1:27:26that you actually get how they work and
- 1:27:28why they're different, let's just
- 1:27:30crystallize this into the core concepts
- 1:27:32you're going to need, whether it's for
- 1:27:33an exam or just a design review at work,
- 1:27:36let's just hammer these home. Cloudtrail
- 1:27:38is for auditing API activity. Full stop.
- 1:27:41AWS config is for checking resource
- 1:27:43compliance and looking at configuration
- 1:27:44history. Cloudtrail answers the
- 1:27:46question, who did that? Config answers,
- 1:27:48is this thing configured correctly? And
- 1:27:50maybe most importantly, in the real
- 1:27:52world, you almost always use them
- 1:27:54together to get that complete security
- 1:27:55picture. Now, let's talk about the
- 1:27:57classic exam trap, cuz they love to do
- 1:28:00this. They will write questions to try
- 1:28:02and make you mix these two up. So,
- 1:28:05here's your mental trigger. If the
- 1:28:06question is asking about auditing an
- 1:28:08action or finding out who did something,
- 1:28:11you should immediately think cloud
- 1:28:13trail. If the question is about
- 1:28:14evaluating compliance or checking if a
- 1:28:17resource meets a certain configuration,
- 1:28:19your brain should go straight to AWS
- 1:28:21config. Action versus compliance. That's
- 1:28:24the whole game.
- 1:28:25Fantastic. Let's wrap this whole thing
- 1:28:27up with a super quick debrief just to
- 1:28:29make sure this knowledge is locked in
- 1:28:31for good. Just remember our two
- 1:28:33detectives. You've got Cloud Trail, the
- 1:28:35event detective. That's your CCTV just
- 1:28:38watching everything that happens. And
- 1:28:40you've got AWS Config, the compliance
- 1:28:42inspector. That's your building
- 1:28:44inspector checking to make sure
- 1:28:45everything is in order. And when you use
- 1:28:47them together, you get the complete
- 1:28:49story. Cloud trail tells you the action
- 1:28:52that took place and config tells you
- 1:28:54about the resulting state and whether or
- 1:28:56not that state is okay. That right there
- 1:28:59is total visibility. So the last
- 1:29:02question I'll leave you with is this.
- 1:29:04Now that you have your detectives and
- 1:29:05you know the unique evidence that each
- 1:29:07one provides, how are you going to use
- 1:29:09them together? Not just to solve
- 1:29:10problems after they happen, but to
- 1:29:12proactively design and build truly
- 1:29:14secure and compliant architectures from
- 1:29:16day one. Let's talk about one of the
- 1:29:18most fundamental concepts in AWS.
- 1:29:21Multi-AZ versus multi-reion. And trust
- 1:29:24me, understanding this isn't just about
- 1:29:26passing an exam. It's about knowing how
- 1:29:28to build something that doesn't fall
- 1:29:29over when things go wrong. Let's dig in.
- 1:29:32Okay, picture this. It's 3:00 a.m. and
- 1:29:34your phone starts buzzing. The site is
- 1:29:36down. The database is gone. Your app is
- 1:29:38completely offline. What you do in that
- 1:29:41moment was actually decided months ago
- 1:29:43by the design choices you made. And that
- 1:29:45is what we're going to break down today.
- 1:29:47So before we can build stuff that
- 1:29:49doesn't break, we got to know what we're
- 1:29:50building with, right? AWS gives us two
- 1:29:53fundamental building blocks for
- 1:29:54resilience. Availability zones and
- 1:29:56regions. Let's start there. All right.
- 1:29:59First up, regions. A region is super
- 1:30:01simple. Just think of a big physical
- 1:30:03location on a map. You know, like US
- 1:30:05East1 in North Virginia or EU West One
- 1:30:08in Ireland. The key thing to remember is
- 1:30:10that each region is completely separate
- 1:30:12and isolated from all the others. This
- 1:30:14is your biggest highest level of
- 1:30:16protection. Okay, so now let's zoom in.
- 1:30:19Inside every single one of those
- 1:30:21regions, AWS has these things called
- 1:30:23availability zones or A's. Now, here's
- 1:30:26the crucial part. An A is basically a
- 1:30:28data center or maybe a few of them
- 1:30:30bundled together. And every A is
- 1:30:32physically separate from the other A's
- 1:30:34in that same region. They've got their
- 1:30:36own power, their own networking,
- 1:30:37everything. They're built to be close
- 1:30:39enough to talk to each other super fast,
- 1:30:41but far enough apart so that if, say, a
- 1:30:43fire or a flood hits one, the others are
- 1:30:45totally fine. So, how do we actually use
- 1:30:48these things? Well, think of it like
- 1:30:50leveling up your app's defenses. Level
- 1:30:52one, you stick everything on a single
- 1:30:54server in one A. Super fragile, right?
- 1:30:56If that one data center goes down,
- 1:30:58you're toast. So, you level up. You
- 1:31:00spread your servers across multiple AZs
- 1:31:02in the same region. Now, we're talking.
- 1:31:04This is what we call high availability.
- 1:31:06But what if you need the ultimate
- 1:31:07protection? Well, you level up one more
- 1:31:09time and replicate your entire setup to
- 1:31:11a different region. This is for true
- 1:31:13disaster recovery. Okay, that's the
- 1:31:15technical stuff. But to really make this
- 1:31:17click, I've got a super simple analogy
- 1:31:20for you that you'll probably never
- 1:31:21forget. It's all about stores. This is
- 1:31:24the easiest way to lock this in your
- 1:31:25brain. A multi-AZ setup. That's like one
- 1:31:28big grocery store with a bunch of
- 1:31:29checkout lanes. If one cash register
- 1:31:31breaks down, eh, no big deal. People
- 1:31:33just move to the next one. the store
- 1:31:35stays open. That's high availability.
- 1:31:38Now, multi-reion, that's like a national
- 1:31:40chain of grocery stores. If the entire
- 1:31:42store in New York gets wiped out by a
- 1:31:44hurricane, the business doesn't die.
- 1:31:46Why? Cuz they still have stores open in
- 1:31:48California and Texas. That, my friends,
- 1:31:50is disaster recovery. All right, so the
- 1:31:53theory makes sense, but how does this
- 1:31:55actually work with real AWS services?
- 1:31:57Because as the architect, you're the one
- 1:31:59making these calls. Let's see what this
- 1:32:01looks like in practice. This is so
- 1:32:04important to get right. Resilience isn't
- 1:32:06always automatic. Take something like
- 1:32:08RDS, the database service. Getting
- 1:32:10multi-AZ protection is literally just a
- 1:32:13checkbox. You click it and AWS handles
- 1:32:16all the magic. But for something like
- 1:32:17EC2 instances, your virtual servers,
- 1:32:20it's on you. You have to actually launch
- 1:32:22instances in different as a load
- 1:32:25balancer to spread the traffic. And S3
- 1:32:27is kind of special. By default, it's
- 1:32:28already multi-AZ. Your data is
- 1:32:30automatically safe across multiple data
- 1:32:32centers. But if you need multi-reion
- 1:32:34protection, yep, that's on you again.
- 1:32:36You have to go in and configure cross
- 1:32:38region replication. And this really is
- 1:32:40the key takeaway here. AWS provides
- 1:32:43these incredible building blocks, but
- 1:32:45you're the architect. You draw the
- 1:32:48blueprint. The choices you make are what
- 1:32:50will decide if your app survives when
- 1:32:52things go wrong. Okay, let's put this
- 1:32:54into a real world scenario. Let's say a
- 1:32:57massive power grid failure takes down an
- 1:32:59entire availability zone. Poof, it's
- 1:33:01gone. But your company's database, which
- 1:33:03is running on RDS, just keeps going.
- 1:33:06Your app stays online. Users don't
- 1:33:08notice a thing. It's like magic. So,
- 1:33:11who's the hero here? Who gets the credit
- 1:33:13for that save? Was it all AWS magic, or
- 1:33:16was it you? The answer, it's a team
- 1:33:19effort. It's a partnership. See, AWS did
- 1:33:22the really hard part. They built the
- 1:33:24physically separate data centers. They
- 1:33:26engineered the automatic failover for
- 1:33:28RDS. All that complex stuff, but none of
- 1:33:31that would have done you any good if you
- 1:33:32hadn't made that one crucial decision to
- 1:33:34click the enable multi-AZ button when
- 1:33:36you set it up. Your choice. Unlock the
- 1:33:38power that AWS built. All right, now
- 1:33:40that you really get the concept, let's
- 1:33:42boil this down to the absolute must know
- 1:33:45points. This is the stuff that will
- 1:33:46really help you nail this, whether it's
- 1:33:48on an exam or in a design discussion.
- 1:33:51Here it is, plain and simple. When you
- 1:33:53see words like high availability or you
- 1:33:55need to survive a single data center
- 1:33:57failing, your brain should just scream
- 1:33:59multi-AZ. But if you see words like
- 1:34:02disaster recovery or you're planning for
- 1:34:04a massive event like an earthquake that
- 1:34:06could take out a whole region, now
- 1:34:08you're talking multi-reion. Another huge
- 1:34:11difference here is how fast you can
- 1:34:13recover. We talk about this with two
- 1:34:15terms, RTO and RPO. Just think of it
- 1:34:18like this. RTO is how much time can we
- 1:34:22be down and RPO is how much data can we
- 1:34:25lose. With multiAZ the failover is super
- 1:34:28fast and automatic. So your downtime is
- 1:34:30seconds and you lose basically zero
- 1:34:33data. With multi-reion it's a much
- 1:34:35bigger deal to switch over. So you're
- 1:34:36looking at minutes maybe even hours of
- 1:34:38downtime. And watch out because here
- 1:34:41comes the classic exam trap. They'll
- 1:34:43give you a scenario where you need to
- 1:34:44survive one data center failing and one
- 1:34:47of the answers will be multi-reion. It
- 1:34:49sounds impressive, right? But it's
- 1:34:51totally wrong. It's expensive, complex
- 1:34:54overkill. Remember our analogy? It's
- 1:34:56like calling in a SWAT team because one
- 1:34:58cash register broke. For a single a
- 1:35:00failure, multi-AZ is always the right
- 1:35:03and most cost-effective answer. Okay,
- 1:35:06time for the 30 secondond summary. If
- 1:35:08you walk away with just one thing, make
- 1:35:10it this. Multi-AZ, that's your multiple
- 1:35:13checkout lanes in one store. It's for
- 1:35:15high availability. It keeps you online
- 1:35:17if one data center fails. Multi-reion,
- 1:35:20that's your national chain of stores.
- 1:35:22It's for disaster recovery. It saves
- 1:35:23your business if an entire city-sized
- 1:35:25region goes dark. So now you've got the
- 1:35:28tools and the choice is yours. Think
- 1:35:30about it. Does a small local banking app
- 1:35:32need the same level of protection as a
- 1:35:34global streaming service that millions
- 1:35:36of people are watching right now?
- 1:35:38Deciding where to draw that line? Well,
- 1:35:40that's what being a great cloud
- 1:35:41architect is all about. All right, let's
- 1:35:44talk about one of the most important
- 1:35:45concepts you'll ever come across in
- 1:35:47cloud computing. High availability.
- 1:35:50We're going to go from zero to building
- 1:35:51something that is practically
- 1:35:53unbreakable. Okay, picture this. Your
- 1:35:56app just blew up. It's a massive hit.
- 1:35:58You're trending. Millions of people are
- 1:36:00signing up. And then it all just stops.
- 1:36:03Your dashboard goes red. Twitter is
- 1:36:05exploding with complaints. and every
- 1:36:07second it's down, you're losing money.
- 1:36:10This is the exact nightmare scenario
- 1:36:12that high availability is built to
- 1:36:14prevent. So, let's really dig in here.
- 1:36:17What even is high availability? You hear
- 1:36:19this term thrown around all the time,
- 1:36:21but let's break down what it actually
- 1:36:22means and more importantly, why you
- 1:36:25absolutely have to understand it. At its
- 1:36:27heart, it's super simple. Look, things
- 1:36:30are going to break. Servers fail.
- 1:36:32Networks go down. That's a guarantee.
- 1:36:34High availability isn't about stopping
- 1:36:36failure. It's about building a system so
- 1:36:38tough that when one piece breaks, your
- 1:36:40users have no idea. The show just goes
- 1:36:42on. So, how do we actually build
- 1:36:46something that resilient? Let's do it
- 1:36:48right now, step by step, starting from
- 1:36:50the most basic setup imaginable. First
- 1:36:53things first, you got to know your
- 1:36:55enemy. And in our world, the big bad is
- 1:36:57something called a single point of
- 1:36:59failure. Think of it like the one Jenga
- 1:37:02block that if you pull it, the whole
- 1:37:03tower comes crashing down. Our entire
- 1:37:06job is to find and get rid of these.
- 1:37:09Okay, so here's our starting point. One
- 1:37:11lonely server. It's running your
- 1:37:13website, your database, the whole
- 1:37:15shebang. It looks clean, simple. But
- 1:37:17what's the glaring problem here? I mean,
- 1:37:20what's wrong with this picture? You got
- 1:37:22it. If that one server hiccups, the
- 1:37:25power supply dies, the disc fails,
- 1:37:27whatever, your whole app is toast, dead
- 1:37:30in the water. That server is the
- 1:37:32definition of a single point of failure.
- 1:37:35Okay, so the obvious fix, right? Let's
- 1:37:37just add a second server. We've got a
- 1:37:39backup now. We have redundancy. Awesome.
- 1:37:42But wait a minute. This creates a new
- 1:37:45problem. How does traffic from the
- 1:37:47internet know which server to go to? How
- 1:37:49do we balance the load? And that is
- 1:37:51where a load balancer comes in. It's
- 1:37:54literally a traffic cop for your
- 1:37:55application. It stands out front and it
- 1:37:58directs all the incoming user requests
- 1:38:00to your healthy servers. And it's smart,
- 1:38:03too. If it notices one server is sick or
- 1:38:05offline, it just stops sending traffic
- 1:38:07there. Problem solved, right? Well, not
- 1:38:10quite. Okay, so we're feeling pretty
- 1:38:13smart. We can survive a server dying.
- 1:38:15But let's zoom out a bit. What if it's
- 1:38:17not just one server? What if the whole
- 1:38:19building they're both sitting in gets
- 1:38:21hit by a backhoe and loses its network
- 1:38:23connection? And this, my friends, is
- 1:38:25where AWS's global infrastructure is
- 1:38:28just genius. They had this concept
- 1:38:30called availability zones or AZ. Now,
- 1:38:33here's the absolute key you have to
- 1:38:35remember. An A is one or more data
- 1:38:38centers, but it's physically separate
- 1:38:39from other A's. We're talking different
- 1:38:41power grids, different flood planes,
- 1:38:43often miles apart. They are designed to
- 1:38:45be isolated from each other's failures.
- 1:38:48So, what's the move? It's simple. You
- 1:38:50put server one in a server 2 over in AB.
- 1:38:54Our load balancer is smart enough to see
- 1:38:56both of them. Now, if a fire, flood, or
- 1:38:59power outage takes all of a offline, who
- 1:39:01cares? The load balancer detects it
- 1:39:03instantly and sends 100% of the traffic
- 1:39:06over to the healthy server in ACB. Your
- 1:39:08users have no idea anything even
- 1:39:10happened. That right there is the core
- 1:39:13of high availability on AWS. Okay, I
- 1:39:15know that was a little technical, so
- 1:39:17let's use a super simple analogy to make
- 1:39:19this concept stick in your brain for
- 1:39:21good. Imagine you're running a
- 1:39:23restaurant. If you have just one cook
- 1:39:25and he calls in sick, your restaurant is
- 1:39:27closed for the day. That's a single
- 1:39:29point of failure. So what do you do? You
- 1:39:31hire a second cook. That's redundancy.
- 1:39:34You also get a manager to shout out the
- 1:39:36orders, making sure both cooks stay
- 1:39:38busy. That manager is your load
- 1:39:40balancer. But here's the real pro move.
- 1:39:42You put those two cooks in two
- 1:39:44completely separate, fully equipped
- 1:39:45pitch across town from each other. Now,
- 1:39:48if one kitchen has a power outage, the
- 1:39:50other one just keeps on cooking. That's
- 1:39:52what having multiple availability zones
- 1:39:54is like. All right, now that you get the
- 1:39:56idea, let's bring it back to AWS because
- 1:39:59this is so important. Your job, your
- 1:40:02responsibility changes depending on the
- 1:40:04service you're using. Okay, check this
- 1:40:07out. For something like EC2, you know,
- 1:40:09your basic virtual servers, AWS handles
- 1:40:11the physical stuff, the data centers
- 1:40:13themselves, but it's on you to actually
- 1:40:15launch your servers in different AS load
- 1:40:18balancer. Now, move over to a managed
- 1:40:20service like RDS, the database service.
- 1:40:23Your life gets way easier. You literally
- 1:40:25just check a box that says multi-AZ and
- 1:40:28AWS does all the hard work for you
- 1:40:30behind the scenes and then you get to a
- 1:40:32service like S3 for storage and you do
- 1:40:35nothing. It's just built to be highly
- 1:40:36available from the get- go. See the
- 1:40:38pattern? The more AWS manages for you,
- 1:40:41the less HA work you have to do
- 1:40:43yourself. Okay, let's put this to the
- 1:40:45test with a little real world scenario.
- 1:40:47This is exactly the kind of critical
- 1:40:49thinking you need. Here's the situation.
- 1:40:51Your app is running on a bunch of EC2
- 1:40:53servers, but to save a little time, you
- 1:40:55put them all on a single availability
- 1:40:57zone. Let's say US East 1A. A freak
- 1:40:59storm comes through and knocks that one
- 1:41:01easy offline. Your app is down. The
- 1:41:04question is, whose fault is it? Yours or
- 1:41:07AWS's? The tough answer? It's on you.
- 1:41:10This is the classic shared
- 1:41:11responsibility model. AWS is responsible
- 1:41:14for the cloud. They make sure the
- 1:41:16physical data centers have power and
- 1:41:17cooling, but you are responsible for
- 1:41:19your architecture in the cloud. They
- 1:41:22gave you all the tools, multiple A's,
- 1:41:24load balancers to survive this exact
- 1:41:27kind of failure. It was your job as the
- 1:41:29architect to use them. Okay, we've gone
- 1:41:32from zero to hopefully a pretty solid
- 1:41:34understanding. Now, let's boil it all
- 1:41:36down to the absolute key points you need
- 1:41:39to have locked in. Look, if a question
- 1:41:42mentions high availability, your brain
- 1:41:44should immediately scream multiple
- 1:41:46availability zones. It's that simple.
- 1:41:48Your goal is always to hunt down and
- 1:41:50kill single points of failure. And your
- 1:41:52main weapon for that is an elastic load
- 1:41:54balancer spreading traffic across at
- 1:41:56least two A's. And here's a super
- 1:41:58important distinction. AZs are for high
- 1:42:00availability. Regions are for disaster
- 1:42:03recovery. Totally different concepts for
- 1:42:05totally different problems. And watch
- 1:42:07out for this classic trap. They'll ask
- 1:42:10for a highly available database
- 1:42:11solution. They'll give you an option for
- 1:42:13a really big, expensive, powerful RDS
- 1:42:16instance, but it's only in one A. That's
- 1:42:19the wrong answer. The correct answer is
- 1:42:21always the one that says multi-AZ, even
- 1:42:23if the server itself is smaller. High
- 1:42:26availability comes from redundancy
- 1:42:27across failure domains, not from a
- 1:42:29bigger box. So, let's wrap this all up
- 1:42:31with a simple mantra we use in the real
- 1:42:33world. One is none. Two is one. If you
- 1:42:37only have one of something, you really
- 1:42:38have nothing because it's just waiting
- 1:42:40to fail. To be truly resilient, you
- 1:42:42always need at least two, running in at
- 1:42:44least two availability zones. So, there
- 1:42:46you have it. You now know how to build
- 1:42:48an application that can survive an
- 1:42:50entire data center campus disappearing
- 1:42:52without your users ever noticing.
- 1:42:54>> All right, if you're building anything
- 1:42:56serious in AWS, you have got to master
- 1:42:58load balancing. Seriously, it is the key
- 1:43:00to handling a flood of traffic and
- 1:43:02making sure your app doesn't just fall
- 1:43:04over. So, we're going to break down the
- 1:43:06big three: application, network, and
- 1:43:08gateway load balancers. By the end of
- 1:43:10this, you'll know exactly which one to
- 1:43:12use, and more importantly, you'll know
- 1:43:13why. Okay, so just picture this for a
- 1:43:16second. You've been working on your app
- 1:43:18for months. You finally launch it, and
- 1:43:21boom, overnight, it just explodes. It's
- 1:43:25trending. It's on the news. And millions
- 1:43:27of users are trying to get in. I mean,
- 1:43:29this is the dream, right? Well, that
- 1:43:32dream can turn into a total nightmare in
- 1:43:34about 5 seconds. So, what's happening
- 1:43:36behind the scenes? All of that traffic,
- 1:43:38every single one of those million users
- 1:43:41is hammering one single lonely server.
- 1:43:44Things start to slow down. Pages are
- 1:43:46just spinning. And then poof, it's gone.
- 1:43:50The server crashes. And just like that,
- 1:43:52your huge success story becomes a
- 1:43:54cautionary tale about an app that
- 1:43:56couldn't handle the spotlight. And that
- 1:43:58right there is the core problem we're
- 1:44:00here to solve. It's what we call a
- 1:44:02single point of failure. If that one
- 1:44:04server goes down, your entire
- 1:44:06application goes down with it. There's
- 1:44:08no backup, no plan B. It's basically a
- 1:44:10house of cards just waiting for a tiny
- 1:44:12gust of wind. So, how do we fix this?
- 1:44:15Enter the hero of our story, the load
- 1:44:18balancer. The easiest way to think about
- 1:44:20it is as the ultimate traffic cop
- 1:44:22standing at the front door of your
- 1:44:23application. Its job sounds simple, but
- 1:44:25it is absolutely critical. It takes all
- 1:44:28those incoming requests and smartly
- 1:44:30hands them out across a whole team of
- 1:44:32servers. So, what's it actually doing?
- 1:44:34It's really just a simple three-step
- 1:44:36dance happening over and over. Step one,
- 1:44:39a request comes in. Step two, it does a
- 1:44:42super quick health check on all its
- 1:44:43servers to see who's ready for work. And
- 1:44:46step three, it sends the request to a
- 1:44:48server that's healthy and available. And
- 1:44:50it does this millions of times, keeping
- 1:44:52everything perfectly balanced.
- 1:44:54Now, to really make the different types
- 1:44:56of AWS load balancers stick in your
- 1:44:58head, we're going to use an analogy,
- 1:45:00let's imagine your application is a
- 1:45:02brand new, incredibly popular
- 1:45:04restaurant, and there's a huge line out
- 1:45:06the door. Okay, so at the front of this
- 1:45:09restaurant, the big difference is how
- 1:45:10smart the person greeting you is. First,
- 1:45:13you have the simple host. This is our
- 1:45:14layer 4 guy. All he cares about is the
- 1:45:17size of your party, your IP address, and
- 1:45:18port, and he just points you to the very
- 1:45:20first empty table he sees. He's super
- 1:45:22fast but not very clever. This is your
- 1:45:24network load balancer. But then you have
- 1:45:26the sophisticated matra. This is our
- 1:45:28layer 7 pro. He looks at your
- 1:45:30reservation details, the specific URL
- 1:45:32you're trying to visit, and finds the
- 1:45:34perfect table for you. Maybe in the
- 1:45:35quiet section or by the window. He's
- 1:45:37much smarter. This is your application
- 1:45:39load balancer. And what about that third
- 1:45:42one, the gateway load balancer? Well,
- 1:45:44this person isn't trying to see you at
- 1:45:46all. Think of this one as the security
- 1:45:49guard at the front door. Their entire
- 1:45:51job is to check your ID and inspect what
- 1:45:53you're carrying before you even get a
- 1:45:55chance to talk to the host or the matra.
- 1:45:57So that restaurant analogy is pretty
- 1:45:59helpful, right? But now let's get
- 1:46:02practical. We need to map this directly
- 1:46:04to the real AWS services so you know
- 1:46:06exactly when to hire the simple host,
- 1:46:08the smart mitrad or the security guard
- 1:46:10for your own architecture. This table
- 1:46:13right here really pulls it all together.
- 1:46:15You've got our miter d the application
- 1:46:16load balancer operating way up at layer
- 1:46:187 where it can understand the language
- 1:46:20of the web HTTP and HTTPS. Then you have
- 1:46:23our simple host the network load
- 1:46:25balancer down at layer 4 dealing with
- 1:46:27raw TCP and UDP connections for maximum
- 1:46:30speed. And finally you have our security
- 1:46:32guard the gateway load balancer working
- 1:46:34at the foundation layer 3 where it can
- 1:46:36inspect every single IP packet. Okay so
- 1:46:39each of these has its own superpower.
- 1:46:41The AOB's special power is something
- 1:46:43called contentbased routing. And this is
- 1:46:45a huge deal for modern apps. It can
- 1:46:47literally read the URL and say, "Oh,
- 1:46:50you're asking for SL images. You go over
- 1:46:52to this group of servers. Oh, you're
- 1:46:54asking for SL API. You need to go to
- 1:46:56this other group of servers." This
- 1:46:58intelligence is exactly why it's the
- 1:46:59go-to choice for things like
- 1:47:00microservices. Now, the NLB's superpower
- 1:47:03isn't about being smart. It's about
- 1:47:05being insanely fast. We are talking raw
- 1:47:09bruteforce performance handling millions
- 1:47:10of requests a second with almost no
- 1:47:12latency. Its other killer feature is
- 1:47:15that it gives you a static IP address
- 1:47:17for things like gaming or any system
- 1:47:19that needs a single predictable IP to
- 1:47:21connect to. This is an absolute gamecher
- 1:47:24and the GWLB its superpower is just
- 1:47:28incredible. It's all about making
- 1:47:30security seamless. It creates this
- 1:47:33invisible checkpoint that forces all
- 1:47:34your traffic coming in and going out
- 1:47:37through a fleet of security appliances
- 1:47:39like firewalls from other vendors. And
- 1:47:41the best part, your application has no
- 1:47:43idea this is even happening. No code
- 1:47:46changes, nothing. It just works. All
- 1:47:49right, theory is great, but let's put
- 1:47:50this knowledge into practice with a
- 1:47:52quick real world scenario. So imagine
- 1:47:55the security team comes to you with a
- 1:47:57new mandate. They say from now on, every
- 1:48:00single packet of data entering our VPC
- 1:48:03must be inspected by this fleet of third
- 1:48:05party firewall appliances we just
- 1:48:07bought. So what do you do? Which tool do
- 1:48:10you reach for? You got it right. It has
- 1:48:12to be the gateway load balancer. And
- 1:48:15this little scenario perfectly explains
- 1:48:16the AWS shared responsibility model.
- 1:48:19It's a really important concept.
- 1:48:21Basically, AWS is responsible for the
- 1:48:24security of the cloud. That means making
- 1:48:26sure the GWLB service itself is running,
- 1:48:28secure, and available. But you are
- 1:48:30responsible for security in the cloud.
- 1:48:32That means it's your job to choose the
- 1:48:34GWLB, configure it correctly, and manage
- 1:48:36those firewalls.
- 1:48:38Okay, we have covered a lot of ground.
- 1:48:41So, let's just take a second and boil
- 1:48:43all of this down to the absolute most
- 1:48:46important things you need to remember.
- 1:48:48Look, if you forget everything else,
- 1:48:50just remember these three words. ALB is
- 1:48:52for flexibility. It's the smart one for
- 1:48:54web traffic. NLB is for performance.
- 1:48:56It's the fast one for raw speed. And
- 1:48:58GWLB is for inspection. It's the
- 1:49:00security guard. Flexibility,
- 1:49:02performance, inspection. Got it? Okay.
- 1:49:05Before we wrap up, I want to give you a
- 1:49:06heads up about the number one trap that
- 1:49:08people fall into when they're thinking
- 1:49:09about this stuff. Here's the trap.
- 1:49:12People see web application or HTTP and
- 1:49:14their brain immediately jumps to
- 1:49:16application load balancer. I mean, it
- 1:49:19makes sense, right? It's in the name.
- 1:49:21But it's not always the right call. If
- 1:49:22your web app is pretty simple and what
- 1:49:24you really need is just face melting
- 1:49:26speed or a permanent static IP address,
- 1:49:29then the network load balancer might
- 1:49:30actually be the better choice even for
- 1:49:32web traffic. All right, one last time,
- 1:49:35let's do a final super fast recap just
- 1:49:38to make sure this is locked into your
- 1:49:39brain. Think of this as your personal
- 1:49:41cheat sheet. It really just comes down
- 1:49:43to this. If you hear the words flexible
- 1:49:45routing for web traffic or
- 1:49:47microservices, your brain should be
- 1:49:49screaming ALB. If you hear the
- 1:49:51requirement for extreme speed, low
- 1:49:52latency, or a static IP, you're thinking
- 1:49:55NLB. And if you hear inspect all traffic
- 1:49:57or third party security appliances, it
- 1:49:59has got to be the GWLB. It's as simple
- 1:50:02as that. So, let's go all the way back
- 1:50:05to that viral app from the beginning.
- 1:50:07That potential nightmare scenario. A
- 1:50:09load balancer is the tool that turns it
- 1:50:11into an incredible success story. It's
- 1:50:13the foundation for building
- 1:50:14architectures that don't fall over when
- 1:50:16things get crazy. So the blueprint is
- 1:50:19yours now.
- 1:50:19>> Hey everyone and welcome to this
- 1:50:21explainer. Today we're diving head first
- 1:50:23into one of the absolute most critical
- 1:50:25concepts in cloud computing and that's
- 1:50:27autoscaling. Now we aren't just going to
- 1:50:29sit here and memorize textbook
- 1:50:31definitions today. Instead we're going
- 1:50:33to build a rockolid intuitive
- 1:50:34understanding of how resilient
- 1:50:36architecture actually works out there in
- 1:50:38the real world. By the end of this you
- 1:50:40won't just know the cloud buzzwords.
- 1:50:41You're going to understand the
- 1:50:42underlying logic so well that you could
- 1:50:44easily turn around and teach it to a
- 1:50:45total beginner. So, picture this. You've
- 1:50:48just launched a brand new app. You wake
- 1:50:50up, grab your phone, and realize some
- 1:50:52massive influencer just dropped a link
- 1:50:54to your project. You're going viral.
- 1:50:56Literally, millions of people are
- 1:50:58flooding your site all at once. What
- 1:51:00happens next? Well, in traditional IT,
- 1:51:03your server CPU spikes to 100%. The
- 1:51:06memory maxes out and boom, the server
- 1:51:08crashes. Just like that, your huge viral
- 1:51:11moment turns into a total disaster. This
- 1:51:14terrifying, incredibly real world
- 1:51:16nightmare is exactly why today's topic
- 1:51:18matters so much. To make sure that
- 1:51:20nightmare never happens to us, we need
- 1:51:22to build what's known as a resilient
- 1:51:24architecture. But you know, what does
- 1:51:26that actually mean in plain English?
- 1:51:28Simply put, a resilient architecture is
- 1:51:30a system that can take a heavy punch and
- 1:51:32just keep ticking. It gracefully handles
- 1:51:34failure. And honestly, the most
- 1:51:36important part is that it adapts to
- 1:51:37changes in your workload dynamically. It
- 1:51:40doesn't sit around waiting for a human
- 1:51:41to wake up and step in. It reacts
- 1:51:43automatically to keep the whole system
- 1:51:45online no matter how chaotic the traffic
- 1:51:47gets. Okay, let's dive into this. How do
- 1:51:50we actually handle all that sudden extra
- 1:51:52traffic? You basically have two choices
- 1:51:54here. Vertical scaling or horizontal
- 1:51:56scaling. Vertical scaling is taking your
- 1:51:59one existing server and just making it
- 1:52:01beefier. You know, giving it more RAM or
- 1:52:03a faster CPU. It's kind of like ripping
- 1:52:05out your car's engine to install a
- 1:52:06bigger one. The problem? Well, there's
- 1:52:08always a physical limit, and doing that
- 1:52:10almost always requires taking your
- 1:52:12system offline. Horizontal scaling, on
- 1:52:14the other hand, just means adding more
- 1:52:16servers to share the load. And in the
- 1:52:18cloud, horizontal scaling is the
- 1:52:20absolute undisputed champion because it
- 1:52:22gives you virtually infinite elasticity.
- 1:52:24If that still feels a little abstract,
- 1:52:27just think of it like your local grocery
- 1:52:28store. It's a Sunday afternoon, it's
- 1:52:31super busy, and suddenly 50 people line
- 1:52:33up to check out all at once. The store
- 1:52:36manager doesn't pause the whole store to
- 1:52:38build one giant super fast mega
- 1:52:40register, right? Because that would be
- 1:52:42vertical scaling. Instead, the manager
- 1:52:44just gets on the intercom and calls more
- 1:52:46cashiers to open up more lanes. That is
- 1:52:48horizontal scaling. And the best part,
- 1:52:51when the rush is finally over and the
- 1:52:52store empties out, they close those
- 1:52:54extra lanes and send the cashiers home.
- 1:52:56So, they aren't paying people just to
- 1:52:57stand around doing nothing. And this
- 1:52:59brilliantly illustrates exactly how
- 1:53:01things work in AWS. First up, we have
- 1:53:03AWS Cloudatch. This acts as our
- 1:53:05monitoring eyes, constantly watching for
- 1:53:07that traffic spike. Second, Amazon EC2
- 1:53:10autoscaling steps in as our store
- 1:53:12manager, automatically launching new EC2
- 1:53:14servers, which is essentially opening
- 1:53:15those new lanes. But here's the really
- 1:53:18critical third step, the application
- 1:53:19load balancer, or ALB. Think of the ALB
- 1:53:22as the traffic cop standing right at the
- 1:53:24front doors. It evenly distributes all
- 1:53:26those incoming users across your newly
- 1:53:28opened servers, making sure no single
- 1:53:30machine gets totally overwhelmed. Now,
- 1:53:32it's really important to know that
- 1:53:33scaling isn't just for those traditional
- 1:53:35EC2 servers. As you start designing
- 1:53:37resilient architectures, you're going to
- 1:53:38see this elasticity everywhere. Like, if
- 1:53:41you're using AWS Fargate for containers,
- 1:53:43it scales automatically behind the
- 1:53:44scenes. Or if you use AWS Lambda for
- 1:53:47serverless functions, AWS can spin up
- 1:53:49thousands of concurrent executions in a
- 1:53:51matter of seconds and you don't have to
- 1:53:52provision a single thing. Even databases
- 1:53:54like Amazon Dynamob, they automatically
- 1:53:57scale their read and write capacity
- 1:53:58based on whatever the demand is.
- 1:54:00Horizontal scaling really is the
- 1:54:02heartbeat of the modern cloud. All
- 1:54:04right, let's test your understanding
- 1:54:05here with a quick scenario. Say you've
- 1:54:08built your app. A massive traffic spike
- 1:54:10hits out of nowhere, but your servers
- 1:54:12end up crashing anyway because no new
- 1:54:14instances actually spun up to help. Now,
- 1:54:16the physical AWS data center, it was
- 1:54:18working perfectly fine, but your app
- 1:54:20still went down. So, who is responsible
- 1:54:23here? Is it AWS's fault for not handing
- 1:54:25over the servers when you needed them,
- 1:54:27or is this your fault? Well, the answer
- 1:54:29comes straight from the AWS shared
- 1:54:31responsibility model. In this scenario,
- 1:54:33you are responsible. Why? Because AWS
- 1:54:36controls the physical hardware and the
- 1:54:38global infrastructure. They make
- 1:54:40absolutely sure the capacity is sitting
- 1:54:41there ready to go, but you control the
- 1:54:44architecture design. It's totally on you
- 1:54:46to set the scaling metrics and define
- 1:54:47the exact rules that trigger a scaleout
- 1:54:49event. AWS gives you an endless supply
- 1:54:51of cashiers for sure, but you have to be
- 1:54:53the manager who actually tells them to
- 1:54:55open the lanes. Now that you have a
- 1:54:57solid grasp on how this all plays out in
- 1:54:59the real world, let's quickly ground
- 1:55:01ourselves in the official exam guide.
- 1:55:03Everything we've been talking about
- 1:55:04falls right into domain 2, specifically
- 1:55:06task 2.1, which is all about designing
- 1:55:09scalable and loosely coupled
- 1:55:11architectures. You see, you aren't just
- 1:55:13memorizing random services here. You are
- 1:55:15actually learning how to fulfill the
- 1:55:17core day-to-day requirements of a real
- 1:55:19cloud architect. Okay, let's rapid fire
- 1:55:22some key points you absolutely need to
- 1:55:24lock in. First, decouple your workloads.
- 1:55:26If your web tier and your database tier
- 1:55:28are super tightly connected to each
- 1:55:30other, they simply can't scale
- 1:55:31independently. You've got to break them
- 1:55:33apart. Second, autoscaling works way
- 1:55:35better with stateless workloads. That
- 1:55:37just means your server shouldn't be
- 1:55:38saving user data locally. Think about
- 1:55:40it. If a server scales in and gets
- 1:55:42deleted to save money, you definitely
- 1:55:43don't want to lose a user's active
- 1:55:45shopping cart, right? You want to store
- 1:55:46that state externally in a database. And
- 1:55:49third, always know how to identify the
- 1:55:51right metrics like CPU utilization to
- 1:55:53actually trigger those scaling actions.
- 1:55:55So a absolutely crucial point here
- 1:55:58before we wrap up is to watch out for
- 1:56:00this classic exam trap. They love to
- 1:56:02test if you know the exact difference
- 1:56:04between two services with very very
- 1:56:07similar names. Listen closely. Amazon
- 1:56:10EC2 autoscaling is a service
- 1:56:12specifically just for scaling your EC2
- 1:56:14virtual servers. But AWS autoscaling
- 1:56:17that is a separate much broader service.
- 1:56:20It lets you configure scaling for
- 1:56:21multiple different resources like EC2,
- 1:56:24DynamoB, and ECS all from one unified
- 1:56:27dashboard. So read those questions super
- 1:56:29carefully. Let's do a fast clean recap
- 1:56:31to really cement this in your brain.
- 1:56:33Number one, horizontal scaling is the
- 1:56:35winner in the cloud. Add more instances.
- 1:56:38Don't just try to build bigger ones.
- 1:56:40Number two, automate your reactions. You
- 1:56:43want to combine Cloudatch, EC2
- 1:56:44autoscaling, and a load balancer so you
- 1:56:47can survive crazy traffic spikes
- 1:56:48completely automatically. And number
- 1:56:50three, know your shared
- 1:56:52responsibilities. AWS provides the
- 1:56:54infinite resources, but it's up to you
- 1:56:56to actually design the architecture that
- 1:56:58uses them. And that brings us to our
- 1:56:59final thought for this explainer. The
- 1:57:01cloud has completely wiped out the
- 1:57:03traditional hardware barriers. You don't
- 1:57:05need to go buy a million dollars worth
- 1:57:06of physical servers just to handle a
- 1:57:08million users anymore. All you need is a
- 1:57:10well-designed, highly resilient
- 1:57:12architecture. So, if you literally have
- 1:57:14the power to scale infinitely on demand,
- 1:57:16what's stopping you from building the
- 1:57:18next massive viral app right now? All
- 1:57:20right, picture this. You're finally
- 1:57:22launching your app to the world and it
- 1:57:24goes viral. I mean, users are just
- 1:57:26pouring in from everywhere. It's the
- 1:57:28moment you've been waiting for. But
- 1:57:30then, disaster strikes. Your European
- 1:57:33users start complaining that the app
- 1:57:35takes 10 full seconds to load. and then
- 1:57:38your main database just completely
- 1:57:39crashes under the pressure. Your app
- 1:57:41goes totally dark. You are losing
- 1:57:44thousands of dollars every single
- 1:57:46minute. It is an absolute nightmare. And
- 1:57:49you know what? It's exactly what happens
- 1:57:51when you let the internet blindly decide
- 1:57:53how traffic reaches your servers. To fix
- 1:57:55this, we absolutely have to take control
- 1:57:58of our traffic. We need Amazon Route 53.
- 1:58:02So, what does Route 53 actually do?
- 1:58:04Well, at its core, it's a domain name
- 1:58:06system or DNS. I want you to think of it
- 1:58:09like a massive global switchboard. When
- 1:58:11someone types your website into their
- 1:58:12phone, Route 53 is the operator that
- 1:58:15connects them to the exact right server
- 1:58:17IP address. But it's not just a basic
- 1:58:19switchboard. It's incredibly smart. You
- 1:58:21actually get to give this operator a set
- 1:58:23of strict rules for exactly how to route
- 1:58:25people. We call these rules routing
- 1:58:27policies. Let's walk through how they
- 1:58:29all work. Okay, we'll start with simple
- 1:58:32routing. Basically, what it does is just
- 1:58:34hand out the IP address for your server.
- 1:58:36There's no special logic attached
- 1:58:38whatsoever. So, why does it even exist?
- 1:58:41Well, because sometimes you really just
- 1:58:43have one single web server running a
- 1:58:44simple blog. You just don't need fancy
- 1:58:46global routing for that. Think of it
- 1:58:49like a front desk receptionist at a
- 1:58:51small office building. You walk in, you
- 1:58:53ask for Dave, and they just point
- 1:58:54directly to Dave's desk. Simple, right?
- 1:58:56Because if you don't use it, you end up
- 1:58:58over complicating a totally basic setup
- 1:59:01and wasting your time configuring rules
- 1:59:03you just don't need. Now, this is where
- 1:59:04people mess up, though. They think
- 1:59:06simple routing means it can only ever
- 1:59:07return one single IP address. Actually,
- 1:59:10scratch that. You can attach multiple IP
- 1:59:12addresses to a simple record and route
- 1:59:1453 will just hand them all back to the
- 1:59:15user in a totally random order. But
- 1:59:17there is a huge catch here. It does not
- 1:59:20check if those servers are actually
- 1:59:22awake or if they're dead. Now, here's
- 1:59:24where things get really interesting. Let
- 1:59:26me show you weighted routing. This
- 1:59:28policy lets you split your incoming
- 1:59:30traffic based on custom percentages. So,
- 1:59:32you can send 80% of your traffic to
- 1:59:34server A and 20% to server B. Why does
- 1:59:37this exist? Think about that for a
- 1:59:38second. Imagine you're rolling out a
- 1:59:40massive, super complicated update to
- 1:59:42your app. If you send a 100% of your
- 1:59:44users to the brand new code on day one
- 1:59:46and it breaks, your whole company is
- 1:59:47offline. It's kind of like a bouncer at
- 1:59:49a club directing 90% of the crowd into
- 1:59:52the main room and then carefully letting
- 1:59:54just 10% into a VIP room just to see if
- 1:59:57it gets too crowded. If you don't use
- 2:00:00weighted routing, you are basically
- 2:00:02forced to push updates to everyone at
- 2:00:04exactly the same time. And you just have
- 2:00:06to pray nothing breaks. But with
- 2:00:08weighted routing, you send 5% of traffic
- 2:00:11to the new version. If it works
- 2:00:12smoothly, you dial it up to 20, then 50,
- 2:00:15then 100%. It's a real gamecher. Next up
- 2:00:19is latency routing. This policy routes
- 2:00:22your users to the AWS region that gives
- 2:00:24them the absolute fastest response time.
- 2:00:26Why do we need this? Because physical
- 2:00:28data actually travels through cables
- 2:00:30running under the ocean. If I'm sitting
- 2:00:32in Tokyo and your server is all the way
- 2:00:33in New York, that data has a very, very
- 2:00:36long commute. Latency routing constantly
- 2:00:38measures the network and actively finds
- 2:00:40the absolute fastest path. It's exactly
- 2:00:43like calling for a taxi and the
- 2:00:45dispatcher automatically sending the car
- 2:00:47that is physically closest to you right
- 2:00:48now instead of one all the way across
- 2:00:51town. If you don't use this, your global
- 2:00:53users are going to get laggy, incredibly
- 2:00:55frustrating experiences. All right,
- 2:00:57let's talk about survival failover
- 2:00:59routing. What this does is let you set a
- 2:01:01primary server and a standby backup
- 2:01:03server. If your primary server goes
- 2:01:05down, Route 53 automatically flips the
- 2:01:07switch and sends all your traffic
- 2:01:09straight to the backup. Why does it
- 2:01:10exist? Because let's face it, hardware
- 2:01:12fails, the power goes out. This is
- 2:01:15literally the backup generator for a
- 2:01:17hospital. It just sits there quietly
- 2:01:18until the main power dies and then boom,
- 2:01:21it instantly kicks on so the lights stay
- 2:01:23on. What happens if you don't use
- 2:01:25failover? Well, a crash server means
- 2:01:27your users just stare at an error screen
- 2:01:29until you have to wake up at 3 in the
- 2:01:30morning to fix it manually. And nobody
- 2:01:33wants that. Okay, moving on. Let's look
- 2:01:36at geoloccation routing. This one routes
- 2:01:38traffic based on the actual physical
- 2:01:40location of your user. We're talking
- 2:01:42their specific country or even their
- 2:01:43state. Why does this exist? Think about
- 2:01:46legal borders and licensing constraints.
- 2:01:49Now, imagine this scenario in your app.
- 2:01:51You have the legal rights to stream a
- 2:01:53movie in France, but you absolutely do
- 2:01:55not have the rights in Germany. You need
- 2:01:57a hard border. Geoloccation is like a
- 2:02:00passport checkpoint at an airport. If
- 2:02:02you have a French IP address, you go
- 2:02:04right to the French servers. If you have
- 2:02:06a German IP address, you are blocked
- 2:02:08entirely or may be sent to a totally
- 2:02:10different site. If you don't use this,
- 2:02:11you could literally get sued for
- 2:02:13broadcasting content where you legally
- 2:02:15shouldn't. Geoproximity routing is next.
- 2:02:17And honestly, this is usually the
- 2:02:19concept where people finally go, "Oh,
- 2:02:21okay. Now I get it. It sounds exactly
- 2:02:24like geoloccation, but it is completely
- 2:02:26different." Geoproximity routes traffic
- 2:02:28based on where your servers are located,
- 2:02:30but it lets you artificially shift
- 2:02:32traffic using something called a bias.
- 2:02:35Why does this exist? Well, let's say you
- 2:02:37have a massive server farm in Texas and
- 2:02:39just a tiny little one in New York. You
- 2:02:41obviously don't want to split the US
- 2:02:43traffic evenly between them. So, you add
- 2:02:45a bias to the Texas server, making its
- 2:02:47gravity stronger, so it pulls in more
- 2:02:49users from across the entire country. It
- 2:02:52basically acts like a giant magnet. You
- 2:02:54make the Texas magnet bigger, so it
- 2:02:56pulls more iron filings toward it.
- 2:02:58Without it, your tiny New York server
- 2:03:00gets completely overwhelmed and crushed
- 2:03:02while your massive Texas servers just
- 2:03:04sit there empty. Finally, we have
- 2:03:06multialue answer routing. It acts
- 2:03:08exactly like simple routing, meaning it
- 2:03:11hands back a list of IP addresses to the
- 2:03:13user, but it actually performs critical
- 2:03:15health checks first. Why does this
- 2:03:17exist? Because handing a user a
- 2:03:19completely dead IP address, is just
- 2:03:21terrible for business. It's exactly like
- 2:03:23a restaurant host handing you a menu,
- 2:03:26but making sure they cross off the items
- 2:03:28that are sold out before they even give
- 2:03:29it to you. If you don't use multialue,
- 2:03:32Route 53 might literally send your users
- 2:03:34to a server that is currently on fire.
- 2:03:37All right, let's do a quick recap of the
- 2:03:39whole shebang. Weighted is for testing
- 2:03:41new versions. Latency is for pure speed.
- 2:03:44Failover is for disaster backups.
- 2:03:46Geoloccation is for hard borders and
- 2:03:48compliance. Geoproximity is for server
- 2:03:51gravity and shifting loads and multialue
- 2:03:53is for returning a list of strictly
- 2:03:55healthy servers. Now here are your three
- 2:03:58exam bullets. First, if the scenario
- 2:04:01talks about AB testing or blue green
- 2:04:03deployments, the answer is always
- 2:04:06weighted routing. Second, if the
- 2:04:07requirement mentions compliance, legal
- 2:04:10rights or localized languages, you
- 2:04:12absolutely need geoloccation routing.
- 2:04:14And third, if the question talks about
- 2:04:16an active passive setup or disaster
- 2:04:18recovery, the answer is always failover
- 2:04:21routing. But before we wrap this
- 2:04:23explainer up, we really need to talk
- 2:04:25about the exam because there is one
- 2:04:27massive trap they're definitely going to
- 2:04:28use to trick you. Do not confuse latency
- 2:04:31routing with geoloccation. The exam will
- 2:04:33say something like, "A user lives in
- 2:04:35South America. How do we give them the
- 2:04:36fastest experience?" And people blindly
- 2:04:39choose geoloccation just because the
- 2:04:40question mentioned a physical location.
- 2:04:42That is wrong. A user in Brazil might
- 2:04:45actually have a much faster fiber optic
- 2:04:46connection to a server in Miami than to
- 2:04:48a server in South America. Latency only
- 2:04:51cares about the fastest cable.
- 2:04:52Geoloccation only cares about the map.
- 2:04:54If it asks for speed, choose latency. So
- 2:04:57look at your own architecture. Are you
- 2:04:58routing your users based on where they
- 2:05:00live or how fast they can actually reach
- 2:05:02you? Because on the modern internet,
- 2:05:03milliseconds are literally the
- 2:05:05difference between a loyal customer and
- 2:05:06a completely lost sale.
- 2:05:08>> Picture this. It's Black Friday. You've
- 2:05:10spent literally months preparing for
- 2:05:12this exact day. Your e-commerce site is
- 2:05:15just absolutely printing money and your
- 2:05:17marketing team, they're already popping
- 2:05:18the champagne. But then out of nowhere,
- 2:05:21a single database server actually
- 2:05:23catches fire or worse, an entire data
- 2:05:26center just goes offline. And just like
- 2:05:28that, boom, the whole site crashes.
- 2:05:31You're staring at that dreaded 502 bad
- 2:05:34gateway error. And let's be real, every
- 2:05:36single second you are down, you are
- 2:05:38losing thousands of dollars. Worse yet,
- 2:05:41your customers are getting super
- 2:05:42frustrated and they're flocking straight
- 2:05:45over to your competitors. And to top it
- 2:05:47all off, your phone just starts blowing
- 2:05:48up with angry texts from the CEO. Yeah,
- 2:05:51it's a total nightmare. So, how do we
- 2:05:53stop that nightmare from ever happening?
- 2:05:56We're talking about failover. Section
- 2:05:58one, what is failover? Let's dive right
- 2:06:00in. What does failover actually mean in
- 2:06:04plain English? Well, at its core, it
- 2:06:06really just means having a rock-solid
- 2:06:08backup plan. One that kicks in
- 2:06:10automatically the second things go
- 2:06:12wrong. Because, and here is the harsh
- 2:06:14truth we all have to accept, systems
- 2:06:16fail all the time. Hardware degrades.
- 2:06:19Sometimes entire AWS regions just go
- 2:06:21offline unexpectedly. So, your failover
- 2:06:24strategies, they're your ultimate
- 2:06:25insurance policy. They are exactly what
- 2:06:27ensures your business stays alive. All
- 2:06:29right, moving to section two. Let's talk
- 2:06:32about our first big strategy,
- 2:06:34active/passive failover. So, in this
- 2:06:37kind of setup, you have a primary system
- 2:06:39that's doing 100% of the heavy lifting.
- 2:06:42This guy right here is your active
- 2:06:44system, but you also have a backup
- 2:06:46system sitting in a totally different
- 2:06:47location. It's perfectly healthy, but
- 2:06:49it's completely hidden from the
- 2:06:50internet. Honestly, it does absolutely
- 2:06:52nothing. It's passive. It just sits
- 2:06:55there and waits. It's kind of like
- 2:06:57having a stunt double on a massive
- 2:06:59blockbuster movie set. You know, the
- 2:07:01main Hollywood actor is out there
- 2:07:03filming all the scenes, taking all the
- 2:07:05spotlight. Meanwhile, the stunt double
- 2:07:08is just sitting in a chair drinking
- 2:07:10coffee off camera. But the very second
- 2:07:12that main actor gets hurt, bam, the
- 2:07:14stunt double steps in immediately and
- 2:07:16the movie just keeps on filming. Because
- 2:07:19if you don't use a setup like this, your
- 2:07:21app just goes completely offline. We're
- 2:07:24talking raw extended downtime, which is
- 2:07:26incredibly painful. Now, here's where
- 2:07:29this gets really interesting. The
- 2:07:31biggest trade-off with active/passive is
- 2:07:33all about cost versus utilization.
- 2:07:35You're basically paying pure money for
- 2:07:37an identical backup environment that
- 2:07:39just sits there doing literally nothing
- 2:07:4199% of the time, just so you have that
- 2:07:44peace of mind. Okay, let's flip to the
- 2:07:46other side of the coin. Section three,
- 2:07:48active/active failover. Welcome to the
- 2:07:51big leagues. In an active/active setup,
- 2:07:55instead of a primary and a backup, you
- 2:07:57have multiple primary systems spanning
- 2:07:59across different availability zones or
- 2:08:01even regions. And here's the kicker,
- 2:08:03they are all running. They are all
- 2:08:06actively taking traffic at the exact
- 2:08:08same time. There is no stunk double
- 2:08:10here. Everyone is a star. I always tell
- 2:08:13people to think about it like a massive
- 2:08:15supermarket with 10 checkout lanes open
- 2:08:17at once. If one cash register suddenly
- 2:08:19breaks, what happens? The cashier simply
- 2:08:21turns off their light and the customers
- 2:08:23naturally flow over to the other nine
- 2:08:25open lanes. The store never stops
- 2:08:26operating. That is usually the moment
- 2:08:28people hear this and say, "Oh, now I get
- 2:08:31it. The system just absorbs the failure
- 2:08:34completely naturally without anyone
- 2:08:35panicking." But of course, there's a
- 2:08:38catch. The trade-off here is massive
- 2:08:40architectural complexity. I mean,
- 2:08:42keeping multiple databases perfectly
- 2:08:44synced across the globe in real time,
- 2:08:46that is brutally expensive. Think about
- 2:08:49that for a second. If you have a true
- 2:08:51active/active architecture, you aren't
- 2:08:54just building a backup plan anymore. You
- 2:08:56are actually building an immune system
- 2:08:57for your application. With this level of
- 2:09:00true fault tolerance if an entire
- 2:09:02availability zone drops offline, your
- 2:09:04users wouldn't even see a glitch or an
- 2:09:07error screen. Services like Amazon Route
- 2:09:0953 will instantly redirect that traffic
- 2:09:11to the surviving active zones. When you
- 2:09:14realize your users will literally never
- 2:09:16know that a fire happened in your data
- 2:09:18center. I mean that is the absolute
- 2:09:20magic of true fall tolerance. Moving on
- 2:09:23to section four, choosing your strategy.
- 2:09:26Now listen closely because this is where
- 2:09:28people mess up. So many folks think they
- 2:09:31always need active active just because
- 2:09:33it sounds bigger and cooler. Let me tell
- 2:09:35you, you don't. You choose
- 2:09:37active/passive to save money, especially
- 2:09:40when your system is fairly simple and
- 2:09:42your business can actually tolerate a
- 2:09:43few minutes of downtime. On the flip
- 2:09:45side, you choose active/active when you
- 2:09:47are building missionritical, massive
- 2:09:49global applications where a single
- 2:09:51minute of downtime literally costs
- 2:09:53millions of dollars. All right, let's
- 2:09:55bring it all together. Section five,
- 2:09:57critical exam takeaways. Keep those
- 2:09:59stunt double and supermarket analogies
- 2:10:01in mind as we validate these cloud
- 2:10:03skills. Let's do a quick methodical
- 2:10:06recap of what we've covered. First
- 2:10:08point, active/active failover provides
- 2:10:11the absolute lowest recovery time
- 2:10:13objective. Essentially giving you near
- 2:10:15zero downtime. Got that? Okay. Second
- 2:10:17point, disaster recovery strategies that
- 2:10:19you might hear about like pilot light or
- 2:10:21warm standby. Those are essentially just
- 2:10:24variations of the active/passive
- 2:10:26approach. And third, Amazon Route 53 is
- 2:10:29the primary global routing service
- 2:10:31you're going to use to manage both of
- 2:10:32these failover strategies. Before we
- 2:10:35wrap up, here is your final trap
- 2:10:37warning. Please do not confuse true
- 2:10:40multi-AZ disaster recovery with simple
- 2:10:42local load balancing. Because let me
- 2:10:44tell you, simple load balancing on a
- 2:10:46single server rack, that will not save
- 2:10:48you if the whole building loses power.
- 2:10:50So, I want you to look at your own
- 2:10:52architecture right now and ask yourself
- 2:10:54honestly, are you truly fault tolerant,
- 2:10:56or are you just one bad power grid away
- 2:10:58from going completely dark? Imagine you
- 2:11:01wake up at 3:00 a.m. Your phone is
- 2:11:03ringing off the hook. A massive
- 2:11:05hurricane just flooded the entire data
- 2:11:07center hosting your application. Your
- 2:11:10database is gone. Your servers are dead.
- 2:11:13Every passing minute is costing your
- 2:11:15company tens of thousands of dollars.
- 2:11:17The CEO is literally screaming on the
- 2:11:20conference call asking two questions.
- 2:11:22How much customer data did we just lose?
- 2:11:25And when will we be back online? Listen,
- 2:11:27if you don't know the exact answer to
- 2:11:29those two questions, your cloud
- 2:11:31architecture is fundamentally broken.
- 2:11:34So, let's talk about disaster recovery.
- 2:11:36Systems fail. It's not a matter of if,
- 2:11:38but when. Natural disasters happen.
- 2:11:40Hardware catches fire. And you know,
- 2:11:42sometimes a tired engineer accidentally
- 2:11:44deletes a production database. Disaster
- 2:11:47recovery is your blueprint for survival.
- 2:11:49But to build that blueprint, you really
- 2:11:51have to master the two acronyms that
- 2:11:53dictate whether your business lives or
- 2:11:54dies. RTO and RPO. Let's break them down
- 2:11:57into their simplest forms. First up is
- 2:12:00RTO, recovery time objective. This is a
- 2:12:02stopwatch. The clock starts the exact
- 2:12:04second your system goes down. How long
- 2:12:06does it take to turn the lights back on?
- 2:12:08Is it 10 minutes or is it 10 hours? It
- 2:12:10is entirely about downtime. Next is RPO,
- 2:12:13recovery point objective. Think of this
- 2:12:16as a time machine. When the disaster
- 2:12:18hit, how far back in time do we have to
- 2:12:20go to find our last good backup? Did we
- 2:12:23back up the database 5 minutes ago or
- 2:12:25yesterday at midnight? It is entirely
- 2:12:27about data loss. Think about that for a
- 2:12:30second. If your RPO is 24 hours and your
- 2:12:33system crashes at 11 p.m., you just
- 2:12:36permanently lost an entire day of
- 2:12:38customer orders. There's no getting them
- 2:12:39back. They are gone forever. That is why
- 2:12:42RPO isn't just an engineering metric. It
- 2:12:44is your accepted level of permanent data
- 2:12:47loss. Now, here's the part that actually
- 2:12:49matters. You might be thinking, great,
- 2:12:53let's just make both RTO and RPO zero.
- 2:12:55Zero downtime, zero data loss. Here is
- 2:12:59where people completely fail this
- 2:13:00concept. Getting to zero is brutally
- 2:13:03hard, highly risky, and insanely
- 2:13:05expensive. To get a zero RPO, you have
- 2:13:07to synchronously replicate every single
- 2:13:10database transaction across the country
- 2:13:11in real time. That creates network lag.
- 2:13:14It slows down your app. And worse, if an
- 2:13:16engineer accidentally deletes a table,
- 2:13:18that deletion is replicated instantly,
- 2:13:20destroying your backup, too. And to get
- 2:13:22a zero RTO, you have to run your servers
- 2:13:24at full blast in multiple regions
- 2:13:26simultaneously that literally doubles
- 2:13:28your AWS bill the very next day. So
- 2:13:31instead of just spending millions of
- 2:13:33dollars, we use a spectrum of four
- 2:13:35disaster recovery strategies to balance
- 2:13:37cost versus survival. Strategy one,
- 2:13:40backup and restore. This is the absolute
- 2:13:43cheapest option. You just take snapshots
- 2:13:45of your data and store them. But the
- 2:13:47trade-off is massive pain. If you crash,
- 2:13:50you have to manually provision new
- 2:13:52servers, install software, and restore
- 2:13:54the data from scratch. Your RTO is
- 2:13:56measured in hours or even days. It's
- 2:13:58exactly like keeping a box of car parts
- 2:14:00in your garage. If your car breaks, you
- 2:14:02have to build a new one yourself.
- 2:14:04Strategy 2, pilot light. In this setup,
- 2:14:07your core database is always running and
- 2:14:08replicating data, but your application
- 2:14:10servers are completely turned off. It's
- 2:14:12exactly like the pilot light in a gas
- 2:14:14furnace. The small flame is always on,
- 2:14:16and when the house gets cold, it
- 2:14:18instantly ignites the main burners. It
- 2:14:20saves you money on compute, but gives
- 2:14:21you a much faster RTO when disaster
- 2:14:23strikes. Strategy 3, warm standby. This
- 2:14:27is a fully functional, scaled down
- 2:14:29version of your entire application
- 2:14:31running in the background. It's like a
- 2:14:32car sitting in your driveway with the
- 2:14:34engine idling. If an emergency happens,
- 2:14:36you just jump in, hit the gas, and scale
- 2:14:38it up to handle the traffic. Your RTO is
- 2:14:40just minutes. Strategy four, multi-sight
- 2:14:44active active. Everything is running at
- 2:14:46full capacity, taking live traffic
- 2:14:48across multiple regions. It is a twin
- 2:14:50engine commercial jet. One engine
- 2:14:52explodes, the other takes the full load,
- 2:14:54and the passengers never even notice.
- 2:14:56Zero RTO. But it costs an absolute
- 2:14:59fortune. Now, imagine this scenario in
- 2:15:02your system. Your boss wants to use
- 2:15:04Pilot Light to save money, but the
- 2:15:06marketing team says the site cannot go
- 2:15:08down for more than 5 minutes or you lose
- 2:15:10the biggest deal of the year. Those two
- 2:15:12demands completely conflict. Because
- 2:15:15here's the reality. Disaster recovery is
- 2:15:17not an IT choice. It is a harsh business
- 2:15:20negotiation between your budget and your
- 2:15:22survival. If you are preparing for an
- 2:15:24AWS solutions architect exam, this is
- 2:15:27exactly how they test you. Do not miss
- 2:15:30this. They will almost never ask you for
- 2:15:32a simple definition. They will give you
- 2:15:34a scenario. If the question asks for the
- 2:15:37most cost-effective way to survive a
- 2:15:38disaster and says the business can
- 2:15:40tolerate a recovery time of several
- 2:15:42hours, you immediately look for backup
- 2:15:44and restore or pilot light. But if the
- 2:15:46question says mission critical and
- 2:15:48demands near zero downtime, you must
- 2:15:50choose multi-sight active active no
- 2:15:52matter the cost. Let's wrap this up
- 2:15:54fast. RTO is time. How long are we down?
- 2:15:58RPO is data. How much did we lose? The
- 2:16:01closer you get to zero, the more
- 2:16:03complicated and expensive your
- 2:16:04architecture becomes. So, here are your
- 2:16:06three rapidfire takeaways. One, pilot
- 2:16:09light keeps the database alive, but the
- 2:16:10app server sleeping. Two, warm standby
- 2:16:13keeps a scaled down fully functional
- 2:16:15environment ready to scale. Three,
- 2:16:17multicight active active gives you near
- 2:16:19zero RTO, but requires massive financial
- 2:16:21investment. And here is your final trap.
- 2:16:24Never ever confuse them. RTO is turning
- 2:16:28the lights back on. RPO is what got
- 2:16:30stolen while the room was dark? Do not
- 2:16:32mix them up. Which makes you wonder
- 2:16:34which of these four strategies is your
- 2:16:36company relying on right now. And what
- 2:16:38happens if that system fails tonight?
- 2:16:40>> Imagine a tired junior engineer pushing
- 2:16:43a database update on a Friday afternoon.
- 2:16:47They mistype one single line of code,
- 2:16:49hit enter, and instantly your entire
- 2:16:51production database is completely wiped.
- 2:16:53Years of customer data, order history,
- 2:16:56passwords, all just gone. The CEO is
- 2:16:58calling your phone right now. The
- 2:17:00company is literally facing bankruptcy
- 2:17:02in minutes. So, how do you get it back?
- 2:17:05Well, you get it back with backups.
- 2:17:07Let's start from zero here. What
- 2:17:08actually is a backup strategy? It's a
- 2:17:11guaranteed safe point for your entire
- 2:17:13architecture to ensure data availability
- 2:17:15and durability. You know, systems don't
- 2:17:17just fail from hurricanes or power
- 2:17:19outages. They fail from ransomware,
- 2:17:21malicious attacks, and simple human
- 2:17:23error. Without a backup, a single
- 2:17:25mistake permanently destroys your
- 2:17:27business. To fix this, you have to
- 2:17:29master a concept called RPO or recovery
- 2:17:33point objective. RPO is really just a
- 2:17:36timer for data loss. It's the exact
- 2:17:38amount of data you are mathematically
- 2:17:40willing to lose. If your boss says the
- 2:17:42business can only survive losing 1 hour
- 2:17:44of customer orders, your RPO is 1 hour.
- 2:17:47That means you must save the state of
- 2:17:49your system every single hour. Now, let
- 2:17:52me show you the two core ways AWS
- 2:17:54handles this. First, we have snapshots.
- 2:17:57A snapshot is a point in time copy of a
- 2:18:00single resource, like an Amazon EBS
- 2:18:02storage drive attached to a server.
- 2:18:05Think about it like taking a photo of a
- 2:18:06highly complex math equation on a
- 2:18:08whiteboard. If someone accidentally
- 2:18:10erases the board, you don't panic. You
- 2:18:12just look at your photo and write the
- 2:18:14numbers back out. It's incredibly simple
- 2:18:16and effective. But what happens if you
- 2:18:19don't use it? you lose the data on that
- 2:18:21drive permanently and you are building
- 2:18:24from scratch. The trade-off with simple
- 2:18:27snapshots is manual overhead. If you
- 2:18:29have five web servers, taking manual
- 2:18:31snapshots of each drive is easy. But now
- 2:18:34imagine this in your system. You don't
- 2:18:36have five servers. You have 500 EC2
- 2:18:39instances, 50 Amazon RDS databases, and
- 2:18:42a dozen Amazon EFS file systems. You
- 2:18:45can't manually click create snapshot on
- 2:18:47all of those every single hour. you will
- 2:18:49miss one and that will be the exact
- 2:18:51drive that crashes. And that brings us
- 2:18:54to the second approach, AWS backup. AWS
- 2:18:58backup is a centralized, fully managed
- 2:19:00service. Instead of you running around
- 2:19:02taking photos of whiteboards, AWS backup
- 2:19:05is a highly trained security guard you
- 2:19:07hire. This guard automatically walks
- 2:19:09through every single room in your
- 2:19:10company, takes a photo of every single
- 2:19:12whiteboard, and locks those photos in a
- 2:19:14concrete vault, completely hands-off.
- 2:19:17So, if snapshots are the actual photos,
- 2:19:19AWS Backup is the automated photographer
- 2:19:22managing all of it. Now, here's the part
- 2:19:24that actually matters. Here is where
- 2:19:26people completely fail this in the real
- 2:19:27world. Backups are entirely useless if
- 2:19:30they get deleted alongside your main
- 2:19:32data. If a hacker gets into your AWS
- 2:19:34account and deletes your servers, they
- 2:19:36will just delete your snapshots, too.
- 2:19:38Your business still dies. This is where
- 2:19:41true engineering comes in. AWS backup
- 2:19:44allows you to force your backups into a
- 2:19:45completely separate AWS account or a
- 2:19:47completely different AWS region. Even if
- 2:19:50your entire primary account is
- 2:19:51compromised, corrupted, or completely
- 2:19:53destroyed, your data is locked away and
- 2:19:55perfectly safe in another time zone.
- 2:19:58Think about that for a second. Your
- 2:19:59primary data center burns to the ground,
- 2:20:02but you just log into a backup account,
- 2:20:03hit restore, and your entire application
- 2:20:06spins back to life exactly as it was.
- 2:20:08The key takeaway here is that true
- 2:20:11resiliency means physically and
- 2:20:13logically separating the backup from the
- 2:20:15source. So when do you choose which? You
- 2:20:17use manual snapshots when you are
- 2:20:19testing a single server doing a quick
- 2:20:21software update and just want a fast
- 2:20:23undo button. You choose AWS backup when
- 2:20:26you are running an enterprise
- 2:20:27environment and need guaranteed
- 2:20:29automated compliance across thousands of
- 2:20:31resources at once. If you are taking the
- 2:20:33AWS solutions architect exam, do not
- 2:20:37miss this trap. AWS will test your
- 2:20:39knowledge on cost optimization for these
- 2:20:41resilient architectures. They will ask
- 2:20:44you the most cost-effective way to store
- 2:20:46long-term backups. Remember that EBS
- 2:20:48snapshots are incremental. They only
- 2:20:51save the tiny blocks of data that
- 2:20:52changed since your last snapshot, which
- 2:20:54saves you a massive amount of storage
- 2:20:56money. But for true long-term
- 2:20:58compliance, AWS will want you to use AWS
- 2:21:02Backup to automatically transition your
- 2:21:04old backups into cheaper, cold storage
- 2:21:06tiers. Let's do a fast punchy recap.
- 2:21:10Snapshots are point-in time pictures of
- 2:21:12your data. AWS backup is the automated
- 2:21:14brain that manages all of those pictures
- 2:21:17across your entire AWS environment.
- 2:21:19Cross region and cross account backups
- 2:21:21save you from total disaster. Here are
- 2:21:24your three rapidfire takeaways. One,
- 2:21:27snapshots are incremental, saving you
- 2:21:29storage costs. Two, AWS backup centrally
- 2:21:33manages data across multiple AWS
- 2:21:35services like Amazon EBS, Amazon EFS,
- 2:21:38and Amazon RDS. And three, your RPO
- 2:21:42dictates exactly how often you need to
- 2:21:44trigger these backups. And here is your
- 2:21:47final warning. Never assume a snapshot
- 2:21:50is a full disaster recovery plan. If you
- 2:21:53do not actively practice restoring that
- 2:21:55snapshot, you do not have a backup. You
- 2:21:57just have a false sense of security. So
- 2:21:59ask yourself, when was the last time you
- 2:22:02actually tested your disaster recovery
- 2:22:04plan?
- 2:22:04>> Let's jump right in. I want you to
- 2:22:06imagine this scenario. Your company just
- 2:22:09dropped a massive multi-million dollar
- 2:22:11Super Bowl ad. It's the absolute biggest
- 2:22:14moment in your company's history.
- 2:22:15Millions of people see it. They pull out
- 2:22:17their phones and they flood your website
- 2:22:19at the exact same second to buy your
- 2:22:21product. Your web servers, they actually
- 2:22:24handle it perfectly. But your backad
- 2:22:26database, it gets completely crushed by
- 2:22:28the sudden flood of transactions. It
- 2:22:30chokes and then it crashes. The entire
- 2:22:33site goes down. You're looking at
- 2:22:34millions of dollars in lost sales and
- 2:22:37your brand is suddenly an absolute joke
- 2:22:38on social media. That pain right there,
- 2:22:41that is exactly what we're fixing today.
- 2:22:44So the big question is why did your
- 2:22:46website actually crash? Your web servers
- 2:22:49were fine, right? Well, they handled the
- 2:22:51front-end traffic beautifully, but the
- 2:22:53underlying architecture was inherently
- 2:22:55flawed. It was what we call tightly
- 2:22:58coupled. Because it was tightly coupled,
- 2:23:00the overwhelmed back-end database
- 2:23:02choked. And because the backend choked,
- 2:23:04it literally dragged the entire website
- 2:23:06down with it. Let's do a direct
- 2:23:08comparison here. Tightly coupled versus
- 2:23:11decoupled. Any tightly coupled system,
- 2:23:14component A talks directly to component
- 2:23:16B. It relies on it completely. For
- 2:23:18example, your web server hands a
- 2:23:20customer order directly to the payment
- 2:23:21server. If that payment server is slow,
- 2:23:23your web server just has to stand there
- 2:23:25and wait. And if the payment server
- 2:23:27completely dies, the web server drops
- 2:23:29the order entirely. To fix this, we have
- 2:23:31to use a concept called decoupling.
- 2:23:34Decoupling just means breaking your
- 2:23:35application apart so the individual
- 2:23:37components don't rely directly on each
- 2:23:39other. If one piece breaks, the rest of
- 2:23:41the system doesn't even care. And this
- 2:23:43is brilliantly where Amazon Web Services
- 2:23:45comes in. The ultimate AWS tool for
- 2:23:47decoupling is Amazon SQS. SQS stands for
- 2:23:50a simple Q service. And honestly, it is
- 2:23:53exactly what it sounds like. It's simply
- 2:23:54a waiting line for your data. Let's
- 2:23:57picture this using a really relatable
- 2:23:58fast food analogy. Think about a
- 2:24:00drive-thru. If there's no line, the
- 2:24:03cashier taking your order has to
- 2:24:04literally run to the kitchen, cook your
- 2:24:06burger, and hand it to you before they
- 2:24:08can even look at the next car. That's
- 2:24:10our tightly coupled system. If a whole
- 2:24:12tour bus shows up, the whole restaurant
- 2:24:14crashes. But now, introduce SQS. SQS is
- 2:24:17the ticket rail in the kitchen. The
- 2:24:19cashier instantly takes your order,
- 2:24:20slaps the ticket on the SQS rail, and
- 2:24:22immediately greets the next car. They
- 2:24:24are completely free. The cooks in the
- 2:24:26kitchen then pull those tickets off the
- 2:24:27rail at their own pace. If a cook goes
- 2:24:29on break or if the kitchen catches fire,
- 2:24:31the cashier out front doesn't care. They
- 2:24:33just keep putting tickets on the rail.
- 2:24:34Think about that for a second. If your
- 2:24:36backend payment server dies, your web
- 2:24:38server doesn't crash. It just keeps
- 2:24:40tossing customer orders into the SQSQ.
- 2:24:43When you finally fix that backend server
- 2:24:4510 minutes later, it wakes up, looks at
- 2:24:47the queue, and seamlessly starts
- 2:24:49processing the orders that were sitting
- 2:24:50there waiting for it. The queue is a
- 2:24:52shock absorber. It completely protects
- 2:24:54your fragile backend from massive,
- 2:24:56unpredictable spikes in traffic. Now,
- 2:24:58pay close attention here because this is
- 2:25:00where people absolutely mess up in the
- 2:25:02real world. You might assume that SQS
- 2:25:04pushes data directly to your backend
- 2:25:06servers. It doesn't. SQS is a completely
- 2:25:09passive pollbased system. Your backend
- 2:25:11EC2 instances have to actively pull the
- 2:25:14queue. They have to constantly ask,
- 2:25:15"Hey, got any messages for me? Hey, got
- 2:25:17any messages for me?" And that brings us
- 2:25:19to a massive engineering challenge.
- 2:25:21Imagine you suddenly have a thousand
- 2:25:23messages sitting in your queue. If your
- 2:25:25web servers are dropping 10,000 messages
- 2:25:27a second into the queue, but you only
- 2:25:29have two backend servers pulling
- 2:25:30messages out, that queue gets deeper and
- 2:25:33deeper and deeper. Eventually, those
- 2:25:35messages expire, and you literally lose
- 2:25:37real customer data. So, what do you do?
- 2:25:40Well, instead of guessing how many
- 2:25:41servers you need, use the SQSQP
- 2:25:43threshold to trigger AWS autoscaling.
- 2:25:46You tell AWS, hey, if there are more
- 2:25:48than a thousand messages waiting in the
- 2:25:50queue, automatically spin up 50 more EC2
- 2:25:52instances to process them. And when the
- 2:25:54que is finally empty, shut them all down
- 2:25:55to save money. SQS doesn't just hold
- 2:25:58data. It acts as the core metric that
- 2:26:00actually drives your cloud elasticity.
- 2:26:02So when do you actually use this? Let's
- 2:26:05slow down slightly and really look at
- 2:26:07the difference between asynchronous and
- 2:26:09synchronous processing. You use SQS
- 2:26:12strictly for asynchronous processing.
- 2:26:14These are things like sending batch
- 2:26:16emails, processing user uploads, or
- 2:26:18rendering heavy video files. Basically,
- 2:26:20any task where the user clicks a button
- 2:26:22and does not need a subsecond instant
- 2:26:24response. You absolutely do not use SQS
- 2:26:27for real-time synchronous actions. If
- 2:26:30you're streaming a live video or
- 2:26:31querying a live database where the user
- 2:26:33is staring at a loading screen waiting
- 2:26:35for an instant answer, SQS is definitely
- 2:26:37the wrong tool. Now, if you're studying
- 2:26:40for the AWS solutions architect exam,
- 2:26:42SA3, listen up. AWS absolutely loves
- 2:26:46testing this. They'll give you a
- 2:26:47scenario where a monolithic application
- 2:26:49is failing because a back-end component
- 2:26:51can't keep up with web traffic. The
- 2:26:53question will ask for the most resilient
- 2:26:54or loosely coupled solution. The answer
- 2:26:57almost always involves throwing an SQSQ
- 2:26:59right in the middle of the architecture.
- 2:27:01But watch out for their favorite trap.
- 2:27:02They will constantly try to confuse you
- 2:27:04between Amazon SQS and Amazon SNS. Let's
- 2:27:07clear this up right now. SNS is a
- 2:27:09pushbased notification service. It
- 2:27:11blasts messages out. SQS is a pollbased
- 2:27:14queue. It simply holds messages until a
- 2:27:16worker is ready. Do not mix those up on
- 2:27:18exam day. Okay, let's bring this all
- 2:27:21together with three rapidfire takeaways.
- 2:27:24Number one, tightly coupled systems
- 2:27:26break under pressure, but decoupling
- 2:27:28isolates your components. And SQS is the
- 2:27:30primary AWS service used to do this.
- 2:27:33Number two, it's a pull-based polling
- 2:27:35system, not a push system. And number
- 2:27:37three, you should always use the SQSQ to
- 2:27:40trigger horizontal autoscaling for your
- 2:27:42compute resources. And that brings us to
- 2:27:44our final point today. SQS has no brain.
- 2:27:49It is literally just a waiting room. I
- 2:27:51want to leave you with that thought.
- 2:27:53Don't fall into the trap of thinking SQS
- 2:27:55solves all your processing problems
- 2:27:57magically on its own. It holds the data
- 2:27:59safely, yes, but you still need to
- 2:28:01actively design the compute resources
- 2:28:03that actually pull that data and do the
- 2:28:05heavy lifting. Imagine this scenario for
- 2:28:07a second. A customer is on your massive
- 2:28:10e-commerce site and they finally hit buy
- 2:28:12now. Behind the scenes, your web server
- 2:28:15springs into action. It instantly tries
- 2:28:17to charge their credit card, update your
- 2:28:19inventory database, print out a physical
- 2:28:21shipping label, and then finally send
- 2:28:22them a confirmation email. At first
- 2:28:25glance, everything seems perfectly fine,
- 2:28:27right? Just a standard transaction. But
- 2:28:30what happens if your email server is
- 2:28:31temporarily down? Because everything in
- 2:28:34this specific pipeline is tightly tied
- 2:28:35together, one broken link means the
- 2:28:37entire transaction fails. Your customer
- 2:28:40screen freezes up. They get this giant
- 2:28:42frustrating error message. And you,
- 2:28:44well, you just lost a massive sale all
- 2:28:46over a broken email server. Think about
- 2:28:48that for a second. How do we actually
- 2:28:50stop this from happening? Well, the
- 2:28:52answer is you stop building rigid
- 2:28:54pipelines and you start building
- 2:28:56eventdriven architectures. Let's break
- 2:28:58down exactly what that means. In an
- 2:29:00event- driven architecture, your
- 2:29:02components literally do not give
- 2:29:03commands to each other. They don't boss
- 2:29:05each other around. Instead, they simply
- 2:29:07announce things. A component just says,
- 2:29:09"Hey, an event just happened." And then
- 2:29:10it immediately goes right back to its
- 2:29:12own job. This completely decouples your
- 2:29:14workloads, meaning your components can
- 2:29:16now scale up and fail completely
- 2:29:18independently of one another. But to
- 2:29:20make this magic work, you really need a
- 2:29:22middleman. You need a publish and
- 2:29:24subscribe system, which you'll usually
- 2:29:25hear called pub. Look at the contrast
- 2:29:27here. It's pretty stark. In a
- 2:29:29traditional system, component A directly
- 2:29:31tells component B what to do. So if
- 2:29:33component B is broken, component A
- 2:29:35crashes right along with it. It's
- 2:29:37incredibly fragile. But in an event-
- 2:29:40driven system, those components just
- 2:29:42announce their events to a pub/
- 2:29:44middleman. That middleman acts as a
- 2:29:46buffer between the two. And honestly,
- 2:29:48this is the resilient magic of event-
- 2:29:49driven architectures.
- 2:29:51All right, let's jump into section one,
- 2:29:54Amazon SNS, the ultimate megaphone.
- 2:29:57Let's talk about our first heavy hitter
- 2:29:59in AWS that makes all this happen. Think
- 2:30:03of Amazon SNS as exactly that, the
- 2:30:05ultimate megaphone. SNS is a pushbased
- 2:30:08service and it's designed to instantly
- 2:30:11blast messages out to multiple receivers
- 2:30:13at the exact same time. It's kind of
- 2:30:16like a radio tower. The DJ speaks into
- 2:30:18the microphone and that audio is
- 2:30:20instantly pushed out in every possible
- 2:30:23direction. That radio tower absolutely
- 2:30:25does not care if one car is listening or
- 2:30:27if a million cars are listening. It just
- 2:30:29broadcasts. Now, without a service like
- 2:30:32SNS, your web server has to run custom
- 2:30:35code to individually connect to your
- 2:30:36database, then your analytics engine,
- 2:30:39and then your email server one by one.
- 2:30:41That creates a tightly coupled
- 2:30:43bottleneck. But here is where people
- 2:30:45mess up. The trap with SNS is that it
- 2:30:48just shouts and forgets. It absolutely
- 2:30:51does not hold on to messages if the
- 2:30:53receiving system happens to be offline.
- 2:30:55Think about it. If your car radio is
- 2:30:57turned off, you miss the song. Let's
- 2:30:59walk through that orderplace scenario
- 2:31:01again, but doing it the right way. Your
- 2:31:03web server just drops one single message
- 2:31:05into SNS. Order placed. And that's it.
- 2:31:08The web server's job is literally done
- 2:31:10in one millisecond. SNS then instantly
- 2:31:13takes over and pushes that message to
- 2:31:15five different backend microservices in
- 2:31:18parallel. This is the absolute magic of
- 2:31:21loose coupling. Your web server doesn't
- 2:31:23even know those other backend services
- 2:31:25exist, which means it can never ever be
- 2:31:27slowed down by them. But here is a
- 2:31:29really crucial question. Where do people
- 2:31:32completely fail with this in the real
- 2:31:34world? Well, SNS is amazing for simple,
- 2:31:37loud broadcasting, but what if your
- 2:31:39architecture gets complicated? For
- 2:31:41example, what if you only want the
- 2:31:43shipping department to get a message if
- 2:31:45the customer ordered a physical item,
- 2:31:46but definitely not if they just bought a
- 2:31:48digital download? Well, SNS simply isn't
- 2:31:51smart enough to read the message and
- 2:31:53selectively route it based on complex
- 2:31:54rules like that. And that brings us to
- 2:31:57section two, Amazon Event Bridge, the
- 2:32:00smart router. Event Bridge is our
- 2:32:02solution for that complex routing. It's
- 2:32:04a highly intelligent event bus. So
- 2:32:07instead of just blindly shouting like
- 2:32:09SNS, EventBridge actually inspects the
- 2:32:11data inside the event. It filters it
- 2:32:13based on custom rules that you define
- 2:32:15and then it routes it to very specific
- 2:32:17targets. Think of Event Bridge like a
- 2:32:20massive fully automated post office. The
- 2:32:22mail sorter literally looks at the zip
- 2:32:24code on every single envelope. It
- 2:32:26filters them out and drops them into the
- 2:32:28exact right bucket for the exact right
- 2:32:29delivery driver. What happens if you try
- 2:32:31to build a system without it? you end up
- 2:32:33writing hundreds of lines of complex
- 2:32:35messy if then routing logic directly
- 2:32:37into your application code and that just
- 2:32:39creates a fragile mess that breaks every
- 2:32:41single time you try to update it. Now I
- 2:32:43want you to imagine this running in your
- 2:32:45system. An EC2 server crashes in your
- 2:32:47environment. Instantly AWS drops an
- 2:32:49event into Event Bridge. Event bridge
- 2:32:51reads that event, filters it based on a
- 2:32:53specific rule you built and then it
- 2:32:55automatically triggers an AWS Lambda
- 2:32:57function to go and reboot the server.
- 2:32:59Think about that for a second. Event
- 2:33:01Bridge is acting as the central nervous
- 2:33:03system for your entire AWS account. It's
- 2:33:05automatically choreographing fixes
- 2:33:07before a human even notices there was a
- 2:33:09problem. So let's slow down and
- 2:33:11carefully contrast these two because you
- 2:33:13need to know when to choose which. You
- 2:33:15go with Amazon SNS when you need high
- 2:33:17throughput simple pub sub broadcasting.
- 2:33:20You just need that dumb megaphone to
- 2:33:21push one message out to many subscribers
- 2:33:23instantly. On the flip side, you choose
- 2:33:26Amazon Event Bridge when you need
- 2:33:27complex rule-based routing, scheduled
- 2:33:29events, or when you want to trigger
- 2:33:31workflows automatically based on exactly
- 2:33:33what is happening inside your AWS
- 2:33:35infrastructure. Moving on to section
- 2:33:38three, the AWS exam trap. Look, if you
- 2:33:42are preparing for the AWS solutions
- 2:33:44architect associate exam right now, do
- 2:33:47not miss this. It is a classic pitfall.
- 2:33:49AWS will constantly try to confuse you
- 2:33:52between Amazon SNS and Amazon SQS. Pay
- 2:33:55attention to the exact wording. If the
- 2:33:58exam asks for a publish subscribe
- 2:34:00messaging model to push alerts, the
- 2:34:02answer is always SNS. But if the exam
- 2:34:05asks you to decouple an architecture by
- 2:34:07holding or storing messages until a
- 2:34:09worker is ready to pull them, the answer
- 2:34:11is the SQSQ. SNS pushes alerts
- 2:34:14instantly. SQS holds messages safely.
- 2:34:18Okay, let's do a fast punchy recap to
- 2:34:20really lock this all in. Event-driven
- 2:34:22architectures decouple your systems so
- 2:34:25they literally can't break each other.
- 2:34:27Here are your three rapidfire takeaways.
- 2:34:29Number one, both of these services are
- 2:34:31absolutely critical for building highly
- 2:34:33available fault tolerant cloud
- 2:34:35environments. Number two, SNS uses a pub
- 2:34:38sub model to instantly push data to
- 2:34:40subscribers exactly like a megaphone.
- 2:34:42And number three, EventBridge is heavily
- 2:34:44used to trigger serverless workflows
- 2:34:46like AWS Lambda based on custom rules
- 2:34:49acting as your smart router. And before
- 2:34:52we wrap up, here is your final warning.
- 2:34:55Never assume that event driven means
- 2:34:56reliable delivery all by itself. If you
- 2:34:59push an event from SNS and the target
- 2:35:00server happens to be down, that message
- 2:35:02is just gone. For true reliability, you
- 2:35:05often have to combine SNS with SQS to
- 2:35:07catch and hold that data safely. So
- 2:35:10think about how you are building your
- 2:35:11pipelines right now. Are they rigid and
- 2:35:13fragile or are they truly decoupled?
- 2:35:15>> Designing fault tolerant systems. All
- 2:35:17right, let's just dive straight into
- 2:35:19this one. I want you to imagine for a
- 2:35:21second that you are checking out on a
- 2:35:23massive e-commerce site on Black Friday.
- 2:35:25You've been waiting all week for this
- 2:35:27exact deal. You finally hit that
- 2:35:30purchase button on a brand new $1,000
- 2:35:32TV. But exactly at that specific
- 2:35:35millisecond, the physical server
- 2:35:37processing your order literally catches
- 2:35:39fire in the data center. I'm talking
- 2:35:42motherboards frying, cables melting,
- 2:35:44that machine is completely 100% dead.
- 2:35:47So, what happens next? Does your screen
- 2:35:50just suddenly freeze up? Do you actually
- 2:35:52lose your money? Or does the order just
- 2:35:54somehow go through completely normally?
- 2:35:56Think about that for a second because
- 2:35:58the difference between those outcomes is
- 2:36:00exactly what we're looking at in today's
- 2:36:02explainer fault tolerance. Let's start
- 2:36:04from zero here. At the end of the day,
- 2:36:06servers are just computers. And we all
- 2:36:09know computers break, network cables get
- 2:36:11accidentally cut, and sometimes entire
- 2:36:13data centers just lose power. If your
- 2:36:16architecture relies on one single server
- 2:36:18to do its job, well, that is called a
- 2:36:20single point of failure. When that
- 2:36:22server dies, your business dies with it.
- 2:36:25Designing resilient architectures is
- 2:36:27entirely about mitigating those single
- 2:36:28points of failure so your application
- 2:36:30can actually survive the chaos. Section
- 2:36:33one, high availability versus fault
- 2:36:35tolerance. Let's look at the core
- 2:36:37differences between these two concepts.
- 2:36:40High availability essentially means the
- 2:36:42system might actually go down, but it
- 2:36:43recovers incredibly fast. The user is
- 2:36:46definitely going to experience a brief
- 2:36:47interruption. Maybe they see a loading
- 2:36:49spinner, a slight delay, or maybe a
- 2:36:51quick retry screen, but eventually the
- 2:36:53system does recover and gets back to
- 2:36:54normal. Fault tolerance, on the other
- 2:36:56hand, means the system never stops. It
- 2:36:59literally tolerates the failure with
- 2:37:02absolutely zero interruption to the end
- 2:37:04user. Traffic is instantly rerouted to
- 2:37:06backup systems and the user experience
- 2:37:09continues seamlessly. They have
- 2:37:11absolutely no idea anything went wrong
- 2:37:13behind the scenes. Think about it like
- 2:37:15driving a vehicle. High availability is
- 2:37:17basically a standard car with a spare
- 2:37:19tire. If you blow a tire, you have to
- 2:37:21pull over, jack up the car, and
- 2:37:23physically change it. Sure, it saves you
- 2:37:25from being completely stranded, but
- 2:37:27there is a clear, noticeable delay. Your
- 2:37:29trip was interrupted. Fault tolerance is
- 2:37:31driving a massive 18-wheeler truck. If
- 2:37:34one of those tires completely blows out
- 2:37:35on the highway at 70 mph, the driver
- 2:37:37doesn't even have to tap the brakes. The
- 2:37:39other 17 tires instantly absorb all that
- 2:37:41massive weight. The truck just keeps
- 2:37:43driving like nothing happened. Section
- 2:37:45two, building the 18-wheeler in AWS.
- 2:37:48Let's see how we actually build this
- 2:37:5018-wheeler truck in the cloud. Because
- 2:37:52if you don't use the strategy, a single
- 2:37:54hardware failure is going to cause drop
- 2:37:56transactions, corrupted databases, and
- 2:37:58massive brand damage. We do this by
- 2:38:01using what AWS calls availability zones.
- 2:38:03An availability zone is simply a
- 2:38:05physically separated data center with
- 2:38:07its own independent power and its own
- 2:38:09independent cooling. You put your main
- 2:38:11servers over in zone A. Then you put
- 2:38:14redundant exact clone servers over in
- 2:38:16zone B. But here's the thing. Servers
- 2:38:19can't do this alone. You need a traffic
- 2:38:21cop. So you put an application load
- 2:38:23balancer right in front of them. This
- 2:38:25load balancer is constantly pinging the
- 2:38:27servers. Basically asking, "Hey, are you
- 2:38:30healthy? Are you still there?" Now
- 2:38:32imagine this happening in your system.
- 2:38:34The load balancer detects that a server
- 2:38:36in zone A just crashed. It stops sending
- 2:38:38traffic there in a fraction of a second
- 2:38:40and it silently reroutes all new traffic
- 2:38:43straight over to the surviving servers
- 2:38:45in zone B. The system isn't actually
- 2:38:47invincible. It just hides the failure
- 2:38:50perfectly from the end user. Let that
- 2:38:53sink in for a second. That is the real
- 2:38:55magic of this architecture. Section
- 2:38:58three, the cost of perfection. And
- 2:39:00listen, this is where people completely
- 2:39:02mess up in the real world. Building true
- 2:39:05fault tolerance is incredibly complex.
- 2:39:07Think about it. If server A dies right
- 2:39:09in the middle of a transaction, server B
- 2:39:11needs to know exactly what was in that
- 2:39:13user's shopping cart so it can
- 2:39:14immediately take over. That means you
- 2:39:16absolutely cannot store user data on the
- 2:39:19compute servers themselves. You have to
- 2:39:20design stateless workloads. You push
- 2:39:23that cart data to external databases or
- 2:39:25caching layers, completely decoupling
- 2:39:27the stateful data so back-end processing
- 2:39:29can happen at its own pace. Doing this
- 2:39:31changes your entire engineering
- 2:39:33codebase. It is also absolutely brutal
- 2:39:35on your budget. You are paying out of
- 2:39:37pocket to run duplicate servers and
- 2:39:39duplicate databases across multiple
- 2:39:41zones. If you blindly make every single
- 2:39:43application perfectly fall tolerant, you
- 2:39:44will bankrupt your company. You only
- 2:39:46choose true fault tolerance for mission
- 2:39:48critical systems. Things like payment
- 2:39:49processors, healthcare records, stock
- 2:39:51trading platforms, systems where
- 2:39:53dropping one single transaction
- 2:39:54literally costs a million dollars or
- 2:39:56ruins someone's life. For basic internal
- 2:39:58tools, a three-minute hiccup is
- 2:39:59annoying. Sure, but it's totally fine.
- 2:40:02So, the crucial point to remember is
- 2:40:04that fault tolerance isn't just a cool
- 2:40:06IT feature. It is a massive financial
- 2:40:10insurance policy, and you pay for that
- 2:40:13policy with heavy cloud infrastructure.
- 2:40:15Section four, AWS exam strategy. Here
- 2:40:19are a few quick tips for the test. If
- 2:40:22you are a focused learner currently
- 2:40:24studying for the AWS Solutions Architect
- 2:40:26exam, pay really close attention here.
- 2:40:28AWS will definitely try to trick you.
- 2:40:31Designing resilient architectures makes
- 2:40:33up 26% of your entire test. This is what
- 2:40:37actually matters for passing. If an exam
- 2:40:40question asks how to implement a fault
- 2:40:42tolerant architecture to mitigate a
- 2:40:44single point of failure, do not pick the
- 2:40:46answer that just says take daily
- 2:40:48backups. Backups are just data recovery.
- 2:40:51They absolutely do not keep the site
- 2:40:53online. Do pick the answer that combines
- 2:40:55an application load balancer with an
- 2:40:58autoscaling group spread across multiple
- 2:41:00availability zones. And if the question
- 2:41:02scales up to global disaster recovery
- 2:41:04across entire regions, you need to look
- 2:41:07for Amazon Route 53. That is the
- 2:41:09critical answer to manage that massive
- 2:41:11failover traffic. Section five, rapid
- 2:41:14fire takeaways. Let's do a really fast
- 2:41:17punchy recap to lock this all in.
- 2:41:20Remember, high availability is
- 2:41:21recovering fast while fault tolerance is
- 2:41:24never going down. We achieve this by
- 2:41:26spreading redundant infrastructure
- 2:41:27across multiple AWS availability zones
- 2:41:30and load balancing the traffic. Here are
- 2:41:32your three rapidfire takeaways. One,
- 2:41:34single points of failure are the
- 2:41:36absolute biggest enemy in your cloud
- 2:41:38architecture. Two, true fault tolerance
- 2:41:40requires decoupling your stateful data
- 2:41:42from your compute servers. Three,
- 2:41:44application load balancers and Amazon
- 2:41:46Route 553 are the critical routing
- 2:41:48mechanisms that make that failover
- 2:41:50completely invisible to your users. And
- 2:41:53here is your final warning for today.
- 2:41:55Are you buying an 18-wheeler just to go
- 2:41:57get groceries? Do not overengineer.
- 2:42:01Building a perfectly fault tolerant
- 2:42:03architecture for a simple personal blog
- 2:42:05is exactly like that. Always match your
- 2:42:08cloud architecture to your actual
- 2:42:10business risk. Keep learning. Keep
- 2:42:13building and make sure you're always
- 2:42:14designing for the real world.
- 2:42:16>> All right, let's set the scene. Imagine
- 2:42:18a customer on your app. They just hit
- 2:42:20buy now on a $1,000 flight. But then the
- 2:42:23loading spinner just freezes. They
- 2:42:25panic, right? So what do they do? They
- 2:42:27hit the button three more times. A
- 2:42:29minute later, their phone buzzes. But
- 2:42:31they weren't charged once. They were
- 2:42:33charged four times. $4,000 instantly
- 2:42:37drained from their bank account. Your
- 2:42:38support inbox is absolutely about to
- 2:42:41explode. in your company. Yeah, you're
- 2:42:43about to be humiliated on social media.
- 2:42:45So, how do you stop this from happening?
- 2:42:48Well, in this explainer, we're going to
- 2:42:49see that you really just need to master
- 2:42:51two concepts. Retries and it impotency.
- 2:42:54Let's start from zero here. The cloud is
- 2:42:56really just a giant web of cables and
- 2:42:58servers. And you know how it goes.
- 2:43:00Sometimes network connections drop.
- 2:43:02Sometimes a database takes a millisecond
- 2:43:04too long to answer. In a distributed
- 2:43:06microser architecture, things fail
- 2:43:08constantly. It's just a fact of life.
- 2:43:11Now, think about the blind retry
- 2:43:13nightmare. If your web server sends a
- 2:43:15charge request to the payment server and
- 2:43:18doesn't hear back, what does it do?
- 2:43:20Naturally, it retries. But here is the
- 2:43:23real nightmare scenario. What if the
- 2:43:26payment server actually did charge the
- 2:43:28card, but the success message just got
- 2:43:30lost on the way back? If your web server
- 2:43:32just blindly retries, you charge the
- 2:43:34customer twice. To fix this exact
- 2:43:36problem, we need item potency. I know
- 2:43:39it's a massive, intimidating word, but
- 2:43:41it has an incredibly simple meaning.
- 2:43:43Item potency simply means that no matter
- 2:43:45how many times you run the exact same
- 2:43:47request, the end result only happens the
- 2:43:50very first time. Think about it like an
- 2:43:52elevator button. You press the button
- 2:43:54for the fifth floor and the elevator
- 2:43:56takes you to the fifth floor. If you
- 2:43:58panic and smash that button 10 more
- 2:44:00times, it doesn't take you to the 50th
- 2:44:02floor. It just takes you to the fifth
- 2:44:03floor. The extra clicks do absolutely
- 2:44:05nothing. It really is the ultimate
- 2:44:07safety net against duplicate actions.
- 2:44:09Okay, so how do we actually build this
- 2:44:11into our apps? It's simple. We use an
- 2:44:14item potency key. Here's how it works.
- 2:44:17When the user hits buy, your app
- 2:44:19generates a unique string of letters and
- 2:44:21numbers, basically a token. It sends
- 2:44:23that token right along with the payment.
- 2:44:25If the network drops and the app has to
- 2:44:27retry, it sends the exact same token.
- 2:44:30The payment server looks at it and says,
- 2:44:31"Wait a minute. I already processed
- 2:44:33token XYZ. I'm not charging them again.
- 2:44:35I'll just send back the success message
- 2:44:38because what happens if you don't use
- 2:44:39it? You bankrupt your customers.
- 2:44:42Think about that for a second. Now,
- 2:44:44listen closely because this is where
- 2:44:46people completely mess up. They
- 2:44:48understand they need to retry failed
- 2:44:50requests, but they build naive retries.
- 2:44:52Think about it. If your database gets
- 2:44:54overloaded, it slows down. If your web
- 2:44:56servers aggressively retry every single
- 2:44:58failed request every half second, what
- 2:45:00happens? They double the traffic. Then
- 2:45:02they quadruple it. You literally DDoS
- 2:45:05your own architecture and crash the
- 2:45:07entire company. To survive this, you
- 2:45:09absolutely must use exponential backoff
- 2:45:12and jitter. Exponential backoff means
- 2:45:14you wait longer after every single
- 2:45:16failure. First retry, you wait 1 second.
- 2:45:19Second retry, wait 2 seconds. Third,
- 2:45:22wait 4 seconds. You see what's
- 2:45:23happening? You're backing off. You are
- 2:45:25giving that struggling database some
- 2:45:27much needed room to breathe. But you
- 2:45:30also need jitter. Jitter adds pure
- 2:45:33randomness to the mix. Think about two
- 2:45:36people walking down a hallway who
- 2:45:38accidentally step into each other's
- 2:45:39path. They both step left, then they
- 2:45:42both step right. They're stuck in a
- 2:45:43loop. That right there is a retry storm.
- 2:45:47Jitter is like one person waiting a
- 2:45:48random fraction of a second before
- 2:45:50moving. The collision is instantly
- 2:45:52solved. By randomizing the retry timers,
- 2:45:55your servers don't all attack the
- 2:45:56database at the exact same millisecond.
- 2:45:58So when do you actually use this stuff
- 2:46:01in the real world? Well, when you design
- 2:46:04solutions based on the AWS
- 2:46:06wellarchchitected framework, you really
- 2:46:08have to look at the action being taken.
- 2:46:10Is it a read request? Like are you just
- 2:46:12fetching a user profile? If so, you
- 2:46:15don't need item potency keys. If it
- 2:46:17fails, just retry. But is it a write
- 2:46:20request? Are you processing a payment,
- 2:46:22launching a server, or updating a
- 2:46:24database record? If yes, you absolutely
- 2:46:26must build in IDM potency. And here is a
- 2:46:29huge exam trap warning. If you're taking
- 2:46:32the AWS solutions architect exam, domain
- 2:46:352 heavily tests your ability to design
- 2:46:37loosely coupled resilient architectures.
- 2:46:40AWS loves testing this concept using
- 2:46:42Amazon API gateway and AWS Step
- 2:46:44Functions. So, if a test scenario
- 2:46:46describes an API that's failing due to
- 2:46:48too many requests or throttling, do not
- 2:46:51pick the answer that tells you to
- 2:46:52immediately provision a bigger database.
- 2:46:54Don't do it. The correct architectural
- 2:46:56answer is almost always to implement
- 2:46:57exponential backoff in your application
- 2:46:59code to handle that throttling
- 2:47:01gracefully. All right, let's do a fast
- 2:47:03punchy recap. Edom potency means doing
- 2:47:06something multiple times only changes
- 2:47:07the data once. Retries save you from
- 2:47:10temporary network drops and exponential
- 2:47:12backoff and jitter save you from DDoSing
- 2:47:14your own system. Here are your three
- 2:47:16rapidfire takeaways for this explainer.
- 2:47:18One, use item potency keys for any API
- 2:47:21request that changes data or spends
- 2:47:23money. Two, designing scalable and
- 2:47:25loosely coupled microservices requires
- 2:47:27intelligent retry strategies. And three,
- 2:47:30never use fixed retry intervals. Always
- 2:47:32add random jitter. Oh, and here is your
- 2:47:35final trap. Item potency tokens
- 2:47:37shouldn't live forever. If your database
- 2:47:39has to remember every token ever
- 2:47:41generated since the beginning of time,
- 2:47:43your storage costs will absolutely
- 2:47:45explode. Set them to expire
- 2:47:46automatically after 24 hours. Keep your
- 2:47:49system safe and keep them fast. So ask
- 2:47:52yourself, if your network dropped right
- 2:47:54now, would your retry logic save your
- 2:47:57business or accidentally take it
- 2:47:58offline? Welcome to this explainer on
- 2:48:00AWS instance types. You know, if you've
- 2:48:03ever spun up a server in the cloud and
- 2:48:05just wondered why your monthly bill
- 2:48:06looks like a phone number or why your
- 2:48:08app keeps freezing up even though you're
- 2:48:10paying top dollar, well, you are in
- 2:48:12exactly the right place. Let's just dive
- 2:48:14right into it. Picture this. You just
- 2:48:17launched this massive realtime analytics
- 2:48:19tool. Customers are flooding in. They're
- 2:48:21uploading gigabytes of data and then
- 2:48:23your server completely locks up. It is
- 2:48:27literally frozen. So you look at your
- 2:48:29AWS metrics and your CPU is barely
- 2:48:31hovering at 10%. But your memory, it's
- 2:48:34totally maxed out. Your users are
- 2:48:36getting timeout errors. Your boss is
- 2:48:38furiously asking why the thousands of
- 2:48:39dollars you just dropped on AWS compute
- 2:48:42wasn't enough to keep the site online.
- 2:48:44So why did it crash? Well, because you
- 2:48:46bought the absolute wrong type of
- 2:48:48server. Let's start from zero and talk
- 2:48:50about the basics. CPU versus memory.
- 2:48:53Getting this ratio wrong, that's where
- 2:48:55everything falls apart. Let's break this
- 2:48:57down into its absolute simplest form.
- 2:49:00When you launch an instance, you aren't
- 2:49:02just picking some generic server off a
- 2:49:04shelf. You're actually picking an exact
- 2:49:06hardware recipe. It's a specific ratio
- 2:49:08of CPU, memory, networking, and storage.
- 2:49:12But really, a server just has two main
- 2:49:14resources you need to care about right
- 2:49:15now. CPU, which is the brain doing the
- 2:49:18math, and memory or RAM, which is the
- 2:49:20workbench holding the data. Different
- 2:49:22applications need completely different
- 2:49:23balances of these two things. If you get
- 2:49:25this ratio wrong, your application
- 2:49:27either suffocates and dies or you end up
- 2:49:29wasting tens of thousands of dollars on
- 2:49:31hardware you aren't even using. So, the
- 2:49:33absolutely crucial point here is
- 2:49:35understanding your hardware choices. Let
- 2:49:38me show you the three main instance
- 2:49:39families that you really must know.
- 2:49:41First up, general purpose instances.
- 2:49:44Think of the M and T families here.
- 2:49:46These give you a perfectly balanced
- 2:49:48ratio of CPU and memory. Think about it
- 2:49:51kind of like a reliable Honda Civic. You
- 2:49:53know, it's not the absolute fastest car
- 2:49:55on the track, and it definitely can't
- 2:49:57haul a giant commercial trailer, but it
- 2:49:59gets you to work every single day
- 2:50:00without failing. You're going to use
- 2:50:02these for standard web servers, small
- 2:50:04databases, and everyday codebased
- 2:50:06testing. If you don't use them for these
- 2:50:08basic workloads, you're just going to
- 2:50:09end up overpaying for specialized
- 2:50:11hardware you simply do not need. Second,
- 2:50:14we have compute optimized instances, the
- 2:50:16C family. These give you massive,
- 2:50:18incredibly highowered CPUs. Think about
- 2:50:21it like a genius math professor. You
- 2:50:23hand them a massively complex equation
- 2:50:25and they solve it instantly, but they
- 2:50:27don't need a huge physical desk to do
- 2:50:29it. you're going to use compute
- 2:50:31optimized instances for things like
- 2:50:32multiplayer gaming servers, high-res
- 2:50:34video encoding, or heavy machine
- 2:50:36learning inference. And this brilliantly
- 2:50:38illustrates exactly why that distinction
- 2:50:40matters. If you're encoding a 4K video,
- 2:50:43you do not need massive amounts of
- 2:50:45memory to hold user profiles. What you
- 2:50:47need is raw processing power. Think
- 2:50:49about that for a second. By switching to
- 2:50:50a cype instance, your video processes 10
- 2:50:53times faster for half the cost. It's
- 2:50:55like a light bulb goes off, right? you
- 2:50:57are buying the exact tool for the exact
- 2:50:59job. Third, we have memory optimized
- 2:51:02instances. That's the R and X families.
- 2:51:04These come with absolutely massive
- 2:51:06amounts of RAM. Think of it like a giant
- 2:51:0810-ft long workbench. It lets you lay
- 2:51:11out a million puzzle pieces all at once,
- 2:51:13so you can see literally everything
- 2:51:14without having to dig through boxes. You
- 2:51:16use these for high performance
- 2:51:18relational databases or massive
- 2:51:20in-memory caching systems. So, what
- 2:51:22happens if you don't use this? Well, if
- 2:51:24you try to run a heavy memory intensive
- 2:51:25database on a compute optimized server,
- 2:51:28it instantly runs out of memory and
- 2:51:29crashes just like that analytics tool we
- 2:51:31talked about earlier. Now, let's talk
- 2:51:34about the realworld scaling trap. Pay
- 2:51:36close attention here because this this
- 2:51:38is where people completely mess up in
- 2:51:40the real world. Here is how developers
- 2:51:43tend to get lazy. They launch a basic
- 2:51:45web app, it starts running a little
- 2:51:47slow, so they panic and just double the
- 2:51:49size of their general purpose instance.
- 2:51:51Then inevitably it gets slow again down
- 2:51:53the road. So they double it again. They
- 2:51:56are just scaling up vertically using the
- 2:51:58exact same resource ratio. What happens
- 2:52:00is they end up paying for massive
- 2:52:02amounts of memory they aren't even
- 2:52:03touching just to squeeze out a slightly
- 2:52:05better CPU. You literally bankrupt your
- 2:52:08cloud budget by using a massive
- 2:52:09sledgehammer just to push in a tiny
- 2:52:11thumbtack. So how do you actually make
- 2:52:14this choice? It is a strict business and
- 2:52:17engineering decision. You have to look
- 2:52:19at your actual application metrics. If
- 2:52:21the server is starving for brain power,
- 2:52:23you choose compute optimized. If it's
- 2:52:26choking because it just cannot hold
- 2:52:27enough data at once, you choose memory
- 2:52:29optimized. And if it's just doing a
- 2:52:31little bit of everything, you stick to
- 2:52:33general purpose. Once you see it, it
- 2:52:35makes total sense. The application
- 2:52:36workload dictates the hardware family,
- 2:52:38not the other way around. Now, let's
- 2:52:40look at how this applies to the AWS
- 2:52:42exam. Because if you're studying for the
- 2:52:44solutions architect associate,
- 2:52:46understanding this logic is absolutely
- 2:52:48critical. Choosing the right EC2
- 2:52:51instance hits exactly on domain 3, high
- 2:52:53performing architectures, and domain 4,
- 2:52:56costoptimized architectures. Listen, AWS
- 2:52:59will absolutely test your ability to
- 2:53:00select the appropriate compute options,
- 2:53:02instance families, and sizes to meet
- 2:53:04specific business requirements. And here
- 2:53:07is the trap they love to set. AWS will
- 2:53:09give you a scenario where an application
- 2:53:11is memory constrained, but the company
- 2:53:13wants to keep costs low. Do not pick the
- 2:53:15answer that tells you to just upgrade to
- 2:53:17a larger general purpose instance. That
- 2:53:18forces you to pay for extra CPU you just
- 2:53:20don't need. Always select the exact
- 2:53:22instance family memory optimized in this
- 2:53:25case that solves the specific bottleneck
- 2:53:27without wasting money on the other
- 2:53:28resources. All right, let's do a fast
- 2:53:31punchy recap with some rapidfire
- 2:53:33takeaways. Remember, general purpose is
- 2:53:36balanced for everyday traffic. Compute
- 2:53:38is pure brain power. Memory is a massive
- 2:53:41workbench space. We can simplify all of
- 2:53:43this into three core principles. One,
- 2:53:45sizing your instances correctly is the
- 2:53:47absolute foundation of costoptimized
- 2:53:49comput solutions. Two, decoupling your
- 2:53:52workloads allows you to pick different
- 2:53:54specialized instance types for different
- 2:53:55parts of your application. And three,
- 2:53:58the letter in the instance name is your
- 2:53:59actual cheat code. C for compute, R for
- 2:54:02RAM, and M for mainstream. And that
- 2:54:04brings us to your final trap. Never ever
- 2:54:07guess your instance size. Always load
- 2:54:10test your application in a dev
- 2:54:11environment first so you can actually
- 2:54:13see whether it runs out of CPU or memory
- 2:54:15and then pick your family. Guessing in
- 2:54:18production is quite literally just
- 2:54:19gambling with your company's money. So
- 2:54:21I'll leave you with this. Are you going
- 2:54:23to architect for actual success or are
- 2:54:25you going to keep treating your cloud
- 2:54:27budget like a casino?
- 2:54:28>> Imagine you just built a highfrequency
- 2:54:30stock trading bot. We're talking about a
- 2:54:32scenario where literally milliseconds
- 2:54:34equal millions of dollars. You go ahead
- 2:54:37and launch two massive, insanely
- 2:54:40expensive EC2 instances. You've got one
- 2:54:42calculating the market trends and the
- 2:54:44other one executing the actual trades.
- 2:54:46The market opens, but your system is
- 2:54:49lagging. You are bleeding money on every
- 2:54:52single trade. So why is this happening?
- 2:54:55I mean, you bought the absolute best
- 2:54:57servers in the world. Well, it's because
- 2:54:59AWS randomly placed them in completely
- 2:55:02different buildings inside their massive
- 2:55:03data center. The actual physical network
- 2:55:06cable connecting your two instances is
- 2:55:08literally 2 m long. How do we fix this?
- 2:55:11We take direct control of the hardware
- 2:55:13using EC2 placement groups. Let's start
- 2:55:16right from zero here. When you launch a
- 2:55:18virtual server in AWS, they usually just
- 2:55:20throw it onto any available hardware
- 2:55:22rack with open space. And honestly, for
- 2:55:2499% of web apps out there, that's
- 2:55:26perfectly fine. But when you're building
- 2:55:28high performing architectures, physical
- 2:55:30distance matters, hardware failures
- 2:55:32matter. Placement groups give you direct
- 2:55:34absolute control over the actual
- 2:55:36physical placement of your virtual
- 2:55:37servers inside the AWS data center. In
- 2:55:40this explainer, I'm going to show you
- 2:55:42the three exact strategies you
- 2:55:43absolutely must know. Let's dive right
- 2:55:46into strategy number one, cluster
- 2:55:48placement. This one is all about getting
- 2:55:50blistering network speed. With a cluster
- 2:55:53setup, you're essentially telling AWS,
- 2:55:55"Hey, put all of my servers on the exact
- 2:55:58same physical rack and plug them into
- 2:56:00the exact same network switch." Why does
- 2:56:02this exist? It's for blistering,
- 2:56:04ridiculously fast network speed. We are
- 2:56:07talking 10 GBs per second of pure
- 2:56:09throughput. Think about it like moving
- 2:56:11your entire engineering team into one
- 2:56:13tiny conference room. If you need to ask
- 2:56:15a question, you don't write up an email
- 2:56:17and wait around. You just yell across
- 2:56:19the table. It's completely instant. What
- 2:56:21happens if you don't use this strategy?
- 2:56:23Well, your high performance computing
- 2:56:25jobs or your superheavy machine learning
- 2:56:27models could take weeks to run instead
- 2:56:29of hours. All because the servers are
- 2:56:30constantly waiting for data to travel
- 2:56:32across a massive data center. But, and
- 2:56:34this is a big butt, the trade-off is
- 2:56:36extreme risk. If that one specific
- 2:56:38hardware rack loses power, your entire
- 2:56:40cluster dies instantly. And that brings
- 2:56:43us to the exact opposite approach.
- 2:56:45Strategy number two, spread placement.
- 2:56:48This one is for paranoid fault
- 2:56:50tolerance. Here you are telling AWS
- 2:56:52absolutely never put these servers on
- 2:56:54the same rack. I want them on completely
- 2:56:56different physical hardware, plugged
- 2:56:58into different power supplies, and
- 2:57:00connected to completely different
- 2:57:01network switches. Analogy time. It's
- 2:57:04kind of like the top executives of a
- 2:57:06massive corporation. The CEO, the CFO,
- 2:57:09and the COO are strictly forbidden from
- 2:57:12flying on the same airplane. If one
- 2:57:14plane goes down, the company survives.
- 2:57:16If you don't use a spread placement
- 2:57:18group, a single hardware failure in the
- 2:57:20AWS data center could accidentally wipe
- 2:57:23out your primary database and your
- 2:57:24backup database at the exact same
- 2:57:26millisecond. And we definitely do not
- 2:57:28want that. So now it clicks, right?
- 2:57:31Spread placement really isn't about
- 2:57:33speed at all. It is pure paranoid fault
- 2:57:36tolerance. Now listen closely because
- 2:57:39this is where people mess up. You might
- 2:57:41be sitting there thinking,"Great, I'll
- 2:57:43just put my entire massive company's
- 2:57:45infrastructure into a spread group."
- 2:57:46Well, you can't. AWS strictly limits
- 2:57:49spread groups to just seven servers per
- 2:57:51availability zone. It's really only
- 2:57:53meant for a few missionritical
- 2:57:54instances. Now, here's where this gets
- 2:57:57really interesting. What if you have
- 2:57:58hundreds of servers, but you still
- 2:58:00absolutely need that hardware fall
- 2:58:02tolerance? Well, that is where our third
- 2:58:04type comes in. Number three, partition
- 2:58:07placement, which is explicitly designed
- 2:58:09for large distributed safety. Partition
- 2:58:12groups divide all your servers into
- 2:58:14separate logical chunks, appropriately
- 2:58:16called partitions. And each partition
- 2:58:18gets its own entirely isolated power and
- 2:58:21network source. Think of it like
- 2:58:23dividing your company across three
- 2:58:25completely different office buildings.
- 2:58:26Let's call them building A, building B,
- 2:58:29and building C. If building A
- 2:58:31unfortunately catches fire and loses
- 2:58:33power, everyone in buildings B and C
- 2:58:35just keeps on working normally. You'd
- 2:58:37use this strategy specifically for
- 2:58:39massive distributed workloads like
- 2:58:41Hadoop, Cassandra, or Kafka. These
- 2:58:43software platforms are incredibly smart.
- 2:58:45They actually look at your physical AWS
- 2:58:47partitions and say, "Okay, I'll save the
- 2:58:49primary data over in partition A and
- 2:58:51I'll safely place the backup copy over
- 2:58:52in partition B." Think about that for a
- 2:58:55second. Your database software actually
- 2:58:57communicates with the physical AWS
- 2:58:59architecture to ensure it never puts all
- 2:59:01its eggs in one basket. It's a total
- 2:59:03gamecher. Partition gives you massive
- 2:59:06scale and physical safety at the exact
- 2:59:07same time. So when do you actually need
- 2:59:10to make this choice? Well, if you're
- 2:59:12gearing up to take the AWS solutions
- 2:59:14architect exam, domain 3 is entirely
- 2:59:17about high-erforming architectures. And
- 2:59:19believe me, AWS will test this topic
- 2:59:22ruthlessly. Here's your cheat sheet. If
- 2:59:25an exam question mentions high
- 2:59:26performance computing, HPC or low
- 2:59:29network latency, the answer is always a
- 2:59:31cluster placement group. Now, if the
- 2:59:33question says a small number of critical
- 2:59:35instances or strictly mentions different
- 2:59:37underlying hardware, your answer is
- 2:59:39spread. And if the question explicitly
- 2:59:41throws out names like Hadoop, Kafka, or
- 2:59:44mentions large distributed workloads,
- 2:59:46the answer is partition. Seriously, do
- 2:59:48not miss those keywords. All right,
- 2:59:51let's do a fast punchy recap. Cluster is
- 2:59:54for extreme speed on one rack. Spread is
- 2:59:57for extreme separation of a few critical
- 2:59:59servers and partition is for large-scale
- 3:00:02distributed safety. Here are your three
- 3:00:05rapidfire takeaways to burn into your
- 3:00:07memory. Number one, cluster placement
- 3:00:10introduces a massive single point of
- 3:00:12failure for the absolute sake of speed.
- 3:00:14Number two, spread placement is strictly
- 3:00:17limited to just seven instances per
- 3:00:19availability zone. And number three,
- 3:00:21partition placement brilliantly ties
- 3:00:23application level data replication
- 3:00:25directly to physical hardware isolation.
- 3:00:27And here is your final trap to watch out
- 3:00:30for. You cannot simply take an existing
- 3:00:33running EC2 instance and magically move
- 3:00:35it into a placement group. No way. You
- 3:00:38literally have to stop the instance
- 3:00:40completely before making the change.
- 3:00:42Plan your physical architecture before
- 3:00:44you launch, not after. So before your
- 3:00:46next big AWS deployment, I want you to
- 3:00:49ask yourself, is your system designed to
- 3:00:51prioritize blistering speed, paranoid
- 3:00:53survival, or massive scale?
- 3:00:55>> Okay, picture this. You've just finished
- 3:00:57patching your company's primary database
- 3:00:59server. Routine stuff, right? You hit
- 3:01:01restart, the server takes a minute, it
- 3:01:03boots back up, and you log in. And your
- 3:01:05database is completely gone. I don't
- 3:01:08mean corrupted, I mean gone. the actual
- 3:01:11physical hard drive that your data was
- 3:01:13sitting on literally vanished into thin
- 3:01:15air. You just permanently destroyed your
- 3:01:18entire company's order history. So why
- 3:01:20did this happen? Well, it happens
- 3:01:22because of a simple but absolutely
- 3:01:24devastating misunderstanding between
- 3:01:26temporary and permanent cloud storage.
- 3:01:29Let's back up and start from zero for
- 3:01:31this explainer. When you launch a
- 3:01:33virtual server in AWS, an Amazon EC2
- 3:01:35instance, it obviously needs a hard
- 3:01:38drive. It needs a place to install the
- 3:01:40operating system, store your files, and
- 3:01:42you know, actually run your database. In
- 3:01:45the cloud world, we call this block
- 3:01:47storage. And here is the kicker. If you
- 3:01:49choose the wrong type of block storage,
- 3:01:51your data is either going to be
- 3:01:52painfully slow or perfectly capable of
- 3:01:54deleting itself without any warning.
- 3:01:56Let's look at the two main ways AWS
- 3:01:58gives you these block storage hard
- 3:02:00drives. Option number one, the EC2
- 3:02:03instance store. Blistering speed
- 3:02:05physically attached. Now, what's really
- 3:02:08fascinating about this setup is the
- 3:02:10physical reality of the cloud. An
- 3:02:12instance store is a physical hard drive
- 3:02:14physically plugged into the exact same
- 3:02:16hardware rack as your virtual server.
- 3:02:19It's exactly like the hard drive built
- 3:02:20directly into your personal laptop right
- 3:02:22now. And because that drive is literally
- 3:02:24touching the motherboard, the speed is
- 3:02:26absolutely blistering. We are talking
- 3:02:28millions of input and output operations
- 3:02:30every single second. It is the ultimate
- 3:02:32raw higherformance storage. But here is
- 3:02:36the massive catch. It is ephemeral. That
- 3:02:39means it's temporary. If you shut down
- 3:02:42that EC2 instance, AWS takes that
- 3:02:44physical hardware and just hands it over
- 3:02:46to someone else. And your data, it's
- 3:02:48wiped forever. Think about that for a
- 3:02:50second. So the absolutely crucial point
- 3:02:53here is this. If the underlying physical
- 3:02:56hardware fails, or even worse, if you
- 3:02:58just innocently click stop in the AWS
- 3:03:01console to maybe save a few bucks over
- 3:03:03the weekend, your hard drive is
- 3:03:04literally thrown in the virtual trash.
- 3:03:06You get pure raw speed, but with
- 3:03:09absolutely zero long-term safety. Which
- 3:03:12brings us to option number two, Amazon
- 3:03:14Elastic Block Store, or EBS, the
- 3:03:17networkattached safety net. EBS is a
- 3:03:20networkattached drive. It is not
- 3:03:22physically inside your server. It lives
- 3:03:24somewhere completely different in the
- 3:03:25data center and it connects to your EC2
- 3:03:27instance over a lightning fast network
- 3:03:29cable. The best way to think about it is
- 3:03:31like a massive indestructible USB thumb
- 3:03:33drive. You could literally unplug it
- 3:03:35from server A, walk it over, and plug it
- 3:03:37right into server B. Now, imagine that
- 3:03:40same disastrous scenario in your system.
- 3:03:43Your EC2 server completely crashes and
- 3:03:46burns. But this time, you don't panic.
- 3:03:49Why? Because the EBS volume is sitting
- 3:03:51safely over on the network, you just
- 3:03:53calmly spin up a brand new server,
- 3:03:56attach that old EBS volume, and boom,
- 3:03:58your database is perfectly intact. And
- 3:04:01this brilliantly illustrates exactly why
- 3:04:03this matters. EBS completely decouples
- 3:04:06your persistent data from your fragile
- 3:04:08comput hardware. It separates the two.
- 3:04:10Now, this is where people mess up. You
- 3:04:13might be sitting there thinking, "Wait a
- 3:04:15minute. Why would I ever use an instance
- 3:04:17store if it intentionally deletes my
- 3:04:19data? And honestly, it's a really great
- 3:04:22question. Well, this is where it gets
- 3:04:24super interesting. If you're building,
- 3:04:26say, a massive highfrequency trading
- 3:04:28platform or maybe a giant in-memory
- 3:04:30cache, network latency will literally
- 3:04:33kill your application. EBS is incredibly
- 3:04:36fast. Sure, it offers both solid state
- 3:04:38and hard disk drive options, but that
- 3:04:39data still has to physically travel
- 3:04:41across a network cable. An instant store
- 3:04:44on the other hand has zero network
- 3:04:45latency. None. So when do you actually
- 3:04:48choose which? You are going to choose
- 3:04:50Amazon EBS for about 95% of your
- 3:04:53workloads. We're talking your databases,
- 3:04:55web servers, boot volumes, basically
- 3:04:57anything where your data absolutely must
- 3:04:59survive a server stop. You choose an
- 3:05:01instance store only for temporary data,
- 3:05:04things like caches, buffers, scratch
- 3:05:06data, or maybe load balanced session
- 3:05:08data that you've already backed up
- 3:05:09somewhere else. You use it when you need
- 3:05:11absolute maximum performance and you
- 3:05:13literally do not care if the drive
- 3:05:14explodes. Section three, the AWS exam
- 3:05:18trap. Solutions architect associate
- 3:05:20domain 3. If you are studying for the
- 3:05:23AWS solutions architect associate exam,
- 3:05:26domain 3 specifically tests your ability
- 3:05:28to pick high performing and scalable
- 3:05:30storage solutions. Please do not miss
- 3:05:33this trap. AWS loves to give you a
- 3:05:36scenario asking for the highest possible
- 3:05:37IO performance for a database cache. If
- 3:05:40the data is temporary, the answer is
- 3:05:42always instance store. Always. But watch
- 3:05:46their exact wording. Again, this is
- 3:05:49where people mess up. If the question
- 3:05:51mentions that the data must be
- 3:05:52persistent or that the architecture must
- 3:05:54be fault tolerant against EC2
- 3:05:56termination, you absolutely cannot use
- 3:05:59an instance store. You must choose an
- 3:06:00EBS volume. Specifically, you'd want a
- 3:06:03provisioned IOPS solidstate drive, which
- 3:06:05guarantees that high performance without
- 3:06:07losing the data. All right, let's do a
- 3:06:10fast punchy recap. Block storage gives
- 3:06:12your EC2 instances a hard drive. The
- 3:06:14instance store is physically attached,
- 3:06:16lightning fast, but completely
- 3:06:18temporary. Amazon EBS is network
- 3:06:20attached, slightly slower, but permanent
- 3:06:22and flexible. Here are your three
- 3:06:25rapidfire takeaways. Number one,
- 3:06:28stopping an EC2 instance permanently
- 3:06:30deletes any data on an instance store
- 3:06:32volume. Number two, Amazon EBS volumes
- 3:06:36can be safely detached and reattached to
- 3:06:38entirely different instances within the
- 3:06:40same availability zone. And number
- 3:06:43three, high-erforming caching
- 3:06:45architectures rely on instance store for
- 3:06:47raw unbottlenecked speed. And here is
- 3:06:50your final trap to watch out for. Do not
- 3:06:53confuse rebooting with stopping. If you
- 3:06:56simply restart an EC2 instance from the
- 3:06:58operating system, your instance store
- 3:07:00data actually survives. It only wipes
- 3:07:03when the instance is explicitly stopped
- 3:07:05or terminated. So before you ever click
- 3:07:08that stop button in the console, ask
- 3:07:10yourself, do you know exactly what kind
- 3:07:12of hard drive you are running?
- 3:07:13>> Imagine migrating your company's legacy
- 3:07:16application to the cloud. You spin up 50
- 3:07:19EC2 instances behind a load balancer,
- 3:07:22but your app relies on a massive shared
- 3:07:24folder of files. You attach a standard
- 3:07:27block storage drive to one server, and
- 3:07:29suddenly the other 49 servers crash
- 3:07:32because they cannot see the data. You
- 3:07:34just broke a multi-million dollar
- 3:07:36application. So, why did it break? Well,
- 3:07:39because standard block storage is like a
- 3:07:41personal hard drive. It is designed to
- 3:07:43plug into one specific server at a time.
- 3:07:46If you have dozens of servers that all
- 3:07:48need to read and write to the exact same
- 3:07:50files at the exact same millisecond,
- 3:07:52personal hard drives will fail you. You
- 3:07:55need a highly scalable shared network
- 3:07:57file system. This is file storage. It is
- 3:08:00a live shared directory that thousands
- 3:08:02of computers can open simultaneously
- 3:08:04over a network. Let me show you the
- 3:08:06first major way AWS solves this. Amazon
- 3:08:10Elastic File System or Amazon EFS. EFS
- 3:08:13is a fully managed shared file system
- 3:08:16built specifically for Linux. Think
- 3:08:18about it like an infinite Google Drive
- 3:08:20for your Linux servers. You don't have
- 3:08:22to guess how big it needs to be. It
- 3:08:24scales automatically as you drop files
- 3:08:26in and shrinks when you delete them.
- 3:08:28What happens if you don't use it? You
- 3:08:29have to build and manage your own
- 3:08:30massive file server from scratch. If
- 3:08:32that physical server loses power, your
- 3:08:35whole company stops. EFS handles all
- 3:08:37that redundancy for you across multiple
- 3:08:39availability zones. Think about that for
- 3:08:42a second. You can have 10,000 EC2
- 3:08:44instances spread across three different
- 3:08:46data centers, all editing the exact same
- 3:08:48file in real time without locking each
- 3:08:50other out. And that is when it clicks.
- 3:08:52Oh, now I get it. It's an infinitely
- 3:08:55scaling shared drive. Now, here's where
- 3:08:58people completely fail this in the real
- 3:09:00world. You try to take that same EFS
- 3:09:03drive and plug it into a Windows server.
- 3:09:06It fails. EFS does not speak Windows. It
- 3:09:09doesn't understand Microsoft
- 3:09:10permissions. So what do you do if your
- 3:09:12enterprise runs on Microsoft? That
- 3:09:15brings us to Amazon FSX, specifically
- 3:09:18Amazon FSX for Windows File Server. If
- 3:09:20EFS is Google Drive for Linux, FSX is a
- 3:09:23heavily guarded corporate filing cabinet
- 3:09:25built natively for Microsoft. It speaks
- 3:09:27the exact server message block language
- 3:09:28Windows uses and it integrates perfectly
- 3:09:31with your Windows Active Directory. But
- 3:09:33here's the trade-off. FSX for Windows is
- 3:09:35not magically infinite like EFS. You
- 3:09:38have to provision the storage capacity
- 3:09:39and the throughput speed up front. You
- 3:09:41have to actually engineer it. If you
- 3:09:43guess wrong, your Windows applications
- 3:09:45choke on the network. Now imagine this
- 3:09:47in your system. You aren't running basic
- 3:09:49web servers. You are running a massive
- 3:09:51machine learning model or a high
- 3:09:53performance computing job. Even standard
- 3:09:56FSX or EFS is way too slow. For this,
- 3:09:59you use Amazon FSX for Luster. It is a
- 3:10:03specialized file system wired directly
- 3:10:05to an Amazon S3 object storage bucket to
- 3:10:08process millions of files at
- 3:10:10blisteringly fast speeds. Your
- 3:10:12supercomputer pulls massive data from
- 3:10:14S3, processes it at lightning speed on
- 3:10:16FSX for Lustre, and dumps the results
- 3:10:18back to S3. To summarize it simply, oh,
- 3:10:22now I get it. It's a temporary high
- 3:10:24octane engine for massive data
- 3:10:26processing. So when do you actually make
- 3:10:28this choice? If you are running Linux
- 3:10:30web servers and want infinite hands-off
- 3:10:33scaling across multiple zones, choose
- 3:10:35the FS. If you are running legacy
- 3:10:37Windows applications and need strict
- 3:10:39Active Directory permissions, choose FSX
- 3:10:41for Windows. If you are doing heavy
- 3:10:44machine learning, video rendering, or
- 3:10:46high performance computing, choose FSX
- 3:10:48for Lustra. If you are taking the AWS
- 3:10:51solutions architect exam, domain 3
- 3:10:53heavily tests your ability to determine
- 3:10:55high performing and scalable storage
- 3:10:57solutions. Do not miss this trap. They
- 3:11:00will give you a scenario about a high
- 3:11:02performance computing workload needing a
- 3:11:03shared file system. They will put Amazon
- 3:11:06EFS as an answer to trick you. Do not
- 3:11:08pick EFS for high performance computing.
- 3:11:10The key word for HPC or massive machine
- 3:11:13learning is always FSX for Lester. Let's
- 3:11:16do a fast punchy recap. File storage
- 3:11:19allows thousands of servers to access
- 3:11:21the same data at once. Amazon EFS is for
- 3:11:24Linux. Amazon FSX is for Windows or
- 3:11:26extreme high performance. Here are your
- 3:11:28three rapidfire takeaways. One, Amazon
- 3:11:31EFS automatically scales storage
- 3:11:33capacity up and down without manual
- 3:11:35intervention. Two, Amazon FSX for
- 3:11:38Windows File Server provides native
- 3:11:40Microsoft Active Directory integration.
- 3:11:42Three, Amazon FSX for Luster is built
- 3:11:44specifically to integrate with S3 for
- 3:11:46massive computational workloads. And
- 3:11:49here is your final warning. Never use an
- 3:11:53expensive shared file system when simple
- 3:11:56Amazon S3 object storage would work.
- 3:11:59Match this specific storage type to the
- 3:12:01actual workload or you will completely
- 3:12:04destroy your cloud budget.
- 3:12:06>> All right, let's just dive right into
- 3:12:08this. Welcome to today's explainer. I
- 3:12:11want you to imagine for a second that
- 3:12:12your startup just hit a truly massive
- 3:12:14milestone. We are talking your first
- 3:12:17million users. The engineering team is
- 3:12:19celebrating. Everyone's popping
- 3:12:21champagne, but your CFO, well, they are
- 3:12:24staring at the AWS bill in pure horror.
- 3:12:27Because right there on the screen is a
- 3:12:29bill for $50,000.
- 3:12:31And that's just for one month. You're
- 3:12:33spending 50 grand a month just to store
- 3:12:36old user profile pictures and outdated
- 3:12:38application logs in Amazon S3. The crazy
- 3:12:41part, that data is just sitting there.
- 3:12:43It's completely untouched by anyone. but
- 3:12:46it is actively draining your bank
- 3:12:48account every single month like a leaky
- 3:12:50faucet. So, how do you stop the
- 3:12:53bleeding? The answer to that relies
- 3:12:55entirely on mastering Amazon S3's
- 3:12:57storage classes and storage taring.
- 3:13:00Let's start from square one. Amazon S3
- 3:13:02is an incredibly scalable object storage
- 3:13:04service. It is literally designed to
- 3:13:06hold an infinite amount of files. But
- 3:13:08here's the thing you absolutely need to
- 3:13:10remember. Holding those files costs real
- 3:13:13money. If you just dump every single
- 3:13:15image, every video, and every random
- 3:13:17backup into S3 and then walk away, well,
- 3:13:19your architecture is definitely not cost
- 3:13:22optimized. To fix this massive bill, you
- 3:13:24basically have a two-step process. Step
- 3:13:27one, you have to manage your data life
- 3:13:29cycles. And step two, you need to move
- 3:13:31older files into different tiers. Let's
- 3:13:34break this concept down into its
- 3:13:36absolute simplest form. Storage classes
- 3:13:38are really just different rental units
- 3:13:40for your data. You pay completely
- 3:13:42different monthly prices based on
- 3:13:44exactly how often you have to open the
- 3:13:46door to look at the files inside. So,
- 3:13:48let's get into section one, the three
- 3:13:50storage tiers. First up is S3 standard.
- 3:13:54This is the default tier everyone starts
- 3:13:56with. Think of it like the top drawer of
- 3:13:58your office desk. The files are right
- 3:13:59there. You can open that drawer a
- 3:14:01thousand times a day instantly, and it
- 3:14:03costs you absolutely nothing extra to
- 3:14:04grab them. But because it is so
- 3:14:07incredibly fast and convenient, renting
- 3:14:09that premium desk drawer is the most
- 3:14:11expensive storage option available to
- 3:14:13you. Now, let's slow down for a second
- 3:14:15and compare that top drawer to our
- 3:14:17second option, S3 standard infrequent
- 3:14:19access or just IIA. This is like moving
- 3:14:22your files to a filing cabinet down in
- 3:14:24the dark basement of your office
- 3:14:25building. It is significantly cheaper to
- 3:14:28store your data down there on a monthly
- 3:14:29basis. But there is a catch. Every
- 3:14:32single time you walk down to that
- 3:14:33basement to pull a file out, AWS charges
- 3:14:36you a retrieval fee. Which brings us to
- 3:14:38a major major pitfall. What we call the
- 3:14:41viral video trap. Think about that for a
- 3:14:44second. If you decide to put a viral
- 3:14:47marketing video into infrequent access,
- 3:14:50sure you save a little bit of money on
- 3:14:51your baseline storage bill. But if a
- 3:14:54million users suddenly decide to click
- 3:14:56on that video, those individual per file
- 3:14:59retrieval fees will instantly bankrupt
- 3:15:01your startup. And this is usually when
- 3:15:04people have a massive light bulb moment.
- 3:15:07They go, "Oh,
- 3:15:09now I get it. The cheaper the storage
- 3:15:11tier, the more expensive it is to
- 3:15:14actually touch the data. That inverse
- 3:15:16relationship right there, that is
- 3:15:18absolutely key to understanding AWS
- 3:15:20storage pricing. And that brings us to
- 3:15:23the third option. Let's compare
- 3:15:25infrequent access with cold tiering
- 3:15:27using Amazon S3 Glacier. Glacier is
- 3:15:30essentially an off-site deep storage
- 3:15:31vault located completely across town. It
- 3:15:34is insanely cheap. We're talking literal
- 3:15:36pennies on the dollar here. But the
- 3:15:38agonizing trade-off with Glacier is
- 3:15:40speed. If you request a file from
- 3:15:42Glacier, you can't get it right away.
- 3:15:43You might have to wait minutes or even
- 3:15:45hours for AWS to physically go get it
- 3:15:47for you. Moving on to section two, the
- 3:15:50life cycle management trap. Now, listen
- 3:15:52closely because this is where people
- 3:15:54completely mess up. In the real world,
- 3:15:56people completely fail by trying to
- 3:15:59manage all these storage tiers manually.
- 3:16:01They ask their developers to guess which
- 3:16:03files are going to be hot or cold. Or
- 3:16:05they set these blind 30-day rules that
- 3:16:08accidentally lock their own customers
- 3:16:09out of old invoices. So, this begs the
- 3:16:13ultimate question. What happens when
- 3:16:15your access patterns are totally
- 3:16:16unpredictable? The answer is S3
- 3:16:20intelligent tiering. Intelligent taring
- 3:16:22is the absolute magic bullet of Amazon
- 3:16:24S3. It is an automated storage class
- 3:16:27that constantly monitors your files for
- 3:16:29you. Here's how it works. If a file
- 3:16:31hasn't been opened in 30 days, the
- 3:16:33system automatically moves it to the
- 3:16:35cheaper infrequent access tier. If 90
- 3:16:37days go by, it drops it straight into
- 3:16:40cold storage. But the exact second a
- 3:16:42user clicks that file, boom, it
- 3:16:45instantly moves it back to the fast
- 3:16:46standard tier. Now, I really want you to
- 3:16:49imagine this running in your system.
- 3:16:51Zero lines of code. You literally do not
- 3:16:53have to write a single line of code to
- 3:16:55optimize your storage here. You just
- 3:16:56turn on intelligent taring. You pay a
- 3:16:58microscopic monitoring fee per object
- 3:17:01and AWS automatically shrinks your
- 3:17:03storage bill every single month based
- 3:17:05entirely on actual human behavior.
- 3:17:08It's another one of those great
- 3:17:10realizations, right? Oh, now I get it.
- 3:17:14You are paying AWS a tiny fee to act as
- 3:17:18your automated financial adviser. It's
- 3:17:20just brilliant. So, with all these
- 3:17:22options on the table, a totally logical
- 3:17:25question arises. When do you actually
- 3:17:28make this choice? Let's look at some
- 3:17:29practical real world applications. Here
- 3:17:32is your real world breakdown. You are
- 3:17:34going to choose S3 standard for active
- 3:17:36hot data, things like website images
- 3:17:38that load every time a user visits. You
- 3:17:40choose infrequent access for things like
- 3:17:42your monthly system backups. You choose
- 3:17:44S3 Glacier for long-term compliance
- 3:17:46records, the stuff you legally must keep
- 3:17:48for years, but will probably never ever
- 3:17:50read. And finally, you choose
- 3:17:52intelligent taring when you have massive
- 3:17:54amounts of data and absolutely no idea
- 3:17:56what your users will do with it. All
- 3:17:57right, section three, AWS exam traps. If
- 3:18:02you are currently studying for the AWS
- 3:18:04solutions architect exam, pay attention.
- 3:18:07AWS is going to heavily test your
- 3:18:08knowledge of these specific cost
- 3:18:10trade-offs. Do not miss this first trap.
- 3:18:13They will give you a scenario asking for
- 3:18:15the most cost-effective storage for data
- 3:18:17with unknown or changing access
- 3:18:19patterns. When you see those exact
- 3:18:21words, the answer is always S3
- 3:18:24intelligent hearing every time. Trap
- 3:18:26number two involves the phrase
- 3:18:28regulatory compliance. If the exam
- 3:18:31question demands that data must be kept
- 3:18:33for 5 years for regulatory compliance
- 3:18:36and it will rarely be accessed, you need
- 3:18:38to look immediately for cold tiering or
- 3:18:41Amazon S3 Glacier. Okay, let's do a fast
- 3:18:44punchy recap to really lock these
- 3:18:46concepts into your memory. S3 standard,
- 3:18:49that is your desk drawer. Infrequent
- 3:18:51access, that's your basement filing
- 3:18:53cabinet. S3 Glacier, that is your secure
- 3:18:55off-site vault. And intelligent taring,
- 3:18:58that's the automator that seamlessly
- 3:19:00moves the data between all of them just
- 3:19:02to save you money. So, here are your
- 3:19:04three rapidfire takeaways from today's
- 3:19:06explainer. One, you absolutely must
- 3:19:09manage S3 object life cycles if you want
- 3:19:12to build a truly cost optimized cloud
- 3:19:14architecture. Two, cold storage offers
- 3:19:17the lowest monthly cost by far, but it
- 3:19:19heavily penalizes you with high
- 3:19:20retrieval times and fees. And three, S3
- 3:19:23intelligent tiering is the ultimate
- 3:19:25hands-off solution for totally
- 3:19:27unpredictable workloads. And I want to
- 3:19:30leave you with one final slightly
- 3:19:32provocative thought, the final trap. Do
- 3:19:35not put tiny files into infrequent
- 3:19:38access or intelligent tiering. AWS
- 3:19:41actually charges a minimum storage
- 3:19:42capacity for those specific tiers. This
- 3:19:45means if you go and upload millions of
- 3:19:47tiny 1 kilob text files, the capacity
- 3:19:50overhead fees will completely wipe out
- 3:19:52any savings you thought you had. You
- 3:19:54must always match your storage strategy
- 3:19:56to the actual file size. So, I want you
- 3:19:59to go look at your S3 buckets today. Are
- 3:20:01you paying premium prices for a desk
- 3:20:03drawer when a cheap basement cabinet
- 3:20:04would do the exact same job?
- 3:20:06>> Imagine you just launched a global
- 3:20:08streaming platform. Your servers are
- 3:20:10sitting in Virginia. A user in Tokyo
- 3:20:13clicks play on a mass of highdefinition
- 3:20:15video. It spins. It buffers. It freezes.
- 3:20:18They get frustrated and immediately
- 3:20:19cancel their subscription. You didn't
- 3:20:21fail at coding, you failed at physics.
- 3:20:24Let's start from zero here. The internet
- 3:20:26is a physical thing, right? It is a
- 3:20:28massive web of underwater cables and
- 3:20:30routers. If data has to literally cross
- 3:20:32an ocean and bounce through 50 different
- 3:20:34public routers to reach a user, it takes
- 3:20:36time. It is slow, laggy, and totally
- 3:20:39unpredictable. To beat internet physics,
- 3:20:41we use a content delivery network or
- 3:20:44CDN. In AWS, the absolute gold standard
- 3:20:47for this is Amazon CloudFront. Look, if
- 3:20:49you don't use a CDN, every single user
- 3:20:52around the entire globe has to reach
- 3:20:54across the world to fetch data directly
- 3:20:56from your one primary server. The
- 3:20:58latency is horrible and worse, your
- 3:21:00primary server gets crushed under the
- 3:21:02massive global weight. Let's break down
- 3:21:04exactly how CloudFront solves this.
- 3:21:06CloudFront uses a global network of edge
- 3:21:09locations. These are hundreds of mini
- 3:21:11data centers spread all over the world
- 3:21:13sitting right in your users's backyards.
- 3:21:15When that user in Tokyo requests a
- 3:21:17video, CloudFront intercepts the
- 3:21:18request. It says, "Don't go to Virginia.
- 3:21:21I'll go get it for you." CloudFront
- 3:21:23grabs a video from Virginia exactly
- 3:21:24once, pulls it over a high-speed private
- 3:21:26network, and caches a copy of it right
- 3:21:28there in Tokyo. Think about it like a
- 3:21:31massive library system. If a million
- 3:21:33people want to read a specific book, the
- 3:21:35librarian doesn't force everyone to
- 3:21:37travel to the main headquarters to read
- 3:21:38one single copy. They print a million
- 3:21:40copies and put one in every local
- 3:21:42neighborhood library. Think about that
- 3:21:43for a second. See, your Virginia server
- 3:21:46only had to send the file out exactly
- 3:21:48one time. CloudFront handles the other
- 3:21:50million requests locally from the edge.
- 3:21:54Oh, now I get it. CloudFront doesn't
- 3:21:57just make the video load instantly for
- 3:21:58the user. It completely shields your
- 3:22:00main origin server from crashing. But
- 3:22:02listen up, because now here's where
- 3:22:04people completely fail this in the real
- 3:22:06world. Caching is incredibly dangerous
- 3:22:09if you do not control it. Picture this.
- 3:22:12You push a massive critical update to
- 3:22:14your website's homepage, but your users
- 3:22:17are complaining on Twitter that they are
- 3:22:19still seeing the old version from
- 3:22:21yesterday. Why? Well, because the old
- 3:22:24version is still sitting in those edge
- 3:22:26caches around the world. To fix this,
- 3:22:29you have to carefully engineer your time
- 3:22:31to live or TTL. This tells CloudFront
- 3:22:34exactly how many seconds it should hold
- 3:22:36onto a file before deleting it and
- 3:22:38checking Virginia for a newer version.
- 3:22:40If you mess up your TTL, you are
- 3:22:42permanently showing your users broken,
- 3:22:44outdated data. If it's an absolute
- 3:22:46emergency, you have to run a cache
- 3:22:49invalidation. This manually forces
- 3:22:51CloudFront to wipe the edge locations
- 3:22:53clean instantly. But a quick warning,
- 3:22:56AWS charges you real money for running
- 3:22:58too many invalidations. It hurts the
- 3:23:00wallet, so you do not want to rely on
- 3:23:02it. Now, imagine this in your system.
- 3:23:05You don't understand caching, so you
- 3:23:07accidentally put a dynamic shopping cart
- 3:23:09page in a CloudFront cache. User A logs
- 3:23:12in, the page caches, and then user B
- 3:23:15logs in and sees user A's credit card
- 3:23:17information. Yikes. Oh. Oh, now I get
- 3:23:20it. You never c highly dynamic personal
- 3:23:23data. You only cache static assets like
- 3:23:25images, videos, and generic HTML pages.
- 3:23:29So, when do you actually use this? Well,
- 3:23:31if you have a purely internal corporate
- 3:23:34app used only by employees sitting in
- 3:23:36one single building in Ohio, do not use
- 3:23:38CloudFront. You are wasting money. But
- 3:23:41if you have a public-f facing website, a
- 3:23:43streaming platform, or a massive global
- 3:23:44user base, CloudFront is absolutely
- 3:23:47mandatory. For anyone out there studying
- 3:23:49for the AWS solutions architect exam,
- 3:23:51pay attention. Domain 3 and four heavily
- 3:23:53test your strategic need for edge
- 3:23:55networking and CDNs. AWS will try to
- 3:23:58trick you. They will give you a scenario
- 3:24:00and ask you to choose between Amazon
- 3:24:01CloudFront and AWS Global Accelerator.
- 3:24:04Both of these use AWS edge locations to
- 3:24:06make things faster. Do not mix them up.
- 3:24:09If the question mentions caching static
- 3:24:10content, images, videos, or lowering the
- 3:24:13load on your web servers, the answer is
- 3:24:15always Amazon CloudFront. However, if
- 3:24:17the question asks for high performance
- 3:24:18routing for non-HTTP traffic like a
- 3:24:20multiplayer gaming UDP protocol or
- 3:24:23explicitly states you need a fixed
- 3:24:24static IP address, the answer is global
- 3:24:26accelerator. All right, let's do a fast
- 3:24:29punchy recap. Internet physics make
- 3:24:31long-distance data slow. Cloudfront is a
- 3:24:34CDN that caches your data locally at
- 3:24:36edge locations. It provides massive
- 3:24:39speed for users and massive protection
- 3:24:41for your servers. Here are your three
- 3:24:43rapidfire takeaways. One, CloudFront
- 3:24:46dramatically reduces compute and data
- 3:24:48transfer costs on your back-end
- 3:24:49infrastructure. Two, time to live
- 3:24:52settings dictate exactly how long data
- 3:24:54stays at the edge before refreshing.
- 3:24:57Three, use cache invalidations only when
- 3:24:59you absolutely must clear out bad data
- 3:25:01instantly. And here is your final trap.
- 3:25:04Watch out for geographic restrictions.
- 3:25:07CloudFront can actually block users from
- 3:25:08specific countries from seeing your
- 3:25:10content entirely. If an exam question
- 3:25:12asks how to quickly block traffic from a
- 3:25:14specific country to meet digital
- 3:25:15compliance laws, CloudFront
- 3:25:17georestriction is the absolute easiest
- 3:25:19way to do it. So look at your
- 3:25:20architecture. What are you cashing right
- 3:25:22now that you shouldn't be? Picture this.
- 3:25:24Your company just got featured on a
- 3:25:26massive morning talk show. It's the big
- 3:25:28break you've been waiting for, right?
- 3:25:30But then a million people decide to
- 3:25:32click the link on their phones at the
- 3:25:33exact same second. So let's look at
- 3:25:36section one, the cost of going viral.
- 3:25:39Sure, your front-end web servers might
- 3:25:41handle that initial connection
- 3:25:42perfectly, but then boom, your back-end
- 3:25:45database instantly spikes to 100% CPU.
- 3:25:48It literally melts down under the
- 3:25:50pressure. Your site goes completely
- 3:25:51offline, and just like that, you've lost
- 3:25:53millions of dollars in potential sales.
- 3:25:55It is a total nightmare scenario. Why
- 3:25:58did this happen? Well, it's because you
- 3:26:00forced your system to do the exact same
- 3:26:02hard work a million times in a row
- 3:26:03instead of working smart. To survive a
- 3:26:06massive traffic hit like that, you
- 3:26:07absolutely must master caching. In this
- 3:26:10explainer, we're going to quickly cover
- 3:26:12the cost of going viral, how caching
- 3:26:14acts as a performance cheat code, the
- 3:26:16roles of CloudFront and Elasticash, a
- 3:26:18massive architectural trap you need to
- 3:26:20avoid, and finally, a rapidfire exam
- 3:26:23recap. Caching really is the ultimate
- 3:26:25performance cheat code, especially if
- 3:26:27you are tackling domain 3 of the AWS
- 3:26:30solutions architect exam. All right,
- 3:26:33moving to section two, caching. the
- 3:26:35performance cheat code. Let's build this
- 3:26:37from the ground up, starting from
- 3:26:39absolute zero. At its core, caching is
- 3:26:42simply short-term memory. Think about
- 3:26:44it. If I ask you what 2 plus 2 is, you
- 3:26:46don't break out a calculator, right? You
- 3:26:48already know the answer. You saved it in
- 3:26:50your brain. You don't need to do the
- 3:26:51math again. In cloud architecture, it's
- 3:26:53the exact same concept. If a million
- 3:26:56users ask for the exact same homepage or
- 3:26:58the exact same database record, your
- 3:27:00system absolutely shouldn't be
- 3:27:02recalculating it a million times. That
- 3:27:03is a massive waste of computing power.
- 3:27:05It should just hand them the saved
- 3:27:07answer instantly. So, let's dive into
- 3:27:09the two heavy hitters in AWS caching
- 3:27:11that make this possible. Section three,
- 3:27:14CloudFront, our global shield. First up
- 3:27:17is Amazon CloudFront. This is a content
- 3:27:20delivery network or CDN. Basically, it's
- 3:27:23an edge networking service. It takes
- 3:27:25your static files, we're talking your
- 3:27:27images, your videos, HTML pages, and it
- 3:27:30places copies of them in hundreds of
- 3:27:32edge locations all around the entire
- 3:27:34world. Think about it like a global
- 3:27:36newspaper. A publisher doesn't force
- 3:27:38everyone in the world to travel all the
- 3:27:39way to New York just to read the morning
- 3:27:41paper, right? No way. They print
- 3:27:43millions of copies and put them on local
- 3:27:45street corners worldwide. Now, what
- 3:27:47happens if you don't use this? Well, a
- 3:27:49user in Tokyo has to pull a massive
- 3:27:51video file all the way from your single
- 3:27:52server in Virginia. The global network
- 3:27:54latency is just horrible, and your
- 3:27:56Virginia server gets completely crushed
- 3:27:58under the weight of the entire world's
- 3:27:59traffic. Think about that for a second.
- 3:28:02It's a disaster. But with CloudFront,
- 3:28:04CloudFront catches that request right
- 3:28:06there in Tokyo. It hands the user the
- 3:28:08video instantly, and your main server in
- 3:28:09Virginia never even knew the user
- 3:28:11existed. Oh, right now it clicks.
- 3:28:14CloudFront is literally a shield that
- 3:28:15protects your servers while making
- 3:28:17things lightning fast for your global
- 3:28:18users. Okay, section four, Elasticash,
- 3:28:22the database lifesaver. But hey, what if
- 3:28:24the problem isn't static files? What if
- 3:28:26the issue is heavy, complex database
- 3:28:29queries? Well, that brings us to Amazon
- 3:28:31Elastic. Elasticash is a high-erforming
- 3:28:34in-memory database cache that sits
- 3:28:36directly in front of your primary
- 3:28:38database. Think about it like a sticky
- 3:28:40note on your computer monitor. Your main
- 3:28:42database is like a massive heavy filing
- 3:28:44cabinet down in the basement. It holds
- 3:28:46absolutely everything, but man, it is
- 3:28:48slow to search through. Elasticash is
- 3:28:50that sticky note right in front of your
- 3:28:51face. You just write the most popular
- 3:28:53readint intensive data right on that
- 3:28:55note. What happens if you don't use it?
- 3:28:57Every single time a user logs in, your
- 3:28:59primary database has to grind its gears
- 3:29:01and search through millions of rows. It
- 3:29:03becomes a massive bottleneck. Now,
- 3:29:05imagine this in your system. Instead of
- 3:29:07asking the database for say the top 10
- 3:29:09leaderboard scores 10,000 times a
- 3:29:11second, your app just asks Elasticash.
- 3:29:13Elasticash serves that data straight out
- 3:29:15of pure RAM in a fraction of a
- 3:29:16millisecond. Ah, see Elasticash absorbs
- 3:29:19all that heavy read traffic so your
- 3:29:21actual main database can finally
- 3:29:23breathe. Which brings us to section five
- 3:29:26and this is absolutely crucial. The
- 3:29:28architectural trap. Listen closely
- 3:29:31because here is exactly where people
- 3:29:32mess up. People constantly mix up where
- 3:29:35these two services actually live in the
- 3:29:37architecture and let me tell you this is
- 3:29:39a massive engineering trap. CloudFront
- 3:29:42lives at the absolute edge of the
- 3:29:43network right next to the user.
- 3:29:45Elasticash on the other hand lives deep
- 3:29:48inside your private network right next
- 3:29:50to your database. If you try to use
- 3:29:52Elasticash to speed up image loading for
- 3:29:54a user in Australia, it will fail
- 3:29:56miserably because that user still has to
- 3:29:58cross the entire ocean just to reach
- 3:29:59your data center. The geography just
- 3:30:02doesn't work. And on the flip side, if
- 3:30:04you try to use CloudFront to cache
- 3:30:06complex personalized database queries,
- 3:30:08you're going to accidentally cache
- 3:30:09personal data at the edge and end up
- 3:30:11showing user A's private banking details
- 3:30:13to user B. Absolutely disastrous. So,
- 3:30:16how do you actually choose the right
- 3:30:18exam answer? It's simple once you know
- 3:30:20the trick. You choose CloudFront for
- 3:30:22global static assets and edge caching.
- 3:30:25You choose Elasticash for read intensive
- 3:30:28higherformance database workloads. If
- 3:30:30you are taking the AWS solutions
- 3:30:32architect exam, domain 3 heavily tests
- 3:30:35your ability to design these
- 3:30:36high-erforming database and network
- 3:30:38architectures. Do not miss this trap.
- 3:30:41AWS loves to give you a scenario where a
- 3:30:44relational database is overwhelmed by
- 3:30:46heavy retra and they will totally put
- 3:30:48Amazon CloudFront as a multiple choice
- 3:30:50option just to trick you. Listen, never
- 3:30:53pick CloudFront to fix a database
- 3:30:55bottleneck. The answer for a readint
- 3:30:57intensive database bottleneck is always
- 3:30:59Amazon Elasticash or maybe a read
- 3:31:01replica. But if the question explicitly
- 3:31:04states that global users are
- 3:31:06experiencing high latency when
- 3:31:07downloading images or media, the answer
- 3:31:09is always an edge networking service
- 3:31:11like Amazon CloudFront. All right,
- 3:31:13section six, Rapidfire exam recap. Let's
- 3:31:16do a fast punchy summary of what we've
- 3:31:18covered. Caching prevents your
- 3:31:20architecture from doing the same work
- 3:31:22twice. CloudFront caches files globally
- 3:31:24at the edge while Elastic caches
- 3:31:26database queries internally right in
- 3:31:28memory. Here are your three rapidfire
- 3:31:31takeaways. One, use edge accelerators
- 3:31:34like CDNs for static web content. Two,
- 3:31:37integrate caching services like
- 3:31:39Elasticash to offload read intensive
- 3:31:41database access patterns. And three,
- 3:31:44true high-erforming architectures
- 3:31:46completely decouple the heavy lifting by
- 3:31:48using both of these services together.
- 3:31:51And before we wrap up this explainer,
- 3:31:52here's your final trap. Never cache data
- 3:31:56forever. If your database updates, but
- 3:31:58your cache doesn't, your users are going
- 3:32:00to see old, stale data. Always, always
- 3:32:03configure expiration logic to force your
- 3:32:06cache to wipe itself clean and fetch the
- 3:32:08fresh truth. Keep that rule in mind and
- 3:32:10you'll be golden. Imagine your new
- 3:32:13mobile app just went viral. A million
- 3:32:15new users try to create accounts at the
- 3:32:18exact same second. Your web servers
- 3:32:21scale up perfectly, but your database
- 3:32:23locks up completely. It is a
- 3:32:25catastrophic bottleneck. The app
- 3:32:27crashes, users leave angry one-star
- 3:32:28reviews, and your big break is ruined.
- 3:32:31Why did this happen? Because you chose
- 3:32:33the absolute wrong database engine for
- 3:32:35your workload. Let's start from zero.
- 3:32:37Your database is the permanent memory of
- 3:32:39your application. If it's too slow, your
- 3:32:41entire architecture is slow. Designing
- 3:32:43high performing and scalable
- 3:32:44architectures requires you to choose the
- 3:32:46exact right type of database based on
- 3:32:47your data access patterns. If you get
- 3:32:49this wrong, your system breaks under
- 3:32:51pressure. Let me show you how to
- 3:32:53simplify this. When selecting a database
- 3:32:56type, you really have two main paths,
- 3:32:58relational and non-reational. A
- 3:33:01relational database is a massive,
- 3:33:03strictly organized spreadsheet.
- 3:33:05Everything must match. A non- relational
- 3:33:08database is a giant, flexible pile of
- 3:33:10sticky notes. Let's look at your three
- 3:33:12biggest choices in AWS. First, Amazon
- 3:33:16RDS, the relational database service.
- 3:33:19Think about RDS like a highly strict old
- 3:33:22school accountant. Every single piece of
- 3:33:24data must fit perfectly into rows and
- 3:33:26columns. It handles complex
- 3:33:28relationships like linking a user to an
- 3:33:30order and an order to a shipping
- 3:33:32address. What happens if you don't use
- 3:33:34it for complex data? You end up with
- 3:33:35corrupted financial records and a broken
- 3:33:37billing system. But here is the
- 3:33:39trade-off. That strict accountant gets
- 3:33:41easily overwhelmed if a million people
- 3:33:43yell at them at the exact same time.
- 3:33:45Traditional relational databases
- 3:33:47struggle to scale infinitely. That
- 3:33:49brings us to your second option, Amazon
- 3:33:52Dynamo DB. DynamoB is AWS's flagship
- 3:33:56non-reational NoSQL database. It is
- 3:33:59completely serverless. Think about
- 3:34:01Dynamob like a massive warehouse with a
- 3:34:04million robotic workers. You give a
- 3:34:06worker a unique ID key and they
- 3:34:09instantly run and grab that exact item.
- 3:34:11There are no complex ledgers, just a key
- 3:34:14and a value. Think about that for a
- 3:34:16second. When millions of players log
- 3:34:18into a mobile game, they don't need to
- 3:34:20run a complex financial report. They
- 3:34:23just need to load their saved game
- 3:34:24state. Dynamob hands it to them in
- 3:34:27singledigit milliseconds, no matter how
- 3:34:29many millions of people are asking at
- 3:34:31once. Oh, now I get it. DynamoB
- 3:34:34sacrifices complex relationships to give
- 3:34:36you infinite unstoppable speed. Now,
- 3:34:39here's where people completely fail this
- 3:34:41in the real world. What if you
- 3:34:44absolutely must have a strict relational
- 3:34:46database, but you also need massive
- 3:34:48cloudnative scale? You cannot
- 3:34:51compromise. That is where you use Amazon
- 3:34:53Aurora. Aurora is AWS's customuilt
- 3:34:57enterprisegrade relational database. It
- 3:34:59looks and acts exactly like standard
- 3:35:02RDS, but the underlying hardware is
- 3:35:04radically different. In a standard
- 3:35:06database, the compute brain and the
- 3:35:08storage hard drive are glued together.
- 3:35:10If the brain dies, the drive is locked.
- 3:35:13Aurora completely decouples them. It
- 3:35:15automatically replicates your storage
- 3:35:16across three different availability
- 3:35:18zones while the compute brain sits
- 3:35:20completely separate. Now, imagine this
- 3:35:22in your system. Your primary database
- 3:35:24server literally catches fire and dies.
- 3:35:27Aurora doesn't panic. It [snorts]
- 3:35:29instantly spins up a new compute brain,
- 3:35:31attaches it to the surviving storage
- 3:35:33network, and your application is back
- 3:35:35online in seconds. Oh, now I get it.
- 3:35:38Aurora gives you the strict rules of a
- 3:35:39traditional database, but with the
- 3:35:41survival skills of the cloud. So, when
- 3:35:43do you actually make this choice? You
- 3:35:46choose Amazon RDS when migrating legacy
- 3:35:48applications that need a standard
- 3:35:49homogeneous SQL database engine. You
- 3:35:52choose Amazon DynamoB when you need a
- 3:35:54serverless non-reational database to
- 3:35:56handle unpredictable viral web traffic.
- 3:35:59You choose Amazon Aurora when you need
- 3:36:00an enterprisegrade relational database
- 3:36:02with extreme fault tolerance. If you are
- 3:36:05taking the AWS solutions architect exam,
- 3:36:07domain 3 heavily tests your ability to
- 3:36:10determine high performing database
- 3:36:11solutions. Do not miss this trap. They
- 3:36:14will try to trick you by offering
- 3:36:15DynamoB for an application that requires
- 3:36:17complex multi-table financial queries.
- 3:36:20Never use DynamoB for complex relational
- 3:36:22queries. Conversely, if the question
- 3:36:24asks for the most cost-effective
- 3:36:25database for a mobile app with massive
- 3:36:27unpredictable reads and writes, do not
- 3:36:29choose a static Amazon RDS instance. The
- 3:36:32answer for unpredictable massive scale
- 3:36:34is always Dynamo DB or a serverless
- 3:36:36database option. Let's do a fast punchy
- 3:36:38recap. RDS is your strict traditional
- 3:36:41accountant. Dynamob is your infinitely
- 3:36:43scaling robotic warehouse. Aurora is
- 3:36:46your cloudnative cyborg relational
- 3:36:48database. Here are your three rapidfire
- 3:36:50takeaways. One, database selection is
- 3:36:53entirely driven by whether your access
- 3:36:55patterns are relational or non-
- 3:36:56relational. Two, Dynamo DB provides
- 3:36:59singledigit millisecond latency at any
- 3:37:01scale. Three, Aurora decouples compute
- 3:37:04and storage to survive massive hardware
- 3:37:06failures. And here is your final trap.
- 3:37:10Do not overengineer.
- 3:37:12Aurora is incredible, but it is an
- 3:37:14enterprise tool. If you are just
- 3:37:16building a simple internal application
- 3:37:18for 10 employees, a basic Amazon RDS
- 3:37:20instance is all you need to keep your
- 3:37:22architecture cost optimized. So before
- 3:37:25you build your next big application, ask
- 3:37:27yourself, does your data need a strict
- 3:37:29accountant, a massive robotic warehouse,
- 3:37:32or the survival skills of a cyborg?
- 3:37:34Imagine it's Black Friday. Your
- 3:37:36marketing team just dropped the absolute
- 3:37:38biggest campaign of the entire year.
- 3:37:40Traffic spikes by 10,000%. Your web
- 3:37:43servers scale up beautifully, doing
- 3:37:45exactly what they're supposed to do. But
- 3:37:47suddenly, everything just freezes.
- 3:37:49Customers can't check out. You're seeing
- 3:37:51errors absolutely everywhere. So, why
- 3:37:53did this happen? Well, your single
- 3:37:54database just choked to death. Millions
- 3:37:57of dollars literally gone in minutes.
- 3:37:59Now, this is the exact nightmare that
- 3:38:01every cloud architect is hired to
- 3:38:03prevent. And if you're studying for the
- 3:38:05AWS solutions architect associate exam,
- 3:38:07mastering how to fix this is absolutely
- 3:38:10non-negotiable. In this explainer, we'll
- 3:38:12be showing you exactly how we solve this
- 3:38:14in the real world. When we talk about
- 3:38:16database architecture, we're really
- 3:38:18solving two completely different
- 3:38:20problems. Problem one, the database is
- 3:38:23just way too busy. And problem two, the
- 3:38:26database literally catches fire and
- 3:38:28dies. To fix these, AWS gives us two
- 3:38:31completely different tools. Read
- 3:38:33replicas and multi-AZ deployments. Let's
- 3:38:37break these two solutions down to their
- 3:38:38absolute simplest forms. First up, read
- 3:38:42replicas. A read replica is exactly what
- 3:38:45it sounds like. It's a copy of your main
- 3:38:47database that is strictly used for
- 3:38:49reading data. So why does this even
- 3:38:51exist? Well, because in almost every
- 3:38:54modern application, data access patterns
- 3:38:56are incredibly read inensive. Users are
- 3:38:59constantly browsing products, looking at
- 3:39:01profiles, refreshing their feeds.
- 3:39:03Writing data, like actually placing an
- 3:39:06order, happens way less often. Think
- 3:39:08about it like a busy restaurant kitchen.
- 3:39:10You have one head chef, right? That's
- 3:39:12your primary database. They're cooking
- 3:39:14the meals, doing all the heavy lifting,
- 3:39:16making the actual changes. If every
- 3:39:18single waiter keeps asking the head chef
- 3:39:21for a menu update, the chef has to stop
- 3:39:23cooking. The kitchen basically crashes.
- 3:39:26So, what do you do? You hire sue chefs.
- 3:39:28The sue chefs just hand out the menus.
- 3:39:30The waiters ask the sue chefs, and the
- 3:39:33head chef is left totally alone to
- 3:39:34actually cook. Those sous chefs are your
- 3:39:37read replicas. You point all your
- 3:39:39reporting tools, analytics, and read
- 3:39:41heavy traffic over to the replicas. This
- 3:39:44offloads all that pressure, keeping your
- 3:39:46primary database incredibly fast. But
- 3:39:49here's the crucial trade-off. Read
- 3:39:51replicas use asynchronous replication.
- 3:39:54That means there's a tiny delay, usually
- 3:39:56just milliseconds, before the replica
- 3:39:58gets the absolute newest data from the
- 3:40:00primary. Now, imagine this in your
- 3:40:02actual system. If a user updates their
- 3:40:05profile picture and immediately
- 3:40:06refreshes the page, they might actually
- 3:40:08see their old picture for a split second
- 3:40:10if their read request hits a replica
- 3:40:12that just hasn't caught up yet. But
- 3:40:14here's exactly where people fail this.
- 3:40:17They think read replicas are a disaster
- 3:40:19recovery strategy. They are absolutely
- 3:40:22not. If your main data center gets wiped
- 3:40:25out by a power failure and you only have
- 3:40:27read replicas, you're in massive
- 3:40:29trouble. To fix that specific problem,
- 3:40:31we need multi-AZ. Multi-AZ stands for
- 3:40:34multiple availability zones. So what is
- 3:40:36it? It's an exact identical standby copy
- 3:40:39of your database sitting in a completely
- 3:40:41different physical data center. Why does
- 3:40:43it exist? For strict disaster recovery
- 3:40:46and high availability. Think of Multi-AZ
- 3:40:49like a stunt double in a movie. The
- 3:40:51stunt double stands off camera wearing
- 3:40:53the exact same outfit, copying every
- 3:40:55single move the main actor makes. They
- 3:40:58don't talk. They don't interact with the
- 3:40:59crew. They just wait. If the main actor
- 3:41:02twists their ankle, the director yells,
- 3:41:04"Swap," and the stunt double steps in
- 3:41:07instantly. The movie just keeps filming.
- 3:41:09That's multi-AZ. It uses synchronous
- 3:41:12replication. Every single time you write
- 3:41:14data to your main database, AWS
- 3:41:17simultaneously writes it to the standby
- 3:41:19database before confirming success. They
- 3:41:22are perfectly in sync. If your primary
- 3:41:24database fails, AWS automatically
- 3:41:27updates the DNS record to point to the
- 3:41:29standby. The failover is completely
- 3:41:31seamless. Your application barely even
- 3:41:33notices. But here's the catch. You
- 3:41:35cannot read from the standby database.
- 3:41:37It's strictly a backup. It does
- 3:41:38absolutely zero work until a disaster
- 3:41:41happens. Oh, okay. Now I get it. Read
- 3:41:44replicas are for performance. Multi-AZ
- 3:41:47is for survival. Now, here's the part
- 3:41:49that actually matters for your AWS exam
- 3:41:51and well, your actual career. How do you
- 3:41:54choose between the two? It always comes
- 3:41:56down to the specific business
- 3:41:58requirement. If the business says, "Hey,
- 3:42:00our database is incredibly slow when the
- 3:42:02accounting team runs their monthly
- 3:42:03reports, you need a read replica to
- 3:42:05handle that read intensive pattern." But
- 3:42:07if the business says, "If this database
- 3:42:09goes offline for more than 2 minutes, we
- 3:42:11lose a million dollars." Then you need
- 3:42:13multi-AZ to meet those strict recovery
- 3:42:15time and recovery point metrics. Here is
- 3:42:18the ultimate exam trap. Definitely watch
- 3:42:20out for this. The question will describe
- 3:42:22a database that needs to survive an
- 3:42:24availability zone failure, but it will
- 3:42:27also complain about slow read
- 3:42:28performance. Do not fall for the trick.
- 3:42:32You don't have to choose just one. You
- 3:42:33can actually use both. You can have a
- 3:42:35multi-AZ database for the high
- 3:42:37availability and attach read replicas to
- 3:42:39it for high performance. Let's lock this
- 3:42:42in. Read replicas scale your read
- 3:42:44performance asynchronously. Multi-AZ
- 3:42:47ensures fault tolerance synchronously
- 3:42:49across AWS availability zones.
- 3:42:52Performance equals replicas. Resilience
- 3:42:54equals multi-AZ. To put it simply into a
- 3:42:57mental checklist for your exams. Use
- 3:43:00read replicas strictly for read heavy
- 3:43:02workloads and reporting. Use multi-AZ
- 3:43:05strictly for automated disaster recovery
- 3:43:07and high availability. Remember replicas
- 3:43:09are asynchronous. MultiAZ is
- 3:43:12synchronous. Final warning. If a
- 3:43:14question asks you to fix a slow database
- 3:43:16and you choose multi-AZ, you just failed
- 3:43:19the question. Multi-AZ does not improve
- 3:43:22performance. Master this difference and
- 3:43:24you are one step closer to crushing
- 3:43:25domain 3 of the AWS solutions architect
- 3:43:28exam. But ask yourself this. If a
- 3:43:31catastrophic hardware failure hit your
- 3:43:32company's database right the second,
- 3:43:34would your application survive or just
- 3:43:36fail really fast? Keep building. Okay,
- 3:43:39picture this. You just launched a brand
- 3:43:41new feature. Out of nowhere, a massive
- 3:43:43influencer tweets about it. Boom. You go
- 3:43:45from a 100 users to a 100,000 in exactly
- 3:43:48three minutes. Now, if you're running
- 3:43:50traditional servers, they literally
- 3:43:51melt. Your app crashes hard and you
- 3:43:54totally lose your golden moment. It is a
- 3:43:56complete nightmare. Or, you know, think
- 3:43:58about the exact opposite scenario. You
- 3:43:59provision 10,000 servers just in case
- 3:44:01you go viral, but crickets. Nobody shows
- 3:44:04up and then you get an AWS bill that
- 3:44:06literally bankrupts your startup. Yeah,
- 3:44:09that right there is the ultimate
- 3:44:10nightmare of traditional cloud
- 3:44:11architecture. You either guess too low
- 3:44:13and crash or you guess too high and just
- 3:44:16burn through cash. So today, let's look
- 3:44:18at how modern architects completely
- 3:44:19eliminate this problem. We're going to
- 3:44:21run through the capacity guessing
- 3:44:22nightmare, the serverless vending
- 3:44:23machine model, infinite parallel
- 3:44:25scaling, the tricky 15-minute trap, and
- 3:44:27finally the memory CPU connection. Let's
- 3:44:30dive right in. Starting off with section
- 3:44:32one, the capacity guessing nightmare.
- 3:44:34Look, let's just get one thing straight
- 3:44:36right out of the gate. The term
- 3:44:38serverless, it's kind of a lie. I mean,
- 3:44:40there are absolutely still servers
- 3:44:42involved. But here's the absolute magic
- 3:44:44of it all. You don't manage them. You
- 3:44:46don't have to patch them. And you
- 3:44:47definitely don't have to guess your
- 3:44:49capacity. AWS handles all of that heavy
- 3:44:51lifting completely behind the scenes.
- 3:44:53Really let that sink in for a second.
- 3:44:55Viral traffic doesn't mean a crashed app
- 3:44:58anymore, and overprovisioning doesn't
- 3:45:00mean bankruptcy. All you have to do is
- 3:45:02just bring your code. That's the whole
- 3:45:04shebang. Moving right along to section
- 3:45:07two, the serverless vending machine. To
- 3:45:09really wrap our heads around how this
- 3:45:11compute model works, I want you to think
- 3:45:13of AWS Lambda exactly like a vending
- 3:45:15machine. So a vending machine just sits
- 3:45:18there in the hallway, right? It's doing
- 3:45:20absolutely nothing and it's costing you
- 3:45:220 in compute power. But then a user
- 3:45:26drops in a coin. That coin drop is your
- 3:45:28event trigger. And the very moment that
- 3:45:30trigger happens, the machine instantly
- 3:45:32wakes up. It executes its mechanical
- 3:45:34code. It drops your snack and then it
- 3:45:37goes right back to sleep. I really want
- 3:45:39you to think about that for a second.
- 3:45:41With Lambda, you are only paying for the
- 3:45:43exact milliseconds your code is actively
- 3:45:45running. Once you grasp that, it's a
- 3:45:47total gamecher. Oh, now I get it. If
- 3:45:50nobody clicks the button in your app,
- 3:45:52you pay absolutely nothing. Zero. Just
- 3:45:54try doing that with a traditional server
- 3:45:56that has to be left running 24/7. All
- 3:45:58right. Section three, infinite parallel
- 3:46:01scaling. Now, here is where things get
- 3:46:03super interesting. How do we actually
- 3:46:05use this in real world high-erforming
- 3:46:08systems? Well, you use Lambda to deeply
- 3:46:11decouple your workloads by breaking
- 3:46:13things apart. Every single component can
- 3:46:15scale completely independently. Let's
- 3:46:18look at an example. Imagine a user
- 3:46:19uploads a huge profile picture to your
- 3:46:21app. That upload itself is an event. It
- 3:46:23triggers a Lambda function. The function
- 3:46:25wakes up, resizes the image for mobile,
- 3:46:27saves it, and then dies. Simple, right?
- 3:46:29If one person uploads, one Lambda runs.
- 3:46:32But what if 10,000 people upload photos
- 3:46:34at the exact same second? Well, 10,000
- 3:46:36separate Lambda functions instantly spin
- 3:46:38up in parallel. They do the job and then
- 3:46:40they all vanish. That brings us to
- 3:46:42section four, the 15-minute trap. Listen
- 3:46:46closely, because this is exactly where
- 3:46:48people mess up. They start treating
- 3:46:50Lambda like it's some sort of magic
- 3:46:52bullet and they try to run literally
- 3:46:54everything on it. Let me tell you right
- 3:46:56now, you cannot do that. AWS Lambda has
- 3:46:59a strict non-negotiable 15minute maximum
- 3:47:02execution timeout. If your code takes,
- 3:47:04say, 16 minutes to process some massive
- 3:47:06database export, Lambda simply does not
- 3:47:09care. At exactly 15 minutes, it
- 3:47:11ruthlessly kills your process. Boom.
- 3:47:13Done. Your system breaks right halfway
- 3:47:16through. So, if you have massive,
- 3:47:18longunning, continuous tasks, Lambda is
- 3:47:21absolutely the wrong tool for the job.
- 3:47:23Period. So, how do you actually decide
- 3:47:25between the two? Well, it always comes
- 3:47:27down to your traffic pattern. If you
- 3:47:29have a constant, predictable, heavy
- 3:47:31heartbeat of traffic, kind of like a
- 3:47:33massive multiplayer game server, then
- 3:47:35traditional EC2 instances are going to
- 3:47:37be highly efficient. But if your traffic
- 3:47:40is unpredictable, if it's spiky, or if
- 3:47:42it's triggered by random user events,
- 3:47:44Lambda is absolutely unmatched. Okay,
- 3:47:47moving to our final segment, section
- 3:47:49five, the memory CPU connection. Now,
- 3:47:52heads up because this is the ultimate
- 3:47:54exam trap. You need to watch out for
- 3:47:56this. You are definitely going to be
- 3:47:58tested on your ability to select the
- 3:47:59appropriate resource size to meet your
- 3:48:01specific business requirements. See,
- 3:48:03with a traditional server, you go in and
- 3:48:06you choose your CPU and your RAM
- 3:48:08separately, right? But with Lambda, you
- 3:48:10only configure the amount of memory. So,
- 3:48:12people naturally get confused and they
- 3:48:14ask us, "Hey, how do I make my Lambda
- 3:48:16function process faster? Where is the
- 3:48:18CPU dial?" Well, here is the secret.
- 3:48:21There is no CPU dial. AWS automatically
- 3:48:24allocates CPU power linearly
- 3:48:26proportional to the amount of memory you
- 3:48:28configure. It's really that simple. If
- 3:48:31you double the memory, you automatically
- 3:48:33double the CPU power under the hood. All
- 3:48:35right, let's lock all this in. Lambda
- 3:48:38runs your code without you ever having
- 3:48:39to provision servers and it scales
- 3:48:41automatically based purely on event
- 3:48:43triggers. You want to deeply decouple
- 3:48:45your workloads so they can scale
- 3:48:46infinitely and independently. And
- 3:48:48remember, you optimize your compute
- 3:48:49performance strictly by adjusting the
- 3:48:51memory allocation. So use Lambda for
- 3:48:53unpredictable event-driven traffic.
- 3:48:55Scale your performance by increasing
- 3:48:57memory, not CPU. And whatever you do,
- 3:48:59avoid Lambda for any process that takes
- 3:49:01longer than 15 minutes. Final warning on
- 3:49:03that one, guys. If a scenario asks you
- 3:49:05for a compute solution for a continuous
- 3:49:07hours long processing job, do not pick
- 3:49:09Lambda. It will time out and it will
- 3:49:11fail. Master serverless and you truly
- 3:49:13unlock the power of the cloud. But
- 3:49:15considering those 15-minute timeouts and
- 3:49:17memory bound CPU limits, it leaves you
- 3:49:19wondering, are traditional servers
- 3:49:20really dead, or do they just have a
- 3:49:22different job now? Welcome to this
- 3:49:24explainer on ALB versus API Gateway.
- 3:49:28Imagine this. Your brand new mobile app
- 3:49:30finally gets featured on the App Store.
- 3:49:32It's the exact moment you've been
- 3:49:33waiting for. Thousands of enthusiastic
- 3:49:36users hit your backend all at once. The
- 3:49:38traffic is absolutely massive, just
- 3:49:40pouring in way faster than you can even
- 3:49:42track. But it's not just volume you're
- 3:49:45dealing with here. You've got malicious
- 3:49:47bots out there trying to scrape your
- 3:49:48data. You've got impatient users
- 3:49:50aggressively spamming the refresh button
- 3:49:52over and over again. And within minutes,
- 3:49:55your entire system crashes. And here's
- 3:49:57the truly frustrating part. It failed
- 3:49:59not because you didn't have enough
- 3:50:01servers spun up. It failed because you
- 3:50:03didn't control how traffic entered your
- 3:50:05system in the first place. This brings
- 3:50:07us to the ultimate traffic cop problem.
- 3:50:10You have clients on one side, browsers,
- 3:50:12mobile apps, maybe other services, and
- 3:50:14your back-end compute on the other side.
- 3:50:17You need something intelligent in the
- 3:50:18middle to catch that incoming traffic,
- 3:50:20inspect what it actually is, and
- 3:50:22carefully route it. AWS gives us two
- 3:50:25heavyweights to solve this exact
- 3:50:27architectural challenge. The application
- 3:50:28load balancer or AOB and Amazon API
- 3:50:31gateway. Both of these powerful services
- 3:50:33can route HTTP traffic. Both of them can
- 3:50:36trigger your underlying compute
- 3:50:37services. And honestly, this overlap
- 3:50:39confuses almost everyone studying for
- 3:50:41the AWS solutions architect exam. Now,
- 3:50:43just a quick heads up as your guide
- 3:50:45here. While the official exam guide
- 3:50:46lists these load balancing and API
- 3:50:48management tools under domain 3, high
- 3:50:50performing architectures, the specific
- 3:50:52feature comparisons I'm hearing today
- 3:50:53come from real world AWS documentation
- 3:50:55outside of that specific blueprint. So,
- 3:50:57you'll want to verify the exact specs
- 3:50:58independently. Let's break this down to
- 3:51:00its absolute simplest form. Starting
- 3:51:02with the application load balancer, an
- 3:51:04ALB is exactly what it sounds like. It
- 3:51:06simply balances the load across your
- 3:51:08resources. It sits right at layer 7 of
- 3:51:11the OSI model, looks at the incoming
- 3:51:13HTTP or HTTPS request and routes it to
- 3:51:16the right target. That is its core job.
- 3:51:19Think of the ALB like a highly efficient
- 3:51:21restaurant host. You walk through the
- 3:51:23front door and the host looks at you,
- 3:51:25asks, "Do you want the bar or a table?"
- 3:51:27and then points you to the right place
- 3:51:28based on your answer. That is really all
- 3:51:30it does. It doesn't step into the
- 3:51:32kitchen and cook your food. It doesn't
- 3:51:34stop you from eating too fast or
- 3:51:36ordering too much. It just gets you to
- 3:51:38the right server, the right container,
- 3:51:40or the right Lambda function based
- 3:51:41purely on the URL path you requested.
- 3:51:44What happens if you don't use it? Well,
- 3:51:46one single server gets 99% of the
- 3:51:48traffic and completely dies from the
- 3:51:50overwhelming load, while the rest of
- 3:51:52your expensive servers sit completely
- 3:51:54idle. The trade-off for using one, ALB
- 3:51:56is incredibly fast. It is extremely
- 3:51:58cheap at massive scale, but it is just a
- 3:52:01router. Now, let's look at Amazon API
- 3:52:03Gateway. API Gateway is not just a
- 3:52:05router. It is a full-blown front door, a
- 3:52:08highly trained security guard, and a
- 3:52:10sophisticated traffic manager, all
- 3:52:12combined into a single managed service.
- 3:52:14It can do what the ALB does in terms of
- 3:52:16directing traffic, but it adds massive
- 3:52:18crucial intelligence to the equation. It
- 3:52:20can aggressively throttle requests so a
- 3:52:22single rogue user doesn't spam your
- 3:52:24backend into oblivion. It can
- 3:52:26mathematically validate complex JSON
- 3:52:28payloads before they ever have the
- 3:52:29chance to reach your underlying servers.
- 3:52:31It can even manage dedicated API keys
- 3:52:33for your premium paying users. Think
- 3:52:35about that for a second. With an ALB, a
- 3:52:38badly formatted, potentially harmful
- 3:52:40request hits your backend compute before
- 3:52:43it finally gets rejected. With API
- 3:52:45gateway, that bad request is killed
- 3:52:47immediately at the door. Your backend
- 3:52:49never even wakes up. You save compute,
- 3:52:52you save money, and you maintain
- 3:52:54absolute security. Oh, now I get it. So,
- 3:52:58here is the mental model to remember.
- 3:53:00ALB is the friendly host routing
- 3:53:02traffic. API gateway is the bouncer
- 3:53:06checking IDs, enforcing the house rules,
- 3:53:08and stopping fights before they ever
- 3:53:10spill into the main room. Now, pay
- 3:53:13attention because here is where people
- 3:53:15completely fail this concept. They see a
- 3:53:17serverless architecture diagram using
- 3:53:19AWS Lambda and they automatically assume
- 3:53:21they must use API gateway as the
- 3:53:23trigger. You don't. An application load
- 3:53:26balancer can directly trigger a Lambda
- 3:53:28function too. It's a massive
- 3:53:29misconception that costs people points
- 3:53:31on exams and money in real world
- 3:53:33architecture. So when do you actually
- 3:53:35use each? This is the million-doll real
- 3:53:38world decision. If you are building an
- 3:53:40internal micros service or a massive
- 3:53:42scale web application where every single
- 3:53:44millisecond counts and you just need to
- 3:53:46spray high volume HTTP traffic across a
- 3:53:48massive fleet of EC2 instances or
- 3:53:50containers, you use an ALB. It handles
- 3:53:52incredibly massive throughput and costs
- 3:53:54a tiny fraction of what API gateway
- 3:53:56charges. But if you are exposing a
- 3:53:58public API to thirdparty developers, you
- 3:54:01absolutely need API gateway. You need to
- 3:54:03hand out API keys. You need to create
- 3:54:05usage plans to charge customers based on
- 3:54:07how many API calls they make. You need
- 3:54:09strict enforcable per user throttling to
- 3:54:12protect your platform. Now imagine this
- 3:54:14disastrous scenario in your system. You
- 3:54:16put a simple ALB in front of a heavily
- 3:54:18used public API. A malicious user or
- 3:54:21even just a badly coded client writes a
- 3:54:23script that spams your endpoint 10,000
- 3:54:26times a second. Your ALB happily,
- 3:54:28blindly routes every single one of those
- 3:54:3010,000 requests directly to your
- 3:54:32backend. Your backend frantically scales
- 3:54:34up, processes the absolute junk, and at
- 3:54:36the end of the month, your AWS bill
- 3:54:38absolutely explodes. It's a devastating
- 3:54:40financial hit. If you had used API
- 3:54:42Gateway instead, it would have
- 3:54:44recognized the abuse and throttled them
- 3:54:45instantly right at the door. Now, here's
- 3:54:48the exact trap you will see on the exam.
- 3:54:50The scenario will describe a company
- 3:54:52migrating a standard web application.
- 3:54:53They'll say they want to route HTTP
- 3:54:55traffic to a fleet of back-end servers,
- 3:54:58but hidden quietly in the second
- 3:54:59paragraph, it will mention they need to
- 3:55:01manage API keys or throttle requests by
- 3:55:04user tier. If you just read route HTTP
- 3:55:06traffic and hastily pick application
- 3:55:08load balancer, you fail the question.
- 3:55:10ALB does not support API keys. ALB does
- 3:55:13not support per user throttling. The
- 3:55:15moment you see the specific words API
- 3:55:17keys, throttling, usage plans, or
- 3:55:20payload validation, you immediately pick
- 3:55:22Amazon API gateway. Oh, now I get it. It
- 3:55:27ultimately comes down to this. The
- 3:55:29choice isn't about where the traffic
- 3:55:31goes. It's about how much control you
- 3:55:33need over the traffic itself before it's
- 3:55:35allowed inside. Let's lock this in one
- 3:55:38final time. A OB routes traffic
- 3:55:40efficiently at massive scale for cheap.
- 3:55:43API gateway manages, secures, and
- 3:55:45monetizes public-f facing APIs. Use ALB
- 3:55:48for high throughput, internal routing,
- 3:55:50or simple web apps where speed is the
- 3:55:52only metric. Use API gateway for API
- 3:55:55keys, throttling, and full API life
- 3:55:57cycle management. Both can trigger
- 3:55:59compute services, but API gateway always
- 3:56:01protects your backend better. Which
- 3:56:03leaves us with this final thought. Is
- 3:56:05your backend currently paying the price
- 3:56:07for a missing bouncer? Final warning. If
- 3:56:10your architectural scenario demands
- 3:56:11usage plans or API monetization, ALB is
- 3:56:14a dangerous trap. Pick API gateway.
- 3:56:17Master this crucial difference and you
- 3:56:19completely control the traffic. Welcome
- 3:56:21to this explainer. Today we're
- 3:56:23completely demystifying AWS container
- 3:56:26services. Imagine you spend 6 months
- 3:56:28writing the perfect code. It runs
- 3:56:30absolutely flawlessly on your laptop.
- 3:56:32You deploy it to production and
- 3:56:34instantly the entire system crashes.
- 3:56:36Why? because the production server has a
- 3:56:38slightly different software version than
- 3:56:39your laptop. Millions of dollars lost
- 3:56:41over a minor system mismatch. Section
- 3:56:44one, the container revolution. Solving
- 3:56:47the deployment nightmare. To solve this
- 3:56:50exact nightmare, the tech industry
- 3:56:51adopted containers. And if you're
- 3:56:53studying for domain 3 of the AWS
- 3:56:55solutions architect exam, you must
- 3:56:57master how AWS handles them. Just a
- 3:57:00quick heads up before we dive in. The
- 3:57:01official exam guide explicitly tests
- 3:57:03your ability to design high-erforming
- 3:57:05architectures using container
- 3:57:06orchestration and serverless
- 3:57:08technologies, but the specific real
- 3:57:10world operational differences I'm about
- 3:57:12to share come from AWS engineering
- 3:57:14documentation outside that highle
- 3:57:16blueprint. So, you'll want to
- 3:57:17independently verify the deeper specs.
- 3:57:20Let's break this down from zero. A
- 3:57:22container packages your code, its
- 3:57:24dependencies, and its runtime into one
- 3:57:25standardized box. It doesn't matter if
- 3:57:27it runs on your laptop, a physical data
- 3:57:29center, or the AWS cloud. It runs
- 3:57:31exactly the same everywhere. Think of
- 3:57:33physical shipping cargo. A 100 years
- 3:57:35ago, loading a ship was a nightmare of
- 3:57:38custom barrels, crates, and sacks.
- 3:57:41Today, everything goes into a standard
- 3:57:43steel shipping container. Cranes can
- 3:57:45move them blindly. But here is the
- 3:57:47problem in real systems. If you have
- 3:57:49three containers, you can manually start
- 3:57:51them. But what if your app goes viral
- 3:57:53and you need 10,000 containers? What if
- 3:57:55a server dies at 3:00 a.m. and takes
- 3:57:57down 50 containers? Who restarts them?
- 3:58:00Who routes network traffic to the
- 3:58:02healthy ones? You need a massive
- 3:58:04automated train operator. You need
- 3:58:06container orchestration. Section two,
- 3:58:08the orchestration brains. Amazon ECS
- 3:58:11versus Amazon EKS. AWS gives us two
- 3:58:15heavyweights for this. Amazon ECS and
- 3:58:18Amazon EKS.
- 3:58:20First, Amazon ECS, Elastic Container
- 3:58:24Service. This is AWS's native container
- 3:58:28orchestrator. It was built by AWS for
- 3:58:30AWS. Why does it exist? Because
- 3:58:33developers wanted a simple, deeply
- 3:58:35integrated way to manage containers
- 3:58:36without learning an entirely new
- 3:58:38ecosystem. ECS integrates perfectly with
- 3:58:41AWS load balancers, security groups, and
- 3:58:44AM roles. It is incredibly
- 3:58:46straightforward.
- 3:58:47Then we have Amazon EKS, Elastic
- 3:58:50Kubernetes Service. Kubernetes is the
- 3:58:52open- source industry standard for
- 3:58:54container orchestration. It is insanely
- 3:58:56powerful, but also notoriously complex.
- 3:58:59So why use EKS if it's harder? Universal
- 3:59:02portability. If your company already
- 3:59:04uses Kubernetes, you can move your
- 3:59:06containers between AWS, arrival cloud,
- 3:59:08or your own basement without rewriting a
- 3:59:10single line of deployment logic. It is
- 3:59:12like speaking a universal language.
- 3:59:14Section three, the infrastructure
- 3:59:17muscle. Why you still need hardware. But
- 3:59:20here's where people fail this. They
- 3:59:22think picking ECS or EKS solves
- 3:59:24everything. It doesn't. ECS and EKS are
- 3:59:27just the management layer. They are the
- 3:59:28brains. They still need muscle. They
- 3:59:30need physical hardware to actually run
- 3:59:32the containers. Historically, that meant
- 3:59:34you had to provision Amazon EC2 servers,
- 3:59:37join them to your cluster, patch their
- 3:59:38operating systems, and monitor their
- 3:59:40capacity. If your EC2 servers ran out of
- 3:59:42memory, your orchestrator couldn't
- 3:59:44deploy new containers. You are stuck
- 3:59:46managing servers again. Enter AWS
- 3:59:49Fargate. Fargate completely changes the
- 3:59:52game. It is a serverless compute engine
- 3:59:55specifically for containers. Think about
- 3:59:57that for a second. With Fargate, there
- 3:59:59are no EC2 instances to provision, no
- 4:00:02operating systems to patch, no server
- 4:00:04capacity to guess. You literally just
- 4:00:06tell AWS, "Here is my container image. I
- 4:00:09need two gigs of RAM and one CPU. Run
- 4:00:11it. AWS magically finds a compute space
- 4:00:13in their massive data centers, runs the
- 4:00:15container, and bills you strictly for
- 4:00:17what you use. Oh, now I get it. ECS and
- 4:00:21EKS are the managers telling the system
- 4:00:24what needs to happen. EC2 and Fargate
- 4:00:27are the underlying workforce actually
- 4:00:29doing the heavy lifting. Section four,
- 4:00:32making the architectural choice, the
- 4:00:35two-part decision. So, how do you
- 4:00:37choose? This is the ultimate
- 4:00:38architectural decision. It's a two-part
- 4:00:41choice. First, pick your manager. If you
- 4:00:43want native AWS simplicity, pick ECS. If
- 4:00:46you need open source portability or have
- 4:00:48an existing Kubernetes footprint, pick
- 4:00:50EKS. Second, pick your muscle. If you
- 4:00:53need strict root level control over the
- 4:00:55underlying hardware or you are running
- 4:00:57massive predictable workloads where
- 4:00:58reserved servers are cheaper, use EC2.
- 4:01:01But if you want to eliminate server
- 4:01:03maintenance and achieve the lowest
- 4:01:04possible operational overhead, you pick
- 4:01:07Fargate. Section five, avoiding the exam
- 4:01:10trap. Read the requirements carefully.
- 4:01:13Now, here is the exact trap you will see
- 4:01:15on the exam and in the real world. The
- 4:01:18scenario will describe a startup
- 4:01:19deploying microservices using
- 4:01:21containers. The prompt will explicitly
- 4:01:23state that the engineering team is small
- 4:01:25and needs to minimize operational
- 4:01:27overhead or avoid managing underlying
- 4:01:29infrastructure. One of the multiple
- 4:01:31choice answers will be Amazon EKS with
- 4:01:34EC2 worker nodes. Do not pick it. EKS is
- 4:01:37complex and EC2 requires server
- 4:01:39management. You failed the requirement.
- 4:01:41The moment you see containers combined
- 4:01:43with lowest operational overhead or no
- 4:01:46server management, your brain needs to
- 4:01:48instantly lock on to AWS Fargate. So,
- 4:01:52here is the big light bulb moment.
- 4:01:53Fargate isn't a competitor to ECS.
- 4:01:56Fargate is the invisible server powering
- 4:01:58ECS. Let's lock this in. Containers
- 4:02:02standardize your deployments.
- 4:02:03Orchestrators manage the chaos. ECS is
- 4:02:06native and simple. EKS is open-source
- 4:02:09and portable. Fargate is the serverless
- 4:02:12engine that eliminates infrastructure
- 4:02:14management. Pick ECS for fast, deep AWS
- 4:02:17integration. Pick EKS for Kubernetes
- 4:02:20migrations and cloud agnosticism. Pick
- 4:02:23Fargate when you never want to patch a
- 4:02:24server again. Final warning. If you
- 4:02:27think Fargate replaces ECS or EKS, you
- 4:02:30will miss the architecture question.
- 4:02:32Fargate works with them. Master this
- 4:02:34decoupling of brains and muscle and you
- 4:02:36will dominate domain 3. But looking at
- 4:02:38your own infrastructure today, are you
- 4:02:40spending your time building great
- 4:02:42products or are you still just managing
- 4:02:43servers? Data streaming Kinesis basics.
- 4:02:46All right, so imagine you just launched
- 4:02:48a massive multiplayer mobile game,
- 4:02:51right? And it goes completely viral.
- 4:02:54Suddenly you've got a million players
- 4:02:55online. Every single time someone moves,
- 4:02:58shoots, or scores, your application
- 4:03:00sends a critical data point straight to
- 4:03:02your back end. We're talking millions of
- 4:03:05events per second. Now, let's say you
- 4:03:07route all of this incoming data directly
- 4:03:10into your main database. Well, within
- 4:03:12exactly 4 seconds, the database locks
- 4:03:15up. It literally catches fire. The game
- 4:03:18crashes, and just like that, your viral
- 4:03:20moment is completely dead. So, why does
- 4:03:22this happen? It's because databases are
- 4:03:25fundamentally designed for storing and
- 4:03:26intricately querying data. They are
- 4:03:28incredibly fragile when they're hit with
- 4:03:30a relentless high velocity tsunami of
- 4:03:32raw inserts. They simply cannot handle
- 4:03:34the sheer force of a million users
- 4:03:36pushing data all at the exact same time.
- 4:03:38Look, you didn't need a bigger database.
- 4:03:41What you actually needed was a shock
- 4:03:43absorber. And this is exactly where data
- 4:03:45streaming comes into play. On the AWS
- 4:03:48solutions architect exam, the absolute
- 4:03:50king of streaming data ingestion is
- 4:03:52Amazon Kinesis. Let's break this down to
- 4:03:54its absolute simplest form. Think of
- 4:03:57Kinesis like a massive, totally
- 4:03:59indestructible conveyor belt. So your
- 4:04:01mobile game, your IoT sensors, your web
- 4:04:03servers, they're what we call the
- 4:04:05producers, and they just throw data onto
- 4:04:07this conveyor belt as fast as humanly
- 4:04:09possible. Now, the belt itself doesn't
- 4:04:11actually process the data. It just
- 4:04:13catches it, holds it securely, and keeps
- 4:04:15moving forward. Then on the completely
- 4:04:17other end of the belt, you have your
- 4:04:18consumers. These are your EC2 servers or
- 4:04:21your Lambda functions, and they just
- 4:04:22calmly pull data off the belt at their
- 4:04:24own safe, perfectly manageable speed.
- 4:04:27Think about that for a second. If your
- 4:04:28game suddenly spikes to 10 million
- 4:04:30users, sure, the conveyor belt gets
- 4:04:32crowded, but your database doesn't crash
- 4:04:34because your database is sitting safely
- 4:04:36behind those consumers. This is the real
- 4:04:38light bulb moment here. Kinesis
- 4:04:40completely decouples the massive speed
- 4:04:42of incoming data from the processing
- 4:04:44speed of your backend. It acts as that
- 4:04:46absolutely crucial buffer and it
- 4:04:47prevents your entire system from
- 4:04:49basically drowning in its own success.
- 4:04:51Now to architect this correctly, you've
- 4:04:53got to understand that Kinesis isn't
- 4:04:55just one single service. It's actually a
- 4:04:57family and you are going to be tested
- 4:04:59heavily on the critical difference
- 4:05:00between the two main members of this
- 4:05:02family. Kinesis data streams and Kinesis
- 4:05:05data fire hose. First up, let's look at
- 4:05:08Kinesis data streams. This right here is
- 4:05:10the ultimate real-time streaming
- 4:05:12service. When you use data streams, your
- 4:05:14data is available to be processed in
- 4:05:15literally milliseconds. It is lightning
- 4:05:18fast. But here is the big trade-off you
- 4:05:20have to remember. It requires manual
- 4:05:22management. You see, data streams is
- 4:05:24built out of individual structural units
- 4:05:26called shards. I want you to think of a
- 4:05:28shard kind of like a lane on a highway.
- 4:05:30One lane can handle exactly 1 megabyte
- 4:05:33of data per second coming in and 2
- 4:05:35megabytes per second going out. But, and
- 4:05:38listen closely because this is exactly
- 4:05:40where people mess up. If your traffic
- 4:05:42spikes, one lane just isn't going to be
- 4:05:44enough. You have to manually add more
- 4:05:46lanes. You actually have to write custom
- 4:05:48code to pull the data out of the stream.
- 4:05:51It requires your active hands-on
- 4:05:52involvement to keep that traffic flowing
- 4:05:54smoothly. Now, imagine this running in
- 4:05:57your live production system. If you
- 4:05:59miscalculate and you don't provision
- 4:06:00enough shards, that highway jams up
- 4:06:03completely. AWS actually drops your
- 4:06:05incoming data. you get this dreaded
- 4:06:07provisioned throughput exceeded error
- 4:06:09and boom, your vital data is lost before
- 4:06:12it even hits the back end. So to avoid
- 4:06:14that massive headache, AWS gives us a
- 4:06:17second option and that's Kinesis data
- 4:06:19fire hose. Fire hose completely
- 4:06:21eliminates all of that management
- 4:06:23overhead. There are zero shards. There
- 4:06:25are no highways to manage. It just
- 4:06:27scales perfectly, infinitely, and
- 4:06:29entirely automatically. You literally
- 4:06:31just point fire hose at an S3 bucket, an
- 4:06:33Amazon Redshift data warehouse, or maybe
- 4:06:35open search, and it automatically
- 4:06:37delivers the data directly to those
- 4:06:38targets. We're talking zero custom code
- 4:06:41here. Zero maintenance. But guys, here
- 4:06:44is exactly where people fail this. They
- 4:06:47think Fire Hose is just some better
- 4:06:49upgraded version of data streams. I
- 4:06:51promise you it is not. Fire Hose is near
- 4:06:54real time, not real time. It buffers the
- 4:06:57data. It waits until it collects a
- 4:06:59certain amount of data or until up to 60
- 4:07:01seconds pass before it actually delivers
- 4:07:04the entire batch over to the
- 4:07:05destination. So, look at it this way.
- 4:07:08Data streams, that's your extremely fast
- 4:07:10sports car for instant processing. But
- 4:07:13Fire Hose, Fire Hose is like a delivery
- 4:07:15truck that sits right at the loading
- 4:07:17dock and just patiently waits until it's
- 4:07:19completely full before driving off to
- 4:07:20the warehouse. Oh, now I get it, right?
- 4:07:24And this brings us to the ultimate
- 4:07:26architectural decision, which is exactly
- 4:07:28how you're going to be tested. When do
- 4:07:30you use each one? Well, it always comes
- 4:07:33down to two specific words, latency and
- 4:07:35destination. Let's say the business
- 4:07:38stakeholder tells you, "Hey, we need to
- 4:07:40detect credit card fraud in under 50
- 4:07:42milliseconds. In that case, you
- 4:07:44absolutely must use Kinesis data
- 4:07:46streams. Fire hose is simply way too
- 4:07:48slow for that kind of instant mission
- 4:07:50critical alerting. But if the business
- 4:07:53comes to you and says, "Look, we want to
- 4:07:55collect millions of web logs and just
- 4:07:57save them into an Amazon S3 data lake
- 4:07:59with zero operational overhead." Well,
- 4:08:01then you use Kinesis data fire hose.
- 4:08:04Now, here is the exact exam trap you
- 4:08:06really need to watch out for. The
- 4:08:08question will describe this massive data
- 4:08:10ingestion requirement, right? And the
- 4:08:12scenario will explicitly complain that
- 4:08:14the engineering team is just so tired of
- 4:08:16managing infrastructure and writing
- 4:08:17custom consumer applications. and then
- 4:08:20one of the tricky multiple choice
- 4:08:21answers will inevitably suggest Kinesis
- 4:08:24data streams with autoscaling.
- 4:08:26Do not pick it. Seriously, the exact
- 4:08:29moment you see phrases like zero
- 4:08:31administration, no custom code, and a
- 4:08:34requirement for delivering data to an
- 4:08:35AWS storage service like S3 or Redshift,
- 4:08:38your brain needs to instantly lock onto
- 4:08:40Kinesis data fire hose. All right, let's
- 4:08:43lock this in so you don't forget it.
- 4:08:45Kinesis acts as a shock absorber to
- 4:08:47protect your databases from high
- 4:08:48velocity data. Data streams gives you
- 4:08:50that sweet millisecond latency, but it
- 4:08:53requires you to actively manage shards
- 4:08:54and write custom code. Data fire hose
- 4:08:57gives you fully managed zero
- 4:08:58administration data delivery. But
- 4:09:00remember, it buffers the data. So use
- 4:09:02data streams for real-time custom
- 4:09:04analytics. Use Fire Hose to easily load
- 4:09:06data into S3 or Redshift. And just keep
- 4:09:09in mind if you ever need to transform
- 4:09:11the data on the fly, both services have
- 4:09:13the exact same ability to trigger AWS
- 4:09:15Lambda. Final warning here. If you try
- 4:09:17to use Fire Hose for millisecond
- 4:09:19real-time alerts, your system will
- 4:09:21absolutely fail. Master the precise
- 4:09:24difference between streams and buffers
- 4:09:26and you are going to absolutely dominate
- 4:09:28domain 3. So the real question is the
- 4:09:30next time your app goes viral, is your
- 4:09:32data going to drown your database or
- 4:09:34will you be completely ready to ride the
- 4:09:36wave? Imagine this. You spin up a
- 4:09:38massive cluster of high performance
- 4:09:40servers for a brand new project.
- 4:09:42Everything works perfectly. So you pack
- 4:09:45up and you go home for the weekend. But
- 4:09:48then Monday rolls around. You check your
- 4:09:50AWS dashboard and your heart literally
- 4:09:53drops. You just burned $50,000 on
- 4:09:56servers that were just sitting there
- 4:09:58entirely idle. Your startup is bankrupt.
- 4:10:02Look, this is absolutely the most common
- 4:10:04disaster in cloud computing. People
- 4:10:07think the cloud is just inherently
- 4:10:08cheaper, but it's not. It is only
- 4:10:11cheaper if you know exactly how to buy
- 4:10:13it. And to pass domain four of the AWS
- 4:10:15solutions architect exam, which is all
- 4:10:17about designing costs optimized
- 4:10:19architectures, you have to master how to
- 4:10:21purchase compute capacity without
- 4:10:23wasting money. Just a quick heads up
- 4:10:25before we dive into the details. The
- 4:10:27official exam guide explicitly requires
- 4:10:29you to know AWS purchasing options like
- 4:10:32spot instances, reserved instances, and
- 4:10:34savings plans. But the specific real
- 4:10:36world discount percentages and billing
- 4:10:37mechanics I'm going to share today come
- 4:10:39from AWS pricing documentation outside
- 4:10:41of that highle blueprint. So you'll
- 4:10:43definitely want to independently verify
- 4:10:45those exact numbers for your own real
- 4:10:47world projects. All right, let's break
- 4:10:49this down from zero. We are talking
- 4:10:51about renting compute power,
- 4:10:52specifically Amazon EC2. AWS gives you
- 4:10:56three main ways to pay for this compute.
- 4:10:58On demand, reserved instances and spot
- 4:11:01instances. Let's start with on demand.
- 4:11:04On demand is exactly what it sounds
- 4:11:06like. You pay for exactly what you use,
- 4:11:08literally by the second with absolutely
- 4:11:10zero upfront commitment. Think of
- 4:11:13ondemand like booking a luxury hotel
- 4:11:15room at the very last minute. You walk
- 4:11:17in, you pay the premium nightly rate,
- 4:11:19and you can leave whenever you want. You
- 4:11:21have total freedom. But what happens if
- 4:11:23you stay in that same hotel for three
- 4:11:25years? You go completely broke. On
- 4:11:27demand is the most expensive pricing
- 4:11:29model on AWS. you really only use on
- 4:11:32demand for unpredictable workloads,
- 4:11:34maybe brand new applications or
- 4:11:35short-term testing where you absolutely
- 4:11:36need that extreme flexibility. Next up,
- 4:11:39we have reserved instances and savings
- 4:11:42plans. Now, what if you know you need a
- 4:11:44server running 24/7 for a production
- 4:11:46database? Well, in that case, you commit
- 4:11:49to AWS for a 1-year or a 3-year term.
- 4:11:52And in exchange for that commitment, AWS
- 4:11:54gives you a massive discount. We're
- 4:11:56talking sometimes up to 72%.
- 4:11:59Think of a reserved instance kind of
- 4:12:01like signing a one-year lease on an
- 4:12:02apartment. Sure, you lose the freedom to
- 4:12:04just walk away tomorrow, but your daily
- 4:12:06cost drops drastically. Think about that
- 4:12:08for a second. Oh, now I get it. On
- 4:12:12demand is for flexibility. Reserved is
- 4:12:15for predictable baseline workloads. But
- 4:12:18here's where people fail. This is the
- 4:12:20big trap. They think they must choose
- 4:12:22just one pricing model for their entire
- 4:12:24system. You really don't. But before we
- 4:12:27talk about combining them, we need to
- 4:12:28introduce the wild card spot instances.
- 4:12:32AWS has massive global data centers and
- 4:12:35at any given moment, thousands of
- 4:12:36servers are just sitting there
- 4:12:38completely empty. AWS obviously wants to
- 4:12:40make money on them, so they auction them
- 4:12:42off as spot instances at up to a 90%
- 4:12:45discount. But there is a catch, a
- 4:12:48massive system breaking catch. If a
- 4:12:51full-paying on-demand customer suddenly
- 4:12:53needs that capacity, AWS will take your
- 4:12:56spot server away from you. They give you
- 4:12:58exactly a twominute warning and then
- 4:13:00they ruthlessly terminate your instance.
- 4:13:03Think of spot instances like flying on a
- 4:13:05standby airline ticket. It is dirt
- 4:13:07cheap, but if a full-paying business
- 4:13:09traveler shows up at the gate, you get
- 4:13:11kicked off the flight. Oh, now I get it.
- 4:13:14You can only use spot instances for
- 4:13:16workloads that can actually handle
- 4:13:18sudden death. Now imagine applying this
- 4:13:21to your own system. If you run your
- 4:13:23primary e-commerce checkout database on
- 4:13:25a spot instance and AWS reclaims it,
- 4:13:28your entire company goes offline. Total
- 4:13:30disaster. But what if you were running a
- 4:13:32background task like say processing
- 4:13:3510,000 uploaded images or rendering a
- 4:13:37massive 3D video? Spot is a perfect fit
- 4:13:40here. If a server dies, the job simply
- 4:13:43pauses and another server picks it up
- 4:13:44later and you just saved 90% on your
- 4:13:47bill. This brings us right to the exact
- 4:13:49trap you're going to see on the
- 4:13:50solutions architect exam. They'll ask
- 4:13:52you to design costoptimized compute
- 4:13:54solutions. And the scenario will
- 4:13:56describe a company running a flexible
- 4:13:58fault tolerant batch processing job. And
- 4:14:00they want the absolute lowest cost
- 4:14:02possible. One of the multiplechoice
- 4:14:04answers is going to say reserved
- 4:14:06instances. That's a trap. Reserved
- 4:14:09requires a one-year lock in for a job
- 4:14:11that might only run for a few hours.
- 4:14:13Another answer will say spot instances.
- 4:14:16That right there is your golden ticket.
- 4:14:19The moment you see the exact trigger
- 4:14:21words, fault tolerant, flexible start
- 4:14:23and end times, or can withstand
- 4:14:24interruptions, your brain needs to
- 4:14:26instantly lock on to spot instances.
- 4:14:29Conversely, if the question describes a
- 4:14:31missionritical legacy database that
- 4:14:33cannot experience any downtime and will
- 4:14:35run continuously for 3 years and you
- 4:14:37pick spot, you failed. Spot equals
- 4:14:39failure there. You strictly need
- 4:14:41reserved instances for that. All right,
- 4:14:43let's lock this final summary in. On
- 4:14:45demand is expensive, but it gives you
- 4:14:47ultimate flexibility. Reserved instances
- 4:14:50give you massive discounts in exchange
- 4:14:52for a long-term commitment. And spot
- 4:14:54instances offer extreme discounts for
- 4:14:56interruptible, fault tolerant workloads.
- 4:14:59So use on demand for traffic spikes and
- 4:15:01unpredictable testing. Use reserve for
- 4:15:03your steady, predictable baseline. And
- 4:15:06use spot for background batch processing
- 4:15:08and big data. I'll leave you with this
- 4:15:10final warning. Never ever put a
- 4:15:13stateful, missionritical database on a
- 4:15:15spot instance. Master these pricing
- 4:15:17models and you don't just pass domain 4.
- 4:15:20You literally save your company
- 4:15:21millions. So ask yourself, which of your
- 4:15:24current servers is secretly draining
- 4:15:26your budget right now? Imagine paying a
- 4:15:28full-time salary to a team of 100
- 4:15:31workers, but every single day 90 of them
- 4:15:34are literally sleeping at their desks. I
- 4:15:36mean, in the real world, you get fired
- 4:15:38for that. But in the cloud, this is
- 4:15:40exactly what happens when you don't
- 4:15:42optimize your compute architecture. You
- 4:15:44just burn thousands of dollars on idle
- 4:15:46servers and your company bleeds cash.
- 4:15:48Now, if you're studying for domain 4 of
- 4:15:49the AWS solutions architect exam, you
- 4:15:52absolutely have to know how to design
- 4:15:54cost optimized architectures. So, in
- 4:15:56this explainer, let's dive into exactly
- 4:15:58how we stop the bleeding in real world
- 4:16:00systems. Compute cost optimization,
- 4:16:02which is really just how much you pay
- 4:16:04for the brain power of your servers,
- 4:16:06comes down to one main thing. paying
- 4:16:08only for the exact computing power you
- 4:16:11actually use. Back in traditional data
- 4:16:13centers, you had to buy servers for your
- 4:16:15absolute peak traffic. If Black Friday
- 4:16:17was your busiest day, well, you bought
- 4:16:19servers for Black Friday and you just
- 4:16:21left them plugged in for the other 364
- 4:16:23days of the year. In AWS, if you do
- 4:16:26that, you fail. To fix this, we rely on
- 4:16:28three core strategies. Step one, right
- 4:16:31sizing, step two, elasticity, and step
- 4:16:34three, modernization. Let's break these
- 4:16:37down to their simplest forms. Okay,
- 4:16:39first up, right sizing. AWS gives you
- 4:16:42over 600 EC2 instance types to choose
- 4:16:44from. You've got compute optimized,
- 4:16:46memory optimized, storage optimized.
- 4:16:48Making the right choice here is
- 4:16:50absolutely critical. Think of right
- 4:16:52sizing kind of like renting a vehicle.
- 4:16:54If you need to move a couch, you rent a
- 4:16:56pickup truck. If you need to move 50
- 4:16:57people, you rent a bus. If you rent a
- 4:16:59massive tour bus just to move one single
- 4:17:01couch, you're just wasting money. AWS
- 4:17:04Elastic Compute Cloud or EC2 works the
- 4:17:07exact same way. If your application
- 4:17:09needs a massive amount of memory or RAM,
- 4:17:11but barely even touches the processor,
- 4:17:13you don't buy a giant general purpose
- 4:17:15server. You select a specific memory
- 4:17:18optimized instance family. You have to
- 4:17:20match the exact server type to the exact
- 4:17:22workload. So, what happens if you don't
- 4:17:25do this? Well, you end up with 5% CPU
- 4:17:27utilization on a massive instance and an
- 4:17:29AWS bill that makes you literally want
- 4:17:31to cry. Next, we have elasticity. This
- 4:17:34is your ability to scale horizontally
- 4:17:36and vertically based on traffic. Think
- 4:17:39about that for a second. Vertical
- 4:17:41scaling is upgrading to a bigger server.
- 4:17:43Horizontal scaling is when traffic
- 4:17:44spikes and your autoscaling group
- 4:17:46automatically adds more servers to
- 4:17:48handle the load. But here is the
- 4:17:50critical rule. When traffic drops, you
- 4:17:53absolutely must scale in. You have to
- 4:17:56terminate those extra instances. If you
- 4:17:58only ever scale out and you never scale
- 4:18:00in, you aren't elastic. You are just
- 4:18:02expensive. Now, AWS also gives us this
- 4:18:06incredible feature called EC2
- 4:18:08hibernation. Imagine you have a complex
- 4:18:10server that takes, say, 10 minutes to
- 4:18:12boot up. You don't want to shut it down
- 4:18:13completely, but you also don't want to
- 4:18:15pay for it while it sits idle overnight.
- 4:18:17With hibernation, it's basically like
- 4:18:18closing the laptop lid. AWS saves the
- 4:18:21contents of your RAM directly to your
- 4:18:22hard drive and stops the instance, so
- 4:18:24you stop paying for the hourly compute.
- 4:18:26And when you need it again, you wake it
- 4:18:28up and it springs back to life
- 4:18:29instantly. Oh, this leads us to a
- 4:18:32massive realization. You know, you don't
- 4:18:35just optimize by finding cheaper
- 4:18:37servers. You optimize by turning them
- 4:18:39off the split second they aren't needed.
- 4:18:41Now, listen up because here's where
- 4:18:43people totally fail this. They spend
- 4:18:45weeks trying to negotiate better pricing
- 4:18:48using AWS Cost Explorer. They go out and
- 4:18:50buy three-year reserved instances or
- 4:18:53savings plans for servers that are
- 4:18:55massively oversized. Listen, do not buy
- 4:18:58a discount on waste. If you do, you're
- 4:19:00going to be locked into paying for
- 4:19:02unused capacity for three whole years.
- 4:19:05You have to eliminate the waste first
- 4:19:07using right sizing and then you buy the
- 4:19:09discount. Strategy three, modernization.
- 4:19:12Eliminate guesswork through serverless
- 4:19:14and containers. What if you could
- 4:19:16eliminate that guesswork entirely? No
- 4:19:18more picking instance sizes. No more
- 4:19:20managing autoscaling groups. Imagine
- 4:19:23this in your system. Instead of renting
- 4:19:24the EC2 bus or the EC2 truck, what if
- 4:19:27you just paid a delivery service exactly
- 4:19:29per mile? Well, that is AWS Lambda and
- 4:19:32AWS Fargate. If you have an
- 4:19:34unpredictable, highly variable workload,
- 4:19:36you rip it off EC2. You move the code to
- 4:19:38Lambda. Now you're paying strictly per
- 4:19:40millisecond. If no one uses your app,
- 4:19:42you pay 0. Which means the ultimate
- 4:19:44paradox of cloud computing is this. The
- 4:19:47ultimate compute optimization is not
- 4:19:49having any servers to manage it all. So
- 4:19:51how do you actually decide? Well, if you
- 4:19:53have a strict legacy application that
- 4:19:55needs specific operating system tweaks,
- 4:19:57you put it on EC2. You rightsize the
- 4:19:59instance family and you use aggressive
- 4:20:01autoscaling. If you're building a modern
- 4:20:03containerized microser and you want to
- 4:20:05completely avoid server infrastructure
- 4:20:07management, you go with AWS Fargate. And
- 4:20:10if you have short, unpredictable,
- 4:20:11event-driven tasks, you use AWS Lambda.
- 4:20:14All right, here is the exact trap you
- 4:20:17are going to see on the domain 4 exam.
- 4:20:19The question will describe a cost
- 4:20:20optimization scenario. It goes like
- 4:20:22this. A company has an old legacy
- 4:20:25monolithic application running on EC2.
- 4:20:28The CPU is totally maxed out, but the
- 4:20:30memory is barely touched and the prompt
- 4:20:32will clearly state that the code cannot
- 4:20:34be rewritten or modernized. What do you
- 4:20:36do? One answer is going to suggest
- 4:20:38migrating the app to AWS Lambda to save
- 4:20:41costs. Do not fall for it. You cannot
- 4:20:43magically drop a legacy monolith into
- 4:20:45Lambda. Another answer will suggest
- 4:20:47purchasing a savings plan immediately.
- 4:20:50That is a trap. You are locking in a bad
- 4:20:52architecture. Here is the solution. The
- 4:20:55exact moment you see a mismatch CPU and
- 4:20:57memory bottleneck on an unchangeable
- 4:20:59app, your brain needs to instantly look
- 4:21:01for the answer that suggests changing
- 4:21:03the EC2 instance family to a compute
- 4:21:05optimized size. Remember the golden
- 4:21:07rule, right size first, commit later.
- 4:21:10Let's lock this all in. Right sizing
- 4:21:13matches the exact instance family to
- 4:21:15your application's actual behavior.
- 4:21:17Elasticity uses things like autoscaling
- 4:21:19and hibernation to kill idle compute.
- 4:21:21And serverless tools like Lambda and
- 4:21:23Fargate, well, they eliminate
- 4:21:25infrastructure management entirely and
- 4:21:27charge you strictly for what you use. So
- 4:21:30monitor your metrics to eliminate waste
- 4:21:32before you even think about applying
- 4:21:33discounts. Use autoscaling to
- 4:21:36aggressively shut down unused capacity
- 4:21:38and shift those unpredictable workloads
- 4:21:40directly over to serverless. I'll leave
- 4:21:43you with this final warning. If you
- 4:21:45provision compute based on a guess
- 4:21:47instead of actual data, you are
- 4:21:49literally wasting money. So take a hard
- 4:21:52look at your own architecture today. Ask
- 4:21:55yourself what legacy applications are
- 4:21:57silently draining your budget right now
- 4:21:59and which of these three strategies will
- 4:22:01you use to finally stop the bleeding?
- 4:22:04Imagine you're running a healthcare app.
- 4:22:06By law, you have to keep patient X-rays
- 4:22:08for 7 years. So, you upload millions of
- 4:22:10high-res images to Amazon S3. Everything
- 4:22:13is running perfectly. But then 5 years
- 4:22:16later, you look at your AWS bill and
- 4:22:19your jaw just drops. You are paying
- 4:22:21exactly $50,000 a month just to store
- 4:22:25gigabytes of images that literally no
- 4:22:27one has looked at since 2019. You are
- 4:22:29burning cash on dead data. This is the
- 4:22:33ultimate storage trap. We dump data into
- 4:22:35the cloud and we just forget about it.
- 4:22:37Listen, if you don't aggressively manage
- 4:22:39where that data lives over time, your
- 4:22:41AWS bill is going to spiral completely
- 4:22:44out of control. So, in this explainer,
- 4:22:46let me show you exactly how we stop the
- 4:22:48bleeding using Amazon S3 life cycle
- 4:22:50rules. When you first put a file in S3,
- 4:22:53it goes into the S3 standard storage
- 4:22:55class. It is incredibly fast and it is
- 4:22:58highly available, but it is also the
- 4:23:00most expensive place to put your data.
- 4:23:03Think of S3 Standard like the front rack
- 4:23:05of your closet. When you buy a brand new
- 4:23:07winter coat, you hang it right in the
- 4:23:09front, right? You wear it every single
- 4:23:11day. But what happens when summer hits?
- 4:23:13You don't throw the winter coat away.
- 4:23:14You still need it, but you move it to a
- 4:23:16box in the attic to save that premium
- 4:23:18space. Well, AWS allows you to do the
- 4:23:21exact same thing with your data using
- 4:23:23storage tiers. First up, we have S3,
- 4:23:26Standard Infrequent Access, or just S3IA
- 4:23:29for short. This is the back of your
- 4:23:31closet. S3A costs about half the price
- 4:23:34of S3 standard. It's meant for data you
- 4:23:36rarely use, like last month's database
- 4:23:38backups. But here is the massive
- 4:23:41trade-off. AWS charges you a data
- 4:23:44retrieval fee every single time you open
- 4:23:47a file in IIA. Think about that for a
- 4:23:49second. If you move heavily accessed
- 4:23:52website images into infrequent access
- 4:23:54just to save on storage space, those
- 4:23:56retrieval fees will absolutely explode.
- 4:23:59Your bill will actually go up. When you
- 4:24:01look at it this way, the core strategy
- 4:24:03really clicks into place. Oh, now I get
- 4:24:06it. I am trading storage costs for
- 4:24:09access costs. Next, we have Amazon S3
- 4:24:13Glacier. Glacier is the attic. It offers
- 4:24:16a massive 90% discount on storage costs
- 4:24:19compared to standard. It is dirt cheap.
- 4:24:22Why? Because it is strictly for
- 4:24:24long-term archiving. If you want to file
- 4:24:26back from Glacier, you do not get it
- 4:24:28instantly. You actually have to request
- 4:24:30it. And AWS might take minutes or even
- 4:24:33hours to retrieve it for you. No. Here's
- 4:24:35where people completely fail this. They
- 4:24:38try to move files between these tiers
- 4:24:40manually. If you have 5 pabytes of user
- 4:24:43uploads, you cannot hire an intern to
- 4:24:45click move to Glacier every time a file
- 4:24:47gets old. You need a robot to do it for
- 4:24:50you. And that is exactly what a life
- 4:24:52cycle rule is. A life cycle rule is just
- 4:24:56a simple automated schedule that acts as
- 4:24:58your dedicated storage robot. You just
- 4:25:00tell AWS, hey, keep user uploads in
- 4:25:03standard for 30 days. Then automatically
- 4:25:07transition them to infrequent access.
- 4:25:09After one year, transition them to
- 4:25:11Glacier and after seven years,
- 4:25:13permanently delete them. Once you set
- 4:25:14that rule, you just walk away. AWS
- 4:25:17executes it perfectly forever and your
- 4:25:20storage costs instantly plummet. Now,
- 4:25:23here is the part that actually matters
- 4:25:24for your AWS exam and your real world
- 4:25:26architecture. What if you have
- 4:25:28absolutely no idea what your access
- 4:25:30patterns are? I mean, what if a file is
- 4:25:33dead for a whole year and then a random
- 4:25:34user goes viral and suddenly that file
- 4:25:36is downloaded a million times in one
- 4:25:38day? If that file was sitting in
- 4:25:40infrequent access, those retrieval fees
- 4:25:42would bankrupt you. If it was in
- 4:25:44Glacier, the app would literally crash
- 4:25:45waiting for the file to thaw. So, how do
- 4:25:49we solve unpredictable traffic? We use
- 4:25:52S3 intelligent tiering. Intelligent
- 4:25:54taring uses machine learning to monitor
- 4:25:56your files. If nobody touches a file for
- 4:25:5830 days, AWS automatically moves it to
- 4:26:01the cheaper tier. And the absolute best
- 4:26:03part, zero retrieval fees. But the split
- 4:26:06second a user requests that file, AWS
- 4:26:08instantly bumps it back to the standard
- 4:26:10tier so you don't get penalized. So here
- 4:26:12is your golden rule of thumb to
- 4:26:14remember. Oh, now I get it. Life cycle
- 4:26:17rules are for predictable aging.
- 4:26:19Intelligent taring is for unpredictable
- 4:26:21chaos. Here is the exact trap you're
- 4:26:24going to see on the exam. The scenario
- 4:26:26will describe a company storing massive
- 4:26:28amounts of data. The prompt will
- 4:26:30explicitly state that the engineering
- 4:26:31team has unknown or unpredictable access
- 4:26:34patterns, but they still want to
- 4:26:36optimize costs. One of the multiple
- 4:26:38choice answers will suggest creating a
- 4:26:40life cycle rule to move data to
- 4:26:42infrequent access after 30 days. Do not
- 4:26:45fall for it. You cannot write a static
- 4:26:47rule for unpredictable data. The moment
- 4:26:49you see the words unpredictable access,
- 4:26:52changing access patterns, or unknown
- 4:26:54traffic, your brain needs to immediately
- 4:26:56lock on to S3 intelligent tearing. All
- 4:26:59right, let's lock this in. S3 standard
- 4:27:02is for hot daily data. Infrequent access
- 4:27:05cuts storage cost in half, but penalizes
- 4:27:07you with retrieval fees. Glacier is for
- 4:27:10deep archiving, where retrieval time
- 4:27:12doesn't matter. Life cycle rules
- 4:27:14automate the movement of data between
- 4:27:16these tiers as it ages. You have to
- 4:27:18match your storage tier to your actual
- 4:27:20access frequency. So use standard life
- 4:27:22cycle rules when your data ages
- 4:27:24predictably. Use intelligent tiering
- 4:27:26when your data access patterns are a
- 4:27:28complete mystery. And here is my final
- 4:27:30warning. If you put heavily access data
- 4:27:32into infrequent access, your AWS bill
- 4:27:34will punish you. Stop paying for
- 4:27:36sleeping data. Automate your tears and
- 4:27:38keep building. Which kind of makes you
- 4:27:40wonder if you checked your own AWS
- 4:27:41environment right now, how much dead
- 4:27:43data is secretly draining your budget
- 4:27:45today. Welcome back to the explainer.
- 4:27:47Today we're diving straight into
- 4:27:48elasticity and the art of financial
- 4:27:51survival in AWS.
- 4:27:53Imagine you throw a massive launch party
- 4:27:55for your app. You go ahead and rent a
- 4:27:57100 servers just to handle all that
- 4:28:00incoming traffic. And guess what? The
- 4:28:03launch is a huge hit. But the next
- 4:28:06morning, the users are gone. and 99
- 4:28:09servers are still running, charging you
- 4:28:11by the hour while you just stare at a
- 4:28:13zero traffic dashboard. Here's our road
- 4:28:16map for today. We're going to cover the
- 4:28:18idle server trap, mastering cloud
- 4:28:20elasticity, the scalein failure, the EC2
- 4:28:23hibernation strategy, avoiding the exam
- 4:28:26trap, and finally locking in your
- 4:28:28knowledge. Section one, the idle server
- 4:28:31trap. Listen, if you kept all those
- 4:28:33servers running, you would be bankrupt
- 4:28:35by noon. In cloud computing, if you
- 4:28:38don't master autoscaling for cost
- 4:28:39control, you will literally burn
- 4:28:41thousands of dollars on idle servers
- 4:28:43because the cloud isn't just about
- 4:28:45paying for what you use. It is about
- 4:28:46automatically turning off what you stop
- 4:28:48using. Section two, mastering cloud
- 4:28:51elasticity.
- 4:28:53AWS gives us two main scaling methods
- 4:28:55for elastic workloads, vertical and
- 4:28:58horizontal. Think of it like this.
- 4:29:00Vertical scaling is like upgrading your
- 4:29:02car's engine. You're just making one
- 4:29:04single server bigger. Horizontal scaling
- 4:29:07on the other hand is like adding a fleet
- 4:29:08of identical cars to carry more
- 4:29:10passengers. And AWS autoscaling that is
- 4:29:13purely horizontal. It acts kind of like
- 4:29:16an automated thermostat for your compute
- 4:29:18power. When your app gets hot and
- 4:29:20traffic spikes, the thermostat kicks in
- 4:29:22and automatically spins up new servers.
- 4:29:24This is what we call scaling out. Then
- 4:29:27when the traffic cools down at night,
- 4:29:29the thermostat shuts those extra servers
- 4:29:31off. And this is called scaling in.
- 4:29:33Think about that for a second. If you
- 4:29:35only add servers when things get busy,
- 4:29:37but you never actually delete them when
- 4:29:39things slow down, you aren't elastic.
- 4:29:42You are just expensive.
- 4:29:44All right, now I get it. Autoscaling
- 4:29:47isn't just a performance tool. It is
- 4:29:49absolutely a financial survival tool.
- 4:29:52Section three, the scale-in failure.
- 4:29:55Now, here is where people completely
- 4:29:57fail this. They set up an autoscaling
- 4:30:00group. They configure the scale out
- 4:30:01alarm and then they just walk away. Two
- 4:30:04weeks later, their AWS bill totally
- 4:30:06explodes. Why? Because they forgot to
- 4:30:09configure the scalein policy. Your cloud
- 4:30:12must be allowed to shrink. Section four,
- 4:30:15EC2 hibernation strategy. Now, here's a
- 4:30:17part that really matters. What if your
- 4:30:19application is a massive legacy system?
- 4:30:22What if it takes 10 minutes just to boot
- 4:30:24up, load the caches, and get ready?
- 4:30:26Well, if a server takes 10 minutes to
- 4:30:28start, horizontal autoscaling is just
- 4:30:30too slow. But you still don't want to
- 4:30:32pay for it while it sits idle overnight.
- 4:30:34Luckily, AWS gives us a brilliant
- 4:30:37scaling strategy for this called EC2
- 4:30:39hibernation. With hibernation, it's
- 4:30:41literally like closing your laptop lid.
- 4:30:44AWS saves the exact contents of your RAM
- 4:30:46directly to your hard drive and stops
- 4:30:48the instance. Because of this, you
- 4:30:50immediately stop paying the hourly
- 4:30:51compute charge, and when traffic
- 4:30:53returns, you wake it up and it springs
- 4:30:55back to life instantly, exactly where it
- 4:30:57left off. That makes perfect sense,
- 4:30:59right? You don't just optimize by
- 4:31:00completely destroying servers. You
- 4:31:02optimize by pausing them the split
- 4:31:04second they aren't needed. Section five,
- 4:31:07avoiding the exam trap. This brings us
- 4:31:10to the exact trap you're going to see on
- 4:31:12the AWS solutions architect exam. The
- 4:31:16scenario will ask you to design a cost
- 4:31:18optimized compute solution for an
- 4:31:20elastic workload. It'll describe a
- 4:31:22company with unpredictable traffic that
- 4:31:24jumps randomly during the day and then
- 4:31:26drops to near zero at night. One of the
- 4:31:29multiple choice answers is going to
- 4:31:30suggest you use an AWS purchasing option
- 4:31:32like a reserved instance or a savings
- 4:31:35plan. This is a trap. You do not buy a
- 4:31:38permanent discount on servers you don't
- 4:31:40even need at night. You are just locking
- 4:31:41in waste and you definitely do not buy a
- 4:31:43discount on waste. Now, another answer
- 4:31:46will say configure an autoscaling group
- 4:31:48to dynamically scale in and out. That
- 4:31:51right there is your golden ticket. The
- 4:31:54moment you see elastic workloads
- 4:31:55combined with cost optimization, your
- 4:31:57brain needs to instantly lock onto
- 4:31:59horizontal autoscaling and scalein
- 4:32:01policies. Section six, lock in your
- 4:32:04knowledge. Let's lock this in.
- 4:32:05Autoscaling matches your exact compute
- 4:32:07capacity to your exact traffic demand.
- 4:32:10Scaling out saves your performance while
- 4:32:12scaling in saves your wallet. And
- 4:32:14hibernation pauses those slow booting
- 4:32:17instances so you don't pay for idle
- 4:32:18time. Remember these rules. First,
- 4:32:21always configure scale-in policies to
- 4:32:23terminate idle servers. Second, use EC2
- 4:32:27hibernation for slow booting legacy apps
- 4:32:29instead of paying for idle time. And
- 4:32:31third, never buy long-term server
- 4:32:33commitments for highly unpredictable
- 4:32:35spiky workloads. Final warning here. If
- 4:32:38you provision your cloud compute based
- 4:32:40on a guess instead of using dynamic
- 4:32:42autoscaling, you are basically throwing
- 4:32:44money into a fire. Master elasticity and
- 4:32:47keep building. But ask yourself this, if
- 4:32:50you checked your own AWS dashboard right
- 4:32:52now, how many idle servers are silently
- 4:32:54draining your budget
About this transcript
This page contains the full transcript of Pass AWS Solutions Architect in 4 Hours (Full Course SAA-C03) by Cram Exam, generated from the public captions YouTube serves with the video. The transcript has 49,146 words across 7,478 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to choose a caption track available on the video.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, caption language selection, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.