YouTube2Text

Pass AWS Solutions Architect in 4 Hours (Full Course SAA-C03) — Transcript

by Cram Exam · 49,146 words · 7,478 segments · language en · Watch on YouTube

Full transcript

  1. 0:00All right, let's talk about something
  2. 0:01that is no joke one of the most critical
  3. 0:04concepts in all of AWS. The shared
  4. 0:06responsibility model. If you want to
  5. 0:09build secure, reliable systems in the
  6. 0:10cloud, you absolutely have to get this
  7. 0:12right. So, let's dive in. So, picture
  8. 0:15this. You get that call you never want
  9. 0:17to get. It's 3:00 in the morning. Your
  10. 0:19company's main app running on AWS has
  11. 0:22just been breached. Sensitive customer
  12. 0:24data is everywhere. It's a total
  13. 0:26nightmare. So after the initial panic,
  14. 0:28you're left with this one burning
  15. 0:30question. Who's responsible here? Was it
  16. 0:33an AWS failure or was it our fault? The
  17. 0:36answer to that question is all about
  18. 0:38understanding this shared responsibility
  19. 0:40model. Okay, so how do we make sense of
  20. 0:43this? Well, the best way I found is to
  21. 0:45use a really simple analogy. Just think
  22. 0:47of AWS as your landlord and you as the
  23. 0:50tenant. Trust me, this is going to make
  24. 0:52everything click. It's actually super
  25. 0:54simple when you think about it. AWS,
  26. 0:57they're the landlord. They're
  27. 0:59responsible for the security of the
  28. 1:00entire apartment building. You know, the
  29. 1:03main entrance, the security guards, the
  30. 1:05foundation, making sure the building
  31. 1:06itself is safe. You, you're the tenant.
  32. 1:10Your job is security inside your
  33. 1:12apartment. You're the one who has to
  34. 1:14lock your front door, decide who gets a
  35. 1:16copy of your key, and keep your
  36. 1:17valuables safe. And that right there is
  37. 1:20the shared responsibility model in a
  38. 1:22nutshell. It's basically the rental
  39. 1:24agreement between you and AWS. It's a
  40. 1:27framework that draws a very clear line
  41. 1:29in the sand defining exactly what
  42. 1:31they're responsible for securing and
  43. 1:33what you are responsible for securing.
  44. 1:35So let's really nail down these two
  45. 1:37sides of the deal. AWS is responsible
  46. 1:40for security of the cloud. That means
  47. 1:42the physical stuff, their massive data
  48. 1:43centers, the actual servers, the global
  49. 1:45network cables, even the software that
  50. 1:47makes virtualization possible. Now you
  51. 1:49you're responsible for security in the
  52. 1:51cloud. This is all about your stuff,
  53. 1:53your data, your apps, and deciding who
  54. 1:55has permission to touch any of it. Okay,
  55. 1:58this is where it gets really
  56. 1:59interesting, and it's where a lot of
  57. 2:01people get tripped up. The amount of
  58. 2:03responsibility you have actually changes
  59. 2:05depending on which AWS service you use.
  60. 2:08Let's break that down. Let's start with
  61. 2:10EC2. Think of this as renting a totally
  62. 2:13empty, unfernished apartment. AWS gives
  63. 2:16you a secure space, but what you do
  64. 2:17inside is on you. You've got to patch
  65. 2:19the operating system, Windows, Linux,
  66. 2:22whatever you install. You have to
  67. 2:23configure the firewalls, what AWS calls
  68. 2:25security groups. You manage all the
  69. 2:27users. You encrypt your own data. You
  70. 2:29install your apps. You have all the
  71. 2:31control, which you guessed it, means you
  72. 2:33have all the responsibility. Okay. Now,
  73. 2:35what about something like RDS, the
  74. 2:37database service? This is more like
  75. 2:39renting a furnish department. The
  76. 2:42landlord, AWS, handles a bunch of the
  77. 2:44annoying stuff for you. They manage the
  78. 2:46hardware. They patch the operating
  79. 2:47system underneath and they even keep the
  80. 2:49database software up to date. That's a
  81. 2:51huge weight off your shoulders, but
  82. 2:53you're still responsible for your own
  83. 2:55things. You still have to control who
  84. 2:56can access the database. You still have
  85. 2:58to encrypt your sensitive data, and you
  86. 3:00still have to set up the network rules.
  87. 3:01And finally, we've got S3, the storage
  88. 3:04service. This isn't even an apartment
  89. 3:06anymore. It's like a super secure bank
  90. 3:08vault or storage locker. AWS manages
  91. 3:10pretty much everything. The hardware,
  92. 3:12the security of the facility, making
  93. 3:14sure your data is replicated and safe.
  94. 3:16It's incredibly robust. Your job is
  95. 3:18simple, but it is everything. You
  96. 3:21control the key. You decide who gets in
  97. 3:23by configuring your bucket policies and
  98. 3:25AM permissions. All right, enough with
  99. 3:27the theory. Let's put this to the test
  100. 3:29with a realworld scenario, something
  101. 3:31that happens all the time. So, here's
  102. 3:33the situation. An S3 bucket loaded with
  103. 3:36sensitive customer files was left wide
  104. 3:38open to the public. Someone found it.
  105. 3:40So, who's on the hook for this? Is it
  106. 3:42AWS's fault or the customers? And the
  107. 3:45answer, without a doubt, is the
  108. 3:47customer. Look, AWS did its job. The S3
  109. 3:50service itself, the storage facility,
  110. 3:52was rock solid. It wasn't breached. The
  111. 3:54customer, on the other hand, messed up
  112. 3:56their part of the deal. They failed that
  113. 3:58security in the cloud by misconfiguring
  114. 4:00the bucket policy. They basically left
  115. 4:02the door to their secure locker wide
  116. 4:04open with a sign on it saying, "Come on
  117. 4:06in." Okay, now that you've got the
  118. 4:07concept, let's just lay out the
  119. 4:09non-negotiable rules. These are the
  120. 4:11things that are always true no matter
  121. 4:12what service you're using. So on the AWS
  122. 4:15side of the table, they're always going
  123. 4:17to handle the physical world, the data
  124. 4:19centers, the hardware, the networking
  125. 4:20that connects everything. On your side,
  126. 4:22you are always responsible for your
  127. 4:24data. That means encrypting it. And you
  128. 4:26are always responsible for identity and
  129. 4:28access management. That's AM, which is
  130. 4:30just a fancy way of saying you control
  131. 4:32who can do what. You are the ultimate
  132. 4:34guardian of your data. All right, listen
  133. 4:36up because this is the classic trap, the
  134. 4:39number one thing people get wrong. AWS
  135. 4:42patches the layer under your EC2
  136. 4:44instance, the virtualization software,
  137. 4:46but they will never ever log into your
  138. 4:49virtual server. That means patching the
  139. 4:51guest OS, your Windows server, your
  140. 4:53Obunts and Linux. That is 100% on you.
  141. 4:57Always. Okay, let's bring it all home
  142. 4:59with a super quick handshake on what we
  143. 5:01learned. This is the stuff to lock in.
  144. 5:04Just remember this. AWS is the landlord.
  145. 5:07You're the tenant. They secure the
  146. 5:09building. You secure your apartment. AWS
  147. 5:12handles security of the cloud. You
  148. 5:14handle security in the cloud. Your slice
  149. 5:16of the responsibility pie changes
  150. 5:18depending on what you're renting, a
  151. 5:19barebones EC2 apartment or a fully
  152. 5:21managed S3 vault. But no matter what,
  153. 5:24you always, always control your data and
  154. 5:26who gets access to it. See, this isn't
  155. 5:29just some abstract concept. It's a
  156. 5:31partnership, a handshake. The only way
  157. 5:33cloud security truly works is if both
  158. 5:36sides do their part. So, I'll leave you
  159. 5:38with this. Knowing the rules of the
  160. 5:39game, how are you going to build your
  161. 5:41next system to make sure both you and
  162. 5:43AWS are holding up your end of the deal?
  163. 5:46All right, let's jump right in. We're
  164. 5:47talking about something that is no joke
  165. 5:49one of the most fundamental pieces of
  166. 5:51AWS identity and access management. You
  167. 5:53know it as AM. And look, this isn't just
  168. 5:56important. Getting this stuff right is
  169. 5:57literally the difference between having
  170. 5:59a secure cloud and well, a complete
  171. 6:01disaster just waiting to happen. And you
  172. 6:03know, it really all comes down to one
  173. 6:05big question. Imagine you've built this
  174. 6:07incredible kingdom up in the cloud,
  175. 6:08right? It's your business. But now you
  176. 6:11got to let people in and actually do
  177. 6:12their work. You need to let your team
  178. 6:14in. Even your applications need to get
  179. 6:16in. So, how do you hand out the keys
  180. 6:18without just giving away the keys to the
  181. 6:20entire castle? Okay, so to figure that
  182. 6:22out, we have to talk about the very
  183. 6:24first and honestly the biggest danger
  184. 6:27you're going to face. I call it the
  185. 6:29master key problem. See, when you first
  186. 6:31create an AWS account, you get this one
  187. 6:33special user, the root user. And let's
  188. 6:35be super clear, this is not just some
  189. 6:37admin account. It is the account. It can
  190. 6:40do absolutely everything. And I mean
  191. 6:42everything. It can delete your entire
  192. 6:44AWS setup with just a few clicks. So,
  193. 6:46using this thing for your day-to-day
  194. 6:47work, it's probably the single biggest
  195. 6:49security mistake you could ever make.
  196. 6:50So, what do you do? You lock it away.
  197. 6:52You slap multiffactor authentication on
  198. 6:54it, and you basically promise to never
  199. 6:55ever touch it again. Okay, so if the
  200. 6:58master key is totally off limits, what's
  201. 7:00the plan? Well, simple. We make copies
  202. 7:02of the key, but limited ones. And that's
  203. 7:05exactly what an IM user is. It's just a
  204. 7:07unique identity for one person, say a
  205. 7:10developer named Sarah, or maybe for a
  206. 7:12single application. This user gets its
  207. 7:14own password to log into the AWS console
  208. 7:17and it also gets a set of access keys
  209. 7:19and these are long-term keys. They don't
  210. 7:20expire unless you go in and change them
  211. 7:22yourself. This is kind of our first most
  212. 7:24basic tool we've got. All right, so
  213. 7:27we're making individual users for
  214. 7:28everyone. Sounds good. Problem solved,
  215. 7:31right? Eh, not so fast. Because the
  216. 7:34minute your team starts to grow, you run
  217. 7:36head first into a whole new problem.
  218. 7:39Just picture this. You've got 10
  219. 7:40developers on your team and they all
  220. 7:42need the exact same permissions to do
  221. 7:44their jobs. So you could one by one go
  222. 7:47into all 10 of their user accounts and
  223. 7:49click click click to attach the same say
  224. 7:5220 permissions. Then what happens when
  225. 7:54developer number 11 joins? Yep. You do
  226. 7:56it all over again. It's super slow. It's
  227. 7:59mind-numbingly repetitive. And worst of
  228. 8:01all, it's just asking for someone to
  229. 8:03make a mistake. It just doesn't scale.
  230. 8:05And this is exactly why AM groups were
  231. 8:08invented. Seriously, a group is nothing
  232. 8:11more than a container for users. That's
  233. 8:13it. You create a developer group. You
  234. 8:15attach all the permissions you need to
  235. 8:17the group and then you just drop your
  236. 8:19users into it. So, when that new
  237. 8:21developer Sarah joins, you just add her
  238. 8:24user to the group and bam, she instantly
  239. 8:26gets all the permissions she needs. It's
  240. 8:28so much more efficient. It's consistent
  241. 8:30and frankly, it keeps you from going
  242. 8:32insane. So, okay, we've got users for
  243. 8:35people and groups to manage them as
  244. 8:37teams. It's a pretty clean system,
  245. 8:39right? But there's a third piece to this
  246. 8:42puzzle. It's way more powerful and
  247. 8:44honestly a lot more interesting. We've
  248. 8:46got to talk about roles. This is where
  249. 8:48our nice little system kind of hits a
  250. 8:50wall. Because what happens when it's not
  251. 8:52a person that needs access, but an AWS
  252. 8:54service itself. Think about it. A
  253. 8:56virtual server, an EC2 instance, isn't a
  254. 8:59person. It can't log in with a password.
  255. 9:01Now, you could create an IM user for the
  256. 9:04server and just store its access keys
  257. 9:05right there on the machine. But that is
  258. 9:07the digital equivalent of leaving your
  259. 9:09house key under the doormat. If that
  260. 9:11server ever gets hacked, the attacker
  261. 9:12grabs those keys and they've got
  262. 9:13everything. That is a huge, huge risk.
  263. 9:16There has to be a better way. And that
  264. 9:18better, smarter way is an IM role. Now,
  265. 9:21here's the absolute key difference you
  266. 9:23have to get. A role isn't tied to one
  267. 9:25specific person or one app. Instead,
  268. 9:27it's a set of permissions that anyone or
  269. 9:29anything you trust, a user, an app,
  270. 9:32another AWS service can assume for a
  271. 9:35little while. The best way to think of
  272. 9:36it is like putting on a special hat to
  273. 9:38do a specific job. You put on your S3
  274. 9:41access hat, you go do your work with S3,
  275. 9:43and when you're done, you take the hat
  276. 9:44off. Those permissions were temporary,
  277. 9:46and AWS handles all the security stuff
  278. 9:48like rotating the keys for you in the
  279. 9:50background. It's genius. You know what?
  280. 9:53Let's make this even simpler with an
  281. 9:54analogy. I promise this will make it all
  282. 9:57click. Just imagine your AWS account is
  283. 10:00a big secure office building. Okay,
  284. 10:02let's break this down. An IM user,
  285. 10:05that's like an employee with their own
  286. 10:06permanent ID badge. It's got their
  287. 10:08picture on it. It's theirs. It lets them
  288. 10:10in the front door every day. An IM
  289. 10:12group, well, that's just the department
  290. 10:14they work in, like marketing or
  291. 10:15engineering. Everyone in that department
  292. 10:17gets access to the same floors. Easy
  293. 10:19enough. But the IM role, that's the
  294. 10:22special one. That's like the temporary
  295. 10:23key card you get from security to go
  296. 10:25into the server room. You don't get to
  297. 10:27keep it. You use it for one specific
  298. 10:28task. You give it back and your access
  299. 10:30is gone. It's temporary. It's for one
  300. 10:32job. And that's what makes it so secure.
  301. 10:35Okay. So, the analogy is great, but
  302. 10:37let's see how this actually plays out in
  303. 10:39a real AWS setup because this pattern
  304. 10:41I'm about to show you is something you
  305. 10:43are going to see everywhere in
  306. 10:45well-designed secure architectures. So,
  307. 10:48here's the classic example. you have an
  308. 10:50EC2 server and it needs to write some
  309. 10:52files to an S3 bucket. The old insecure
  310. 10:54way would be to put an access key on
  311. 10:56that server. But we're not going to do
  312. 10:58that. Instead, we create a role that has
  313. 11:01permission to write to S3. Then we tell
  314. 11:03our EC2 instance, hey, you are allowed
  315. 11:06to assume this role. And here's where
  316. 11:08the magic happens. The EC2 instance
  317. 11:10talks to a service called STS, the
  318. 11:13security token service. And STS gives it
  319. 11:15back a set of temporary credentials. The
  320. 11:18server uses those keys to talk to S3.
  321. 11:20They expire after a short time and
  322. 11:22that's it. What's the big deal here?
  323. 11:24There are no permanent keys stored on
  324. 11:26the server ever. That is a massive
  325. 11:29security win. All right, let's try a
  326. 11:31quick scenario to really hammer this
  327. 11:33home. Imagine you get a phone call. It's
  328. 11:35the one you never ever want to get. One
  329. 11:37of your lead developers laptops was just
  330. 11:39stolen. And on that laptop, sitting in a
  331. 11:41config file is an AWS access key, a
  332. 11:44permanent one. And this key has full
  333. 11:46admin access to your company's
  334. 11:47production database. Yeah, this is a
  335. 11:50full-blown emergency. So, take a second
  336. 11:53and think about that. Who's really to
  337. 11:55blame here? Is it the developer's fault?
  338. 11:57Is it a bad company policy? Or is
  339. 11:59something else fundamentally wrong? The
  340. 12:01real fault? It's the architecture. The
  341. 12:04fundamental mistake was ever allowing a
  342. 12:06permanent long-ived access key to live
  343. 12:08on a developer's machine in the first
  344. 12:09place. That key was a ticking time bomb
  345. 12:12just waiting to go off. The right way to
  346. 12:14do this would be for the developers
  347. 12:15tools to assume a role. That way, they
  348. 12:18only get temporary keys that expire in
  349. 12:20like an hour. So, if the laptop gets
  350. 12:22stolen, who cares? By the time the thief
  351. 12:24opens it, the keys are already useless.
  352. 12:26The risk wasn't the stolen laptop. The
  353. 12:28risk was created the second a permanent
  354. 12:30key was used where a temporary roll
  355. 12:31should have been. Okay, so now that you
  356. 12:34really understand the why behind all
  357. 12:35this, let's boil it all down to the most
  358. 12:37important takeaways and the common traps
  359. 12:40you need to avoid. All right, first the
  360. 12:42big takeaways. Users, one entity,
  361. 12:45long-term keys. Groups, just a way to
  362. 12:47organize users and make your life
  363. 12:49easier. Roles, temporary keys for
  364. 12:52trusted things to do a job. And
  365. 12:54remember, roles are the best and most
  366. 12:56secure way to let AWS services talk to
  367. 12:59each other. And underlying all of this
  368. 13:01is the golden rule, the principle of
  369. 13:03least privilege. Only give the absolute
  370. 13:06minimum permissions needed to get a job
  371. 13:08done, nothing more. And now for the
  372. 13:10traps. Trap number one, and you'll see
  373. 13:12this one everywhere. Somebody puts an IM
  374. 13:14user's access key onto an EC2 instance.
  375. 13:16Just don't do it. A role is pretty much
  376. 13:19always the right answer there. And trap
  377. 13:21number two is getting groups and roles
  378. 13:23mixed up. It's easy to do, but they're
  379. 13:24totally different. Groups organize your
  380. 13:26users. Roles delegate permissions. They
  381. 13:29solve two completely different problems.
  382. 13:31Look, if you forget everything else from
  383. 13:33this, just remember this one thing.
  384. 13:35Users are people, groups are teams, and
  385. 13:39roles are hats. Simple as that. If you
  386. 13:42can just hold on to that idea, you have
  387. 13:43truly mastered the foundation of
  388. 13:45security on AWS. All right, let's talk
  389. 13:48about one of the single most important
  390. 13:49ideas in all of cloud security. It's
  391. 13:52called the principle of least privilege.
  392. 13:54And look, if you get this one thing
  393. 13:56right, you are already miles ahead of
  394. 13:58the game. So, let me ask you a question.
  395. 14:01What do you think is the one single
  396. 14:02mistake behind most of the biggest
  397. 14:04headline grabbing cloud security
  398. 14:06breaches? I'll tell you, it's almost
  399. 14:08never some super complex Mission
  400. 14:09Impossible style hack. The truth, it's
  401. 14:12usually something way simpler. And it
  402. 14:14all comes down to giving someone or
  403. 14:16something way, way too much power. And
  404. 14:19that right there, that's what brings us
  405. 14:21to what I call the golden rule of
  406. 14:23security, the principle of least
  407. 14:25privilege. If you can really master this
  408. 14:27one concept, I promise you, you will
  409. 14:29immediately start building safer,
  410. 14:31stronger, and more resilient systems on
  411. 14:33AWS. So, what is it exactly? Well, it's
  412. 14:36actually a beautifully simple idea. The
  413. 14:39principle of lease privilege just means
  414. 14:40you give any user or any application or
  415. 14:43any service the absolute minimum set of
  416. 14:46permissions it needs to do its job. And
  417. 14:48that's it. Nothing more. Not one single
  418. 14:50extra permission. You can think of it as
  419. 14:52achieving security through precision.
  420. 14:54Now, I know that can sound a little
  421. 14:56abstract, so let's make it super
  422. 14:58concrete with a simple analogy that's
  423. 15:00going to make this whole concept just
  424. 15:01click for you instantly. Let's talk
  425. 15:03about a hotel key card. Okay, picture
  426. 15:05this. You check into a hotel, but
  427. 15:08instead of giving you a key to just your
  428. 15:09room, the person at the front desk hands
  429. 15:11you a master key. This thing opens every
  430. 15:14guest room, the kitchen, the gym, even
  431. 15:16the manager's private office. I mean,
  432. 15:19sure, it's convenient, but just think
  433. 15:20for a second. What happens if you lose
  434. 15:22that key? What if it falls into the
  435. 15:24wrong hands? And this right here
  436. 15:26illustrates the difference perfectly.
  437. 15:28That master key, that's what we call
  438. 15:30maximum privilege. It gives you access
  439. 15:32to literally everything. And one single
  440. 15:35mistake can compromise the entire
  441. 15:37system. But your normal room key, that
  442. 15:39is least privilege. It only grants you
  443. 15:41access to one specific room and only for
  444. 15:43a limited time. If you lose it, yeah,
  445. 15:46it's a pain, but the risk is contained.
  446. 15:48The blast radius is tiny. Okay, great
  447. 15:50analogy, right? But how does this
  448. 15:52actually translate into the real world
  449. 15:54of cloud architecture? Let's take that
  450. 15:56whole hotel keycard idea and map it
  451. 15:59directly to how things work in AWS. It's
  452. 16:01almost a perfect one toone mapping.
  453. 16:03Think of it this way. The hotel itself,
  454. 16:05that's your entire AWS account. The
  455. 16:07individual rooms, those are your AWS
  456. 16:09resources. You know, things like S3
  457. 16:11buckets full of data or your EC2
  458. 16:13servers. The key card itself, the thing
  459. 16:15that grants the access in AWS, we call
  460. 16:17that an AM policy. and the person or
  461. 16:19service holding that key, that's an IM
  462. 16:21role or an IM user. And this is where
  463. 16:24the rubber really meets the road. On the
  464. 16:26left, you've got that master key policy.
  465. 16:29Just look at those asterisks, those wild
  466. 16:31cards. S3/star
  467. 16:34means all possible S3 actions. Read,
  468. 16:36write, delete, everything. Resource star
  469. 16:39means on all of our buckets. Honestly,
  470. 16:42this is terrifyingly dangerous. But look
  471. 16:44at the right. That's our room key
  472. 16:46approach. It allows only one action. get
  473. 16:48object which is just reading an object
  474. 16:50and it only allows it on one specific
  475. 16:52bucket that's secure that's precise that
  476. 16:55is exactly our goal. So now you get the
  477. 16:58technical side of it, but as a solutions
  478. 16:59architect, it's not enough to just know
  479. 17:01the tech. You also have to understand
  480. 17:03responsibilities. So let's walk through
  481. 17:05a really common scenario to see why this
  482. 17:07is so important. So here's the
  483. 17:09situation, and I've seen this happen a
  484. 17:11hundred times. You've got an EC2
  485. 17:13instance, right? A virtual server. It
  486. 17:15needs to do one simple thing, read log
  487. 17:17files from one specific S3 bucket. But a
  488. 17:20developer on your team is in a hurry.
  489. 17:22instead of writing a nice tight specific
  490. 17:24policy, they just grab a pre-made one
  491. 17:26that gives full admin access to all of
  492. 17:28S3. Why? Because it's fast, it works,
  493. 17:30and they move on to the next ticket.
  494. 17:32Okay, so a few weeks go by, that EC2
  495. 17:35instance gets compromised by an
  496. 17:37attacker. And the attacker, seeing this
  497. 17:39gold mine of permissions, uses that EC2
  498. 17:42instances overly powerful access to
  499. 17:44steal sensitive customer data from a
  500. 17:46completely different S3 bucket. A bucket
  501. 17:49that instance should have never been
  502. 17:50able to touch. So the big question is
  503. 17:52who is responsible for this security
  504. 17:54failure? And the answer comes down to
  505. 17:56the AWS shared responsibility model.
  506. 17:59It's really simple. AWS is responsible
  507. 18:01for the security of the cloud. That
  508. 18:03means the physical data centers, the
  509. 18:05hardware, the networking. But you, the
  510. 18:07customer, you are responsible for
  511. 18:09security in the cloud. That means your
  512. 18:11configurations, your data, and your
  513. 18:12access policies. So in this scenario,
  514. 18:14the answer is crystal clear. The
  515. 18:16responsibility is yours. as the
  516. 18:18architect, you failed to enforce the
  517. 18:20principle of least privilege. So, now
  518. 18:22that you really get the core idea and
  519. 18:24just as importantly why it matters so
  520. 18:26much, let's just quickly nail down a few
  521. 18:28key terms you are absolutely going to
  522. 18:30run into. First up, IM roles. These are
  523. 18:34by far the best and most secure way to
  524. 18:36give temporary permissions to AWS
  525. 18:38services like an EC2 instance. Then you
  526. 18:40have IM policies. Those are the actual
  527. 18:43JSON documents that define the
  528. 18:45permissions just like we saw. You can
  529. 18:47also have resource policies which are
  530. 18:48just policies you attach directly to a
  531. 18:50resource itself like an S3 bucket. And
  532. 18:53finally, if you ever need to grant
  533. 18:54access between different AWS accounts,
  534. 18:56the secure way to do that is always with
  535. 18:58roles. All right, let's talk about how
  536. 19:00this idea often shows up on the exam
  537. 19:02because there is a very very common trap
  538. 19:04that a lot of people fall for and I
  539. 19:06don't want you to be one of them. So
  540. 19:08here's the trap they'll set for you.
  541. 19:10They'll give you a scenario and one of
  542. 19:12the multiple choice answers will be to
  543. 19:14use a broad pre-made AWS policy,
  544. 19:17something like Amazon S3 readonly
  545. 19:19access. And it sounds tempting, right? I
  546. 19:22mean, read only sounds pretty safe.
  547. 19:24Wrong. That policy gives read access to
  548. 19:27every single S3 bucket in your account.
  549. 19:30The correct answer, the least privilege
  550. 19:32answer is always the more specific one.
  551. 19:34Creating a custom customer manage policy
  552. 19:36that grants access only to the one
  553. 19:38specific resource that actually needs
  554. 19:40it. All right, let's bring it all home.
  555. 19:43If you forget everything else from this,
  556. 19:45please just remember these three simple
  557. 19:47steps to applying the principle of least
  558. 19:48privilege. Step one, always, always
  559. 19:51start with deny. By default, nobody and
  560. 19:55nothing should have access to anything.
  561. 19:57It's a clean slate. Step two, grant
  562. 20:00specifically from that zero access
  563. 20:02starting point. You explicitly and
  564. 20:04surgically add only the exact
  565. 20:06permissions needed for the job. And step
  566. 20:09three, use roles. Whenever possible,
  567. 20:11attach these policies to roles for your
  568. 20:13AWS services, not to longived static
  569. 20:16user accounts. So now you get it. You
  570. 20:19understand the principle. You know why
  571. 20:21it's so critical, and you know how to
  572. 20:22build with it from day one. But the
  573. 20:24final question is, what about the stuff
  574. 20:26you've already built? How do you go back
  575. 20:28and fix the problems that already exist?
  576. 20:30Well, your next step is to go and look
  577. 20:32into tools like AWS IM Access Analyzer.
  578. 20:35It's designed to do exactly that to help
  579. 20:37you find and get rid of all those
  580. 20:38dangerous master keys that might be
  581. 20:40lurking in your accounts right now.
  582. 20:42Today, we are going to nail one of the
  583. 20:44most important concepts for building
  584. 20:46secure stuff on AWS, cross account
  585. 20:48access. And look, this isn't just about
  586. 20:51passing an exam. This is a skill you're
  587. 20:53going to use all the time in the real
  588. 20:55world. So, let's jump right in. So,
  589. 20:58picture this. Your AWS account is a
  590. 21:00fortress. It's designed to be completely
  591. 21:02locked down, and that's a good thing.
  592. 21:04But what happens when someone else, a
  593. 21:06partner, a contractor, even another team
  594. 21:09in your company needs to get inside to
  595. 21:11do something? You can't just hand over
  596. 21:12your master keys, right? That would be
  597. 21:14an absolute security nightmare. So, how
  598. 21:17do you let them in, but only let them
  599. 21:19see what they need to see? Here's how
  600. 21:21we're going to tackle this. First, we'll
  601. 21:22look at the actual problem. Then we'll
  602. 21:24build the solution step by step. I've
  603. 21:26got a really simple analogy that's going
  604. 21:28to make it all click. Then we'll use it
  605. 21:29in a real scenario. And finally, we'll
  606. 21:32wrap up with what you really need to
  607. 21:33know. Let's do it. So to really get the
  608. 21:36solution, you've got to understand the
  609. 21:38problem it's solving. And it all starts
  610. 21:40with this idea of every AWS account
  611. 21:42being its own little walled garden. By
  612. 21:45default, your AWS account is totally
  613. 21:48isolated. Nothing gets in, nothing gets
  614. 21:50out. And you need to remember this is a
  615. 21:52feature, not a bug. It's great for
  616. 21:54security. It keeps your billing
  617. 21:56separate, but it also creates our big
  618. 21:58challenge. How do we work with others
  619. 22:00across these walls? So the answer is the
  620. 22:03secure controlled process. You can think
  621. 22:06of it like a digital handshake between
  622. 22:08two accounts. And to get how it works,
  623. 22:10we just need to understand the three
  624. 22:12pieces that make it happen. Let's break
  625. 22:14them down. Okay, first piece, the AM
  626. 22:17role. Now, this is crucial. A role is
  627. 22:20not a user. A user has permanent keys
  628. 22:22like a password. A role is well, it's
  629. 22:25more like a special ID badge or maybe a
  630. 22:28hat someone can borrow. It's just a set
  631. 22:30of permissions that someone you trust
  632. 22:32can temporarily wear to get a job done.
  633. 22:35So, if the role is the ID badge, then
  634. 22:37the trust policy, that's the bouncer at
  635. 22:39the door. Its only job is to check the
  636. 22:41ID of whoever is trying to get the
  637. 22:43badge. It asks one simple question. Are
  638. 22:45you on the list? Do I trust the account
  639. 22:47you're coming from? If the answer is no,
  640. 22:49you're not getting in. Simple as that.
  641. 22:51It's your first line of defense. Okay,
  642. 22:54so the bouncer lets you in and you've
  643. 22:56got the badge. Now what? What can you
  644. 22:58actually do? Well, that's where the
  645. 23:00permissions policy comes in. This is the
  646. 23:03rule book that's basically stapled to
  647. 23:04the ID badge. It lists out very clearly
  648. 23:07every single thing you're allowed to do.
  649. 23:10Things like readonly access to this one
  650. 23:12S3 bucket. This is how we make sure
  651. 23:15nobody gets more power than they
  652. 23:17absolutely need. Let's watch the
  653. 23:19handshake happen. Step one, a user over
  654. 23:21in account A needs to do something in
  655. 23:23account B. So, they make a call to a
  656. 23:25service called AWS STS, the security
  657. 23:28token service. Think of STS as the
  658. 23:30office that issues all the temporary ID
  659. 23:32badges. Step two, STS goes over to
  660. 23:35account B, finds the role, and checks
  661. 23:37the trust policy. It talks to the
  662. 23:38bouncer. It asks, "Hey, do you trust
  663. 23:40account A?" If the bouncer says yes,
  664. 23:42we're on to step three. STS creates a
  665. 23:44brand new set of temporary keys and
  666. 23:46sends them back to the user. Finally,
  667. 23:48step four, the user in account A uses
  668. 23:50those temporary keys to do their work in
  669. 23:52account B. But, and this is key, they
  670. 23:54can only do what the permissions policy
  671. 23:56rulebook allows. Okay, I know that was a
  672. 23:58bit technical. So, let's use a super
  673. 24:00simple analogy that will make this whole
  674. 24:02thing stick in your head for good. Think
  675. 24:04about your car key, your main key.
  676. 24:06That's like your permanent AM user. It
  677. 24:08does everything, right? starts the car,
  678. 24:10opens the trunk, gets in the glove box,
  679. 24:12it's yours, and it works forever. But
  680. 24:14you'd never hand that key to a valet,
  681. 24:16would you? No way. You give them the
  682. 24:19valet key. And that is the assumed role.
  683. 24:22It has super limited powers. It can
  684. 24:23maybe only start the car and lock the
  685. 24:25doors. It's temporary. It expires. And
  686. 24:27the trust you're giving is very specific
  687. 24:29and very limited. It's the perfect way
  688. 24:31to think about temporary limited access.
  689. 24:33All right, you get the pieces. You get
  690. 24:35the analogy. Now, let's put it into a
  691. 24:37realworld scenario to see how you'd
  692. 24:39actually think like an architect. So,
  693. 24:42here's the situation. An outside
  694. 24:44auditing company working from their own
  695. 24:46AWS account needs to read your log files
  696. 24:50which are sitting in an S3 bucket in
  697. 24:51your account. To make this happen,
  698. 24:53somebody has to create the AM role, the
  699. 24:56trust policy, and the permissions
  700. 24:58policy. So, who does it? Do you do it in
  701. 25:00your account or do they do it in theirs?
  702. 25:02The answer is always always always the
  703. 25:06account that owns the resources is
  704. 25:08responsible. Your logs are in your
  705. 25:10account, account A. So you create the AM
  706. 25:13role. You write the trust policy that
  707. 25:15says I trust account B and you attach
  708. 25:18the permissions policy that says allow
  709. 25:20read only on this specific bucket. You
  710. 25:23control your kingdom. You are granting
  711. 25:24the access. They're just assuming the
  712. 25:26role you made for them. So now you
  713. 25:29really get it. you understand how it
  714. 25:30works and more importantly why it works
  715. 25:32that way. With that solid foundation,
  716. 25:34let's just quickly boil it down to the
  717. 25:36key facts and common traps. Let's lock
  718. 25:39these in. One, roles are for temporary
  719. 25:41access. Two, the trust policy is all
  720. 25:44about who? Three, the permissions policy
  721. 25:46is all about what? Four, STS is the
  722. 25:49service that makes the magic happen and
  723. 25:51hands out the temp keys. And five, the
  724. 25:53big one for architects, the role is
  725. 25:55always created in the account that owns
  726. 25:57the stuff. Now, here is the number one
  727. 26:00way people get tripped up. They'll give
  728. 26:02you a scenario and tempt you to create
  729. 26:03an AM user for an outside person. Don't
  730. 26:07do it. Users have permanent keys. They
  731. 26:09belong inside your account. The second
  732. 26:12you read a question that talks about
  733. 26:13giving access to another AWS account, a
  734. 26:16light bulb should go off in your head.
  735. 26:18The answer is AM roll. It's the right
  736. 26:20tool for that job every single time. So,
  737. 26:23let's just say it one more time. Nice
  738. 26:24and simple. You need to give another
  739. 26:26account access. Okay, in your account,
  740. 26:28you create a role. You set the trust
  741. 26:30policy to point to them. You attach a
  742. 26:32permissions policy with the rules.
  743. 26:34That's it. You're done. You now have a
  744. 26:37rockolid understanding of a core AWS
  745. 26:40security concept. This opens up all
  746. 26:42kinds of cool architectures. Centralized
  747. 26:44logging, security tool, accounts, you
  748. 26:46name it. So, my question to you is, what
  749. 26:49are you going to build with this? All
  750. 26:50right, let's dive into one of the most
  751. 26:53powerful and honestly one of the most
  752. 26:55misunderstood tools in all of AWS. We're
  753. 26:58going to talk about how you govern a
  754. 27:00massive cloud environment without
  755. 27:01completely losing your mind. So, just
  756. 27:04picture this for a second. Your
  757. 27:06company's taking off. You've got an AWS
  758. 27:08account for the dev team, one for QA,
  759. 27:11you've got separate accounts for every
  760. 27:12single production app. It's starting to
  761. 27:14get messy, right? How in the world do
  762. 27:17you enforce one simple security role
  763. 27:19across all of them at the same time?
  764. 27:21Because let's be real, without that
  765. 27:23central control, this is what happens.
  766. 27:26Some team accidentally spins up a
  767. 27:28ridiculously expensive server. Another
  768. 27:30team makes an S3 bucket public without
  769. 27:32realizing it. And boom, suddenly you're
  770. 27:34dealing with security holes, shocking
  771. 27:35bills, and a massive compliance
  772. 27:37headache. This right here, this is what
  773. 27:40we call the multi-account problem. And
  774. 27:42it is a very very real challenge for any
  775. 27:45company that's scaling on AWS. But
  776. 27:47luckily AWS has an incredible solution
  777. 27:50for it. And that solution is AWS
  778. 27:53organizations. You can think of it as
  779. 27:55the master control panel for your entire
  780. 27:57AWS universe. It's a service built
  781. 28:00specifically for this one job, central
  782. 28:03governance. And the beauty of it is that
  783. 28:05it really breaks down into three simple
  784. 28:07ideas. First off, you get one single
  785. 28:10bill for all your accounts. Awesome.
  786. 28:12Second, you can group your accounts
  787. 28:13together in a way that makes sense. And
  788. 28:15third, and this is the real gamecher,
  789. 28:18you can apply central policies to those
  790. 28:20groups. Okay, so let's get into the nuts
  791. 28:23and bolts of how that grouping and
  792. 28:24policy stuff actually works. There are
  793. 28:27really two key pieces you need to
  794. 28:29understand. First up, we have
  795. 28:31organizational units or OUS. And
  796. 28:33honestly, the easiest way to think about
  797. 28:35these is just folders. That's it. You
  798. 28:37make a developers folder and you drag
  799. 28:39all your developer accounts into it. You
  800. 28:41make a production folder for your
  801. 28:42critical apps. Super simple, right? Now,
  802. 28:45what good are folders if you can't set
  803. 28:47rules for them? That's where service
  804. 28:49control policies or SCPs come into play.
  805. 28:52An SCP is like a set of rules you staple
  806. 28:55onto one of those folders. And it
  807. 28:57defines the absolute maximum permissions
  808. 28:59that anyone or anything in any of those
  809. 29:02accounts is allowed to have. This right
  810. 29:04here, this is the single most important
  811. 29:07idea you need to get. SCPs are not
  812. 29:09permissions. They are guard rails. They
  813. 29:12don't have a gas pedal. They don't steer
  814. 29:13the car. All they do is put up a wall to
  815. 29:16stop you from driving off a cliff. So,
  816. 29:18let's put these side by side cuz this is
  817. 29:20where people get tripped up. An IM
  818. 29:22policy, that's a permission. It's
  819. 29:24attached to a user and it says you can
  820. 29:26launch an EC2 instance. That's the gas
  821. 29:28pedal. An SCP, on the other hand, is a
  822. 29:30guardrail. It's attached to the OU and
  823. 29:33it says nobody in this entire group is
  824. 29:35ever allowed to do anything outside of
  825. 29:37the Ireland region. The IM policy lets
  826. 29:40you go. The SCP defines the road. I am
  827. 29:43going to say this one more time just to
  828. 29:46really hammer it home. SCPs
  829. 29:50do not grant permissions ever.
  830. 29:54All they do is define what's possible. A
  831. 29:58user still needs their own AM policy to
  832. 30:01actually do anything. Okay, enough
  833. 30:04theory. How does this actually play out
  834. 30:06in the real world with services we use
  835. 30:08everyday? Let's take a look. So, let's
  836. 30:10say you want to control costs. You could
  837. 30:13slap an SCP on your developer OU that
  838. 30:15says, "Hey, nobody in here can launch
  839. 30:18those crazy expensive bare metal
  840. 30:19instances." That's it. You've just
  841. 30:21prevented a massive accidental bill. Or
  842. 30:24maybe for compliance, you say you can
  843. 30:26only launch EC2 instances in the EU
  844. 30:29West1 region. Done. Or think about
  845. 30:31security with S3. This is huge. You can
  846. 30:35create a master rule for your entire
  847. 30:37organization that just says no S3 bucket
  848. 30:40can ever be made public. Period. I mean,
  849. 30:42think about how powerful that is. It
  850. 30:45doesn't matter what IM permissions a
  851. 30:46user has. The guardrail just says no.
  852. 30:49Okay, so let's put your understanding to
  853. 30:51the test. Here's a classic scenario that
  854. 30:53really shows how these two things work
  855. 30:54together. So you've got a senior
  856. 30:57developer. You give them an AM policy
  857. 30:59with allow star. Basically full admin
  858. 31:02rights. They can do anything they want.
  859. 31:04But the OU their account lives in has an
  860. 31:07SCP attached that explicitly says deny
  861. 31:10S3 star. So the question is can that all
  862. 31:13powerful developer do anything in S3?
  863. 31:16The answer is a big fat no. Not a
  864. 31:20chance. And here's the simple reason
  865. 31:22why. In the world of AWS permissions, an
  866. 31:26explicit deny is the ultimate trump
  867. 31:28card. It always always wins. So when AWS
  868. 31:32calculates the final permissions, it
  869. 31:34looks at the IM policy that says allow
  870. 31:36and the SCP that says deny. And the deny
  871. 31:39wins every time. The powerful engine in
  872. 31:42the car doesn't matter if the guardrail
  873. 31:44is blocking the road. Okay, let's boil
  874. 31:46all of this down into the absolute must
  875. 31:49know facts. If you're going to remember
  876. 31:51anything from this, make it these
  877. 31:53points. First, AWS organizations is your
  878. 31:56central control tower. Second, SCPs are
  879. 31:59just guardrails. They never ever grant
  880. 32:02permissions. Third, and this one trips
  881. 32:04people up, they apply to everyone in an
  882. 32:07account, even the root user. Fourth, an
  883. 32:09explicit deny is king. It always wins.
  884. 32:12And finally, just know that by default,
  885. 32:14everything is allowed. You have to be
  886. 32:16proactive and add these restrictive
  887. 32:18guardrails yourself. And here it is.
  888. 32:21This is the number one trap people fall
  889. 32:22into. They see an SCP with an allow
  890. 32:25statement and their brain automatically
  891. 32:27thinks, "Oh, okay. It's granting
  892. 32:29permission." It's not. All it's doing is
  893. 32:32saying the guard rail on this side of
  894. 32:34the road is open. You still need that
  895. 32:36separate amic, the car's engine to
  896. 32:38actually move forward. All right, let's
  897. 32:41do a super quick recap. The problem,
  898. 32:43managing tons of accounts is total
  899. 32:45chaos. The solution, AWS organizations
  900. 32:48to bring it all under one roof. Your
  901. 32:50tools, OUS to act like folders and SCPs
  902. 32:53to set the rules for those folders. And
  903. 32:55the golden rule, SCPs are just guard
  904. 32:57rails, not permissions. And a deny will
  905. 32:59always win. So that leaves us with one
  906. 33:02final thought. Now that you understand
  907. 33:05how to build these incredibly powerful,
  908. 33:07unbreakable guard rails across your
  909. 33:09entire cloud, what's the very first rule
  910. 33:11you'd put in place to protect your
  911. 33:13organization. So imagine this. You've
  912. 33:16got hundreds, maybe even thousands of
  913. 33:18employees and they all need access to
  914. 33:20your AWS account. How in the world do
  915. 33:22you manage that without creating a huge
  916. 33:24security risk and just an administrative
  917. 33:25nightmare? Honestly, this is one of the
  918. 33:27biggest problems in cloud security and
  919. 33:29solving it is what separates a truly
  920. 33:31secure architecture from a really
  921. 33:32vulnerable one. The solution, it's
  922. 33:34called identity federation, and we're
  923. 33:36going to break down exactly how it works
  924. 33:38right now. So, here's what we're going
  925. 33:40to cover. We'll start with the login
  926. 33:42problem itself. You know, why this is
  927. 33:44even a thing. Then, we'll get into how
  928. 33:46federation actually works. And I've got
  929. 33:48a super simple analogy that'll make it
  930. 33:49click. After that, we'll see how it all
  931. 33:51plays out on AWS, look at what you need
  932. 33:53to know for the exam, and then do a
  933. 33:55quick final recap. All right, let's kick
  934. 33:58things off by really defining the core
  935. 34:00problem we're trying to solve here. So,
  936. 34:02let's just pretend your company has a
  937. 34:04thousand people. You've got developers,
  938. 34:06data scientists, managers, the whole
  939. 34:08crew, and they all need to get into AWS.
  940. 34:11How do you give them access securely
  941. 34:13without creating a total mess? What's
  942. 34:15the first thing that pops into your
  943. 34:16head? Well, you could just go into the
  944. 34:18AWS console and manually create 1,000
  945. 34:21different AM users. But let me tell you,
  946. 34:24this is an absolute security nightmare.
  947. 34:26You'd have to manage a thousand sets of
  948. 34:28passwords and access keys. And what
  949. 34:30happens when someone leaves the company?
  950. 34:32You have to remember to go in and
  951. 34:33manually delete their user. If you
  952. 34:35forget, which can happen, you've now got
  953. 34:37what's called an orphaned credential.
  954. 34:38Basically, an active key just floating
  955. 34:40out there, which is a massive security
  956. 34:42risk. There's no central login
  957. 34:44management. It's just chaos. This whole
  958. 34:46approach just doesn't scale. So, if the
  959. 34:48manual way is a disaster, what's the
  960. 34:51right way? The answer is identity
  961. 34:53federation. And it's all about building
  962. 34:55this bridge of trust between your
  963. 34:58company's system and AWS. At its very
  964. 35:01core, federation is all about one simple
  965. 35:04word, trust. It's really just an
  966. 35:07agreement. Your company basically says
  967. 35:09to AWS, "Hey, listen. We'll handle
  968. 35:11figuring out who our employees are. If
  969. 35:13we say someone is legit, just trust us."
  970. 35:15And AWS says, "Okay, sounds good. If you
  971. 35:18vouch for them, we'll let them in based
  972. 35:20on the rules we have set up on our end."
  973. 35:22So the process kind of looks like this.
  974. 35:24First, your employee, let's call her
  975. 35:25Sarah, she just logs into her normal
  976. 35:27company portal. Same password she uses
  977. 35:29every day. Nothing new for her. Now,
  978. 35:32behind the scenes, her company's system
  979. 35:34after it makes sure she is who she says
  980. 35:35she is, generates the special temporary
  981. 35:38security pass. Then Sarah's browser
  982. 35:40takes that pass and shows it to AWS. AWS
  983. 35:43looks at it, sees it came from a trusted
  984. 35:45source, her company, and boom, lets her
  985. 35:47in. Now, notice Sarah never enters an
  986. 35:50AWS password. AWS never ever sees her
  987. 35:53corporate password. Now, if that still
  988. 35:56feels a little abstract, don't worry.
  989. 35:58Let's use a real world analogy that
  990. 36:00makes this whole thing crystal clear.
  991. 36:03Okay, imagine your company rented out an
  992. 36:05exclusive nightclub for a party. To get
  993. 36:07in, you first have to find your boss
  994. 36:08standing outside. You show her your
  995. 36:10company ID badge. That's you
  996. 36:12authenticating. Your boss recognizes you
  997. 36:14and gives you a special wristband that's
  998. 36:16only good for tonight. That wristband,
  999. 36:18that's your temporary pass. Now you walk
  1000. 36:20up to the club's bouncer who was playing
  1001. 36:22the part of AWS here. You don't show him
  1002. 36:24your company ID. He doesn't need to see
  1003. 36:26it. Doesn't even care what your name is.
  1004. 36:28He just looks at that official
  1005. 36:29wristband, nods, and lets you in. The
  1006. 36:31bouncer trusts the wristband because he
  1007. 36:33trusts your boss who gave it to you.
  1008. 36:35That is federation. Okay, so that's the
  1009. 36:37concept. Now, let's connect that whole
  1010. 36:39nightclub thing to the actual AWS
  1011. 36:41services that make all of this happen.
  1012. 36:44And this really shows the perfect
  1013. 36:45separation of duties. Your company is
  1014. 36:48responsible for authentication. That's
  1015. 36:50just proving who someone is. You manage
  1016. 36:52the user list, the passwords, and the
  1017. 36:54identity provider or IDP. You can think
  1018. 36:56of the IDP as your boss outside the
  1019. 36:58club. It's the system that hands out the
  1020. 37:00wristbands. Meanwhile, AWS is
  1021. 37:02responsible for authorization. That's
  1022. 37:04deciding what someone is allowed to do.
  1023. 37:07They control AM and they define the
  1024. 37:08roles a user can step into or assume
  1025. 37:11like a developer role or an auditor role
  1026. 37:13and all the specific permissions that
  1027. 37:15come with those roles.
  1028. 37:17All right, let's put this to the test
  1029. 37:18with a quick scenario. We have an
  1030. 37:20employee, Jane, who uses Federation to
  1031. 37:23get into an S3 bucket. Today is her last
  1032. 37:25day. The second she walks out the door,
  1033. 37:28HR deactivates her corporate account.
  1034. 37:30So, the big question is, whose job is it
  1035. 37:33to make sure Jane can't get back into
  1036. 37:34that S3 bucket tomorrow? Is it your
  1037. 37:37responsibility or is it AWS's? The
  1038. 37:40answer is it's your responsibility. But
  1039. 37:43here's the beautiful part. You've
  1040. 37:45already done it. Just by deactivating
  1041. 37:47her corporate account, you've cut off
  1042. 37:49her ability to get a wristband. The next
  1043. 37:51time she tries to log in, her company's
  1044. 37:53system will just say, "Sorry, who are
  1045. 37:55you?" And she'll never even get to the
  1046. 37:57point of talking to AWS. AWS doesn't
  1047. 38:00have to do a single thing because it
  1048. 38:01only trusts the people that your system
  1049. 38:03vouches for. You control the single
  1050. 38:05source of truth for who's who. So, now
  1051. 38:07that you actually get the why and the
  1052. 38:09how of it, let's boil this all down to
  1053. 38:11the specific laser focus points you'll
  1054. 38:14need for the exam. First up, Federation
  1055. 38:16uses an external identity provider. This
  1056. 38:19next part is critical. Your users do not
  1057. 38:22have permanent IM user accounts in AWS.
  1058. 38:25Instead, they get temporary credentials
  1059. 38:27from a service called the AWS Security
  1060. 38:29Token Service or STS. With those
  1061. 38:32temporary credentials, they then assume
  1062. 38:34an AM role. And it's that role that
  1063. 38:36holds all the permissions. The key
  1064. 38:39services to have in your head are AM,
  1065. 38:41STS, and AWS IM identity center, which
  1066. 38:44is what helps you manage this whole
  1067. 38:46setup. And here it is, the single
  1068. 38:49biggest trap you can fall into on the
  1069. 38:50exam. They will give you scenarios where
  1070. 38:53you might be tempted to pick an answer
  1071. 38:55that talks about creating or syncing a
  1072. 38:57bunch of AM users from your company
  1073. 38:59system. That is almost always the wrong
  1074. 39:02answer. Remember this, federation is
  1075. 39:04about roles, not users. You map your
  1076. 39:07corporate groups to AM roles and that's
  1077. 39:09it. No individual user accounts are ever
  1078. 39:11created in AWS. All right, let's lock
  1079. 39:14this in for good with a final super fast
  1080. 39:16recap of the whole flow. One, a user
  1081. 39:19logs into their normal company portal.
  1082. 39:22Two, the identity provider sends a
  1083. 39:24secure message to AWS basically saying,
  1084. 39:26"Yep, we've checked this person out.
  1085. 39:28They're good." Three, AWS security token
  1086. 39:31service issues temporary credentials.
  1087. 39:33And four, the user takes those
  1088. 39:34credentials to assume a predefined AM
  1089. 39:37role and gets all the permissions that
  1090. 39:38come with it. It's simple, it's secure,
  1091. 39:41and it's scalable. And that, my friends,
  1092. 39:43is identity federation. But here's a
  1093. 39:46final thought I want to leave you with.
  1094. 39:47This whole idea of granting temporary
  1095. 39:50role-based trust is a really powerful
  1096. 39:52security pattern. It's not just for
  1097. 39:54people. Think about your applications,
  1098. 39:56your EC2 instances, your containers. How
  1099. 39:59could you apply this exact same
  1100. 40:00principle to then so they never have to
  1101. 40:02store long-term credentials? That is the
  1102. 40:05real key to building truly secure
  1103. 40:06architectures on AWS. All right, let's
  1104. 40:09talk about AWS key management service or
  1105. 40:12KMS. And just so we're clear, this isn't
  1106. 40:14just about passing an exam. This is
  1107. 40:16about the one service that can literally
  1108. 40:18be the difference between a secure cloud
  1109. 40:21and a catastrophic data breach. If you
  1110. 40:23get this right, you're building on solid
  1111. 40:25rock. So, picture this. I'm not talking
  1112. 40:28about one or two secret files. Imagine
  1113. 40:31you're a company with a million
  1114. 40:32sensitive customer records, financial
  1115. 40:34reports, you name it. How in the world
  1116. 40:37do you actually protect every single one
  1117. 40:39of them from prying eyes? Because here's
  1118. 40:41the secret. Locking the files, you know,
  1119. 40:43encrypting them. That's the easy part.
  1120. 40:46The real nightmare, the thing that keeps
  1121. 40:47security folks up at night is managing
  1122. 40:49all the keys. If you have a million
  1123. 40:51locked boxes, you now have a million
  1124. 40:53keys. What do you do with them? How do
  1125. 40:55you control who uses them? That's the
  1126. 40:57real problem we need to solve. So, how
  1127. 41:00do we solve this absolute mess of a
  1128. 41:03million keys? Well, the solution is
  1129. 41:05built on one core incredibly clever
  1130. 41:08idea. Let's break it down step by step.
  1131. 41:11Okay, so it starts out super simple. You
  1132. 41:13take your data, which we call plain
  1133. 41:15text. You use a secret key, let's call
  1134. 41:17it a data key, to scramble it all up.
  1135. 41:20And the result is just unreadable
  1136. 41:22garbage to anyone else. We call this
  1137. 41:24cipher text. Easy enough, right? But
  1138. 41:27hold on a second. We've kind of just
  1139. 41:29traded one problem for another, haven't
  1140. 41:31we? See, to unlock that data, you need
  1141. 41:34the data key. So, where do you put it?
  1142. 41:37You can't just store it right next to
  1143. 41:38the encrypted file. That's exactly like
  1144. 41:40locking your front door and leaving the
  1145. 41:42key under the doormat. It's completely
  1146. 41:44pointless. And this this is the
  1147. 41:47brilliant part. What if we use a key to
  1148. 41:50encrypt the key itself? We generate a
  1149. 41:54second way more powerful key. We'll call
  1150. 41:56it a master key. We use that master key
  1151. 41:59to encrypt our little data key. Now we
  1152. 42:02can safely store the encrypted data key
  1153. 42:04right alongside our data. Think about
  1154. 42:06it. It's a locked key for a locked box.
  1155. 42:10A thief can find the key, but they can't
  1156. 42:12use it. So, this whole clever process,
  1157. 42:15it actually has a name and it's called
  1158. 42:17envelope encryption. It's just like
  1159. 42:19putting a secret letter in a locked box
  1160. 42:21and then putting the key to that box
  1161. 42:23inside another even more secure locked
  1162. 42:26box. This is the fundamental idea behind
  1163. 42:28pretty much everything KMS does. Now, to
  1164. 42:31make sure this concept is crystal clear
  1165. 42:32and sticks in your brain forever, let's
  1166. 42:34use an analogy that everybody gets, a
  1167. 42:37bank fault. And check this out. The
  1168. 42:40mapping is just perfect. Your valuable
  1169. 42:42data is the jewelry in your box. The key
  1170. 42:45to your specific safe deposit box,
  1171. 42:47that's your data key. The bank manager's
  1172. 42:49master key, which by the way, never
  1173. 42:51leaves the vault, that's your KMS key.
  1174. 42:53And the entire ultra secure bank vault
  1175. 42:55itself, that's the AWS key management
  1176. 42:58service. Now, here is the most important
  1177. 43:00rule of all. You never get to touch or
  1178. 43:02even see the bank manager's key. You can
  1179. 43:05only ask the manager to use it for you.
  1180. 43:07That separation is the absolute heart of
  1181. 43:09KMS security. Okay, so we've got the
  1182. 43:12theory, we've got the analogy. Now,
  1183. 43:14let's see how this stuff is actually
  1184. 43:15applied all across the AWS cloud.
  1185. 43:18Because believe me, this isn't some
  1186. 43:19niche service. It is everywhere. You
  1187. 43:22know, when you tick that little enable
  1188. 43:23encryption box on an S3 bucket or an EBS
  1189. 43:26volume for your EC2 instance or even an
  1190. 43:29RDS database, this is what's happening
  1191. 43:31behind the scenes. AWS is using KMS to
  1192. 43:35perform envelope encryption on your data
  1193. 43:37whenever it's just sitting there
  1194. 43:38securing everything from your files to
  1195. 43:40your database backups. Now, this is
  1196. 43:42where you have a really crucial choice
  1197. 43:44to make. You can use an AWS managed key.
  1198. 43:47It's easy, it's free, and AWS handles
  1199. 43:50everything for you. Or you can create
  1200. 43:52what's called a customer managed key.
  1201. 43:54Now, with this, you get super granular
  1202. 43:57control. You write the access policies.
  1203. 43:59You can disable the key to instantly
  1204. 44:01shut off access to all your data and you
  1205. 44:03control when it gets rotated. It does
  1206. 44:05cost a little bit per month, but for
  1207. 44:07your most sensitive data, that level of
  1208. 44:09control is absolutely priceless. All
  1209. 44:11right, let's put this new knowledge to
  1210. 44:13the test with a quick real world
  1211. 44:15scenario. This is exactly the kind of
  1212. 44:17situation you'll face as an architect.
  1213. 44:19So, imagine this nightmare scenario. A
  1214. 44:22developer messes up the permissions and
  1215. 44:24an S3 bucket with super sensitive files
  1216. 44:26is now public. Yikes. However, every
  1217. 44:30single object in that bucket was
  1218. 44:31encrypted using a customer-managed KMS
  1219. 44:34key that you control. A hacker stumbles
  1220. 44:36across a direct link to one of your
  1221. 44:39secret files. They click on it. The big
  1222. 44:42question is, can they actually open it
  1223. 44:45and read what's inside? And the answer
  1224. 44:47is a huge resounding no. Your data is
  1225. 44:51completely safe. This is the power of
  1226. 44:53KMS in action. The hacker has the locked
  1227. 44:56box, the file, and they even have the
  1228. 44:58locked key, the encrypted data key. But
  1229. 45:01to unlock that key, they have to go to
  1230. 45:03the bank manager, which is KMS, and ask
  1231. 45:05for permission. And because the hacker
  1232. 45:07is not on your approved access list, KMS
  1233. 45:10will basically slam the door in their
  1234. 45:11face. Access denied. The data stays
  1235. 45:14safe. Okay, now that you really get the
  1236. 45:16why and the how, let's boil this all
  1237. 45:19down into the core principles you need
  1238. 45:20for designing secure architectures.
  1239. 45:23These are the big takeaways. First, KMS
  1240. 45:26is all about centralized control of your
  1241. 45:28keys. Second, it all works because of
  1242. 45:31envelope encryption. And remember, you
  1243. 45:33never see the master key itself. Third,
  1244. 45:36encrypting your data at rest is your
  1245. 45:37best friend for defense. And finally,
  1246. 45:40you have to understand the two layers of
  1247. 45:42permissions. An IM policy is like the
  1248. 45:44security guard at the bank's front door.
  1249. 45:46It controls who can even enter the
  1250. 45:47building to ask for a key. The key
  1251. 45:49policy which is attached directly to the
  1252. 45:51key itself is the bank manager who
  1253. 45:53decides if the person asking is actually
  1254. 45:55authorized to use that specific key. You
  1255. 45:57need both to get access. Speaking of
  1256. 46:00which, there's a very specific trap that
  1257. 46:02catches so many people. Let's make sure
  1258. 46:05you see it coming a mile away. The trap
  1259. 46:08is confusing permission to access the
  1260. 46:10data with permission to use the key.
  1261. 46:12See, a user might have an AM policy that
  1262. 46:15gives them full S3 read access, but if
  1263. 46:17that S3 object is encrypted and they
  1264. 46:19don't also have permission to use that
  1265. 46:21specific KMS key, their request is going
  1266. 46:24to fail. You always always need both.
  1267. 46:26Permission to grab the locked box and
  1268. 46:28permission to ask the manager to help
  1269. 46:30you unlock it. So, let's boil this whole
  1270. 46:33thing down to one single sentence. With
  1271. 46:35KMS, you use a main KMS key that you
  1272. 46:38can't see to encrypt the smaller data
  1273. 46:40keys that are then used to encrypt your
  1274. 46:42actual data. That is envelope encryption
  1275. 46:44in a nutshell. So, I'll leave you with a
  1276. 46:47final thought to chew on. Now that you
  1277. 46:50understand how KMS separates access to
  1278. 46:52the key from access to the data, how
  1279. 46:55would you design a key policy that lets
  1280. 46:56your application, say running on an EC2
  1281. 46:59instance, decrypt data, but explicitly
  1282. 47:02denies that same permission to any human
  1283. 47:04user, even the most powerful
  1284. 47:06administrator. The answer to that, well,
  1285. 47:08that's where true powerful cloud
  1286. 47:10security really begins. All right, let's
  1287. 47:13talk about a choice in AWS that seems
  1288. 47:15really simple on the surface, but is
  1289. 47:17actually one of the most critical
  1290. 47:18security decisions you can make. Secrets
  1291. 47:20manager versus parameter store.
  1292. 47:22Seriously, getting this wrong could be
  1293. 47:23the one thing that leads to a massive
  1294. 47:25security headache. So, let's make sure
  1295. 47:27that never happens to you. So, why do we
  1296. 47:30even need these services in the first
  1297. 47:31place? Well, they exist to solve a huge
  1298. 47:34and honestly a surprisingly common
  1299. 47:36problem in the world of software
  1300. 47:37development. And that problem is the
  1301. 47:39danger of hard coding. And believe me,
  1302. 47:41that is not an exaggeration. Picture
  1303. 47:43this. A developer accidentally pushes
  1304. 47:45some code to a public GitHub repo and
  1305. 47:48buried inside is a database password or
  1306. 47:50an API key. You know what happens next?
  1307. 47:53Automated bots find it sometimes in
  1308. 47:55seconds and start exploiting it. This
  1309. 47:57happens all the time and the fallout can
  1310. 48:00be absolutely catastrophic for a
  1311. 48:02company. So what exactly is hard-
  1312. 48:04coding? It's just what it sounds like.
  1313. 48:06writing your secrets, your passwords,
  1314. 48:08your keys directly into your
  1315. 48:10application's source code. Honestly,
  1316. 48:12it's like taping your house key right to
  1317. 48:13your front door. Yeah, it's convenient
  1318. 48:15for about 5 seconds, but it's a total
  1319. 48:17disaster waiting to happen. So, rule
  1320. 48:19number one of building secure stuff, get
  1321. 48:22your secrets out of your code. Okay, so
  1322. 48:24if we can't put credentials in our code,
  1323. 48:27where in the world do they go? Well, AWS
  1324. 48:29gives us two fantastic options to solve
  1325. 48:31this. the Systems Manager Perimeter
  1326. 48:34Store and AWS Secrets Manager. Now, I
  1327. 48:37know they sound similar, but they are
  1328. 48:38built for fundamentally different jobs.
  1329. 48:40At first glance, you might think they're
  1330. 48:42the same thing. I mean, they both just
  1331. 48:44store key value pairs, right? But it's
  1332. 48:46all about the intent. What are you using
  1333. 48:48it for? Parameters are for your general
  1334. 48:51configuration data, things like an S3
  1335. 48:53bucket name, a URL for an endpoint, or
  1336. 48:55maybe a feature flag. Secrets, on the
  1337. 48:58other hand, are for well, secrets. We're
  1338. 49:01talking about the highly confidential
  1339. 49:02stuff like database passwords and API
  1340. 49:04keys that absolutely must have the
  1341. 49:06highest level of protection. You know
  1342. 49:08what? To really make this click, I've
  1343. 49:10got a simple analogy for you that I
  1344. 49:12promise you will not forget. It's really
  1345. 49:15this simple. Parameter store is your
  1346. 49:17everyday wallet. And Secrets Manager,
  1347. 49:19that's the highsecurity reinforced steel
  1348. 49:21safe deposit box you keep at the bank.
  1349. 49:24Let's break that down. You use your
  1350. 49:26wallet for things you need to get to all
  1351. 49:28the time, right? your debit card, maybe
  1352. 49:30some cash. That's parameter store. It's
  1353. 49:33secure. Don't get me wrong. It's
  1354. 49:34encrypted with AWS's key management
  1355. 49:36service, but it's designed for easy,
  1356. 49:38frequent access. Now, the safe deposit
  1357. 49:40box, that's for your crown jewels, your
  1358. 49:43passport, the deed to your house. Access
  1359. 49:45is super strict. Everything is logged.
  1360. 49:47Everything is audited. That is secrets
  1361. 49:49manager. It's for stuff that doesn't
  1362. 49:51just need to be stored securely. It
  1363. 49:53needs to be managed securely through its
  1364. 49:55entire life cycle. So, diving a little
  1365. 49:57deeper into parameter store, it's
  1366. 49:59actually part of a bigger service called
  1367. 50:01AWS Systems Manager, and it's incredibly
  1368. 50:04versatile. You can organize all your
  1369. 50:05config data into a nice hierarchy, kind
  1370. 50:08of like folders, which is really
  1371. 50:09helpful, and it's super cost-effective.
  1372. 50:11It's really the perfect general purpose
  1373. 50:13tool. It's our wallet. And now for
  1374. 50:15Secrets Manager. This is where we see
  1375. 50:18its true superpower. See, it's not just
  1376. 50:20a place to store secrets. It's a full
  1377. 50:23life cycle management service and its
  1378. 50:26killer feature, the one thing you
  1379. 50:28absolutely have to remember is automated
  1380. 50:30secret rotation. It can literally
  1381. 50:32connect to your RDS database and change
  1382. 50:35the password automatically on a schedule
  1383. 50:37you set, all without a human ever
  1384. 50:39touching it. That is a gamecher for
  1385. 50:41security. Okay, you've got the theory.
  1386. 50:43Let's put it to the test. We're going to
  1387. 50:45walk through a quick practical scenario.
  1388. 50:47This is the kind of thing you'd see in
  1389. 50:49the real world every day. So, the setup
  1390. 50:52is pretty standard. We've got an app. It
  1391. 50:54needs a database password to connect to
  1392. 50:55RDS. But here's the kicker. Here's the
  1393. 50:58critical requirement. Company policy
  1394. 51:00says that password has to be changed
  1395. 51:02automatically every single month. So,
  1396. 51:05what do you think? Based on that one key
  1397. 51:07feature we just talked about, what's the
  1398. 51:09obvious choice here? Yep, it's got to be
  1399. 51:11AWS Secrets Manager. The second you see
  1400. 51:14a requirement for rotation or life cycle
  1401. 51:17management or automatically changing
  1402. 51:19credentials, your brain should just
  1403. 51:21scream secrets manager. Parameter store
  1404. 51:24is great, but it just can't do this on
  1405. 51:25its own. That native rotation capability
  1406. 51:28is the single biggest reason you'd
  1407. 51:30choose one over the other. All right,
  1408. 51:32you get the why behind it now, which is
  1409. 51:34awesome. So, let's just boil this all
  1410. 51:36down into the sharpest, clearest point
  1411. 51:37so you can make the right call every
  1412. 51:39single time. Here are the big tells.
  1413. 51:42First, if a scenario mentions rotation,
  1414. 51:44just stop. It's secrets manager. Period.
  1415. 51:46If the main thing they care about is
  1416. 51:48cost and it's for simple config data,
  1417. 51:50you're probably leaning toward parameter
  1418. 51:52store. If you need that deep
  1419. 51:53integration, like automatically changing
  1420. 51:55a password on an RDS database, that's
  1421. 51:57secrets manager all day long. And the
  1422. 51:59simplest rule of thumb, parameter store
  1423. 52:01is for config. Secrets manager is for
  1424. 52:03credentials. Now, listen up because here
  1425. 52:05is a classic trap. You might see a
  1426. 52:07question that mentions parameter stores
  1427. 52:09advanced tier. Now, this advanced tier
  1428. 52:12is cool. It lets you store way more
  1429. 52:14parameters and use larger values, but
  1430. 52:16it's easy to think it adds more security
  1431. 52:18features, and it doesn't. Advanced
  1432. 52:20parameter store is not a substitute for
  1433. 52:22secrets manager. It does not have
  1434. 52:24automated rotation. Don't let that one
  1435. 52:26fool you. Okay, let's wrap this all up.
  1436. 52:29If you walk away from this remembering
  1437. 52:31just three things, make it these three.
  1438. 52:33First, never ever hardcode credentials.
  1439. 52:37get them out of your code and put them
  1440. 52:39in a managed service. Second, choose the
  1441. 52:42right tool for the job. Your wallet for
  1442. 52:44everyday config, the safe deposit box
  1443. 52:46for your most valuable secrets. And
  1444. 52:48third, the second you see the word
  1445. 52:50rotation, you know the answer is always
  1446. 52:53secrets manager. And that's really the
  1447. 52:55bottom line here. Getting this choice
  1448. 52:57right isn't just about an exam question.
  1449. 52:59It's a fundamental part of designing
  1450. 53:00secure, modern, and reliable
  1451. 53:02applications in the cloud. So, I'll
  1452. 53:04leave you with a question to chew on.
  1453. 53:06Think about your own projects, your own
  1454. 53:08work. Where are you maybe using a simple
  1455. 53:11parameter when you really need the full
  1456. 53:12life cycle management of a true managed
  1457. 53:14secret? It's definitely something to
  1458. 53:16think about. All right, let's dive into
  1459. 53:18one of the most fundamental concepts in
  1460. 53:20all of cloud security. We're talking
  1461. 53:22about the difference between protecting
  1462. 53:23data that's just sitting there versus
  1463. 53:25protecting data that's on the move. And
  1464. 53:27trust me, getting this right is
  1465. 53:29absolutely crucial. So, let's break it
  1466. 53:31all down. Okay, let me ask you a
  1467. 53:33question to get us started. Imagine
  1468. 53:35someone, and I mean physically, breaks
  1469. 53:37into a data center and just walks out
  1470. 53:38with a server. If that server has all
  1471. 53:40your company's most important data on
  1472. 53:42it, is that it? Is it game over? Well,
  1473. 53:44the answer, it really depends entirely
  1474. 53:47on the two ideas we're going to cover
  1475. 53:48right now. See, to really get a handle
  1476. 53:50on the risk, you've got to understand
  1477. 53:51that your data isn't just, you know,
  1478. 53:53data. From a security point of view, it
  1479. 53:56pretty much always exists in one of two
  1480. 53:58states. And each one has its own set of
  1481. 54:00things to worry about. And honestly,
  1482. 54:02it's super simple when you break it
  1483. 54:03down. On one side, you've got data at
  1484. 54:06rest. Just think of this as data that's
  1485. 54:08well at rest. It's sitting there stored
  1486. 54:10on a physical disk, like an object in an
  1487. 54:13S3 bucket or on an EBS volume. It's not
  1488. 54:16going anywhere. Then on the other side,
  1489. 54:18you have data in transit, and that's the
  1490. 54:20total opposite. This is data that's on
  1491. 54:22the move, zipping across the internet
  1492. 54:24from your app to a user's browser, or
  1493. 54:26maybe shuffling between services inside
  1494. 54:28your own network. Okay, so at rest in
  1495. 54:31transit, these terms can feel a little,
  1496. 54:34I don't know, abstract. So, let's use a
  1497. 54:37really simple analogy that'll make this
  1498. 54:38click instantly. A highsecurity bank.
  1499. 54:42So, think of it like this. Data at rest,
  1500. 54:45that's like a pile of cash locked away
  1501. 54:46deep inside a bank vault. It's
  1502. 54:48stationary and it's protected by that
  1503. 54:50big, heavy vault door. Now, data in
  1504. 54:53transit, that's like that same cash
  1505. 54:55being driven across town in an armored
  1506. 54:57truck. It's moving. It's exposed in a
  1507. 54:59totally different way and it needs a
  1508. 55:01completely different kind of protection,
  1509. 55:02right? I mean, you wouldn't try to
  1510. 55:04protect an armored truck by welding a
  1511. 55:05vault door to it and you wouldn't
  1512. 55:07protect the vault by putting wheels on
  1513. 55:08it. Different states, different
  1514. 55:10protection. And this brings us right to
  1515. 55:12our first big idea, encryption at rest.
  1516. 55:15All this means is scrambling your data
  1517. 55:17when it's just sitting on a disc. So, if
  1518. 55:19someone does steal that physical hard
  1519. 55:21drive, all they get is a bunch of
  1520. 55:22unreadable gibberish unless they have
  1521. 55:24the secret key. In our analogy, this is
  1522. 55:27the super complex lock on the bank vault
  1523. 55:29door. The vault itself is tough, but
  1524. 55:31it's the lock that really secures what's
  1525. 55:33inside. So, it makes sense then that
  1526. 55:36encryption in transit is how we protect
  1527. 55:38our data while it's moving. It scramles
  1528. 55:40the data before it gets sent across the
  1529. 55:42network and then unscramles it on the
  1530. 55:43other side. So, if some attacker manages
  1531. 55:45to intercept it mid-flight, all they get
  1532. 55:47is a stream of nonsense. This is the
  1533. 55:50armored plating on our truck. It's the
  1534. 55:51guards inside. It's the protection
  1535. 55:53designed specifically from movement.
  1536. 55:55Okay, so we've got our safe and we've
  1537. 55:58got our armored truck. The concepts are
  1538. 55:59clear. So now let's bring this into the
  1539. 56:02real world. How does this all actually
  1540. 56:04work inside the AWS cloud? What tools
  1541. 56:06does AWS give us for both of these jobs?
  1542. 56:09Okay, for data at rest, our bank vault,
  1543. 56:12the main tool AWS gives you is the key
  1544. 56:15management service or KMS. You can
  1545. 56:18seriously just think of KMS as your own
  1546. 56:20personal highly secure, super resilient
  1547. 56:22master locksmith. It creates and manages
  1548. 56:25the encryption keys that serve as the
  1549. 56:26locks for all your data safes. So where
  1550. 56:29do you actually use this thing? Well, a
  1551. 56:31couple of common places. In Amazon S3,
  1552. 56:34you enable something called serverside
  1553. 56:36encryption with KMS or SSEKMS to protect
  1554. 56:39all the objects in your bucket. And for
  1555. 56:41your EC2 instances, when you're creating
  1556. 56:43an EBS volume, you know, the virtual
  1557. 56:45hard drive, you literally just tick a
  1558. 56:47box that says encrypt this volume.
  1559. 56:49Behind the scenes, both of these super
  1560. 56:51simple actions are using KMS to manage
  1561. 56:53the keys and lock that data down while
  1562. 56:55it's at rest. All right. Now, what about
  1563. 56:57data in transit, our armored truck? The
  1564. 57:00industry standard tech for this is
  1565. 57:01called TLS, which stands for transport
  1566. 57:04layer security. You probably know it by
  1567. 57:06its old name, SSL. It's literally the S
  1568. 57:09in HTTPS that you see in your browser's
  1569. 57:11address bar. What TLS does is create a
  1570. 57:14secure encrypted tunnel for your data to
  1571. 57:16travel through. Now, to use TLS, you
  1572. 57:19need a special thing called a TLS
  1573. 57:20certificate. This is what proves your
  1574. 57:22server is who it says it is, and it
  1575. 57:24allows that secure encrypted connection
  1576. 57:26to get set up in the first place. And
  1577. 57:28the AWS service for this, that's AWS
  1578. 57:30Certificate Manager or ACM. ACM
  1579. 57:33basically handles all the headaches of
  1580. 57:35getting, managing, and deploying these
  1581. 57:37certificates for you. It's the service
  1582. 57:38that provides the unique keys and
  1583. 57:40credentials for your armored truck. And
  1584. 57:42you see this thing in action all over
  1585. 57:44the place. For example, when you attach
  1586. 57:46a certificate from ACM to an elastic
  1587. 57:48load balancer, that's what allows the
  1588. 57:50load balancer to handle all that
  1589. 57:51incoming HTTPS traffic, securing the
  1590. 57:54connection all the way from the user to
  1591. 57:55your infrastructure. Same deal with
  1592. 57:57Amazon CloudFront. You use an ACM
  1593. 58:00certificate to make sure your content is
  1594. 58:01delivered securely over HTTPS to your
  1595. 58:04users, no matter where they are in the
  1596. 58:05world. So AWS gives us the locks and AWS
  1597. 58:10gives us the armored trucks. But this
  1598. 58:12brings up what is probably the single
  1599. 58:14most important question of all, one that
  1600. 58:16plugs directly into the AWS shared
  1601. 58:18responsibility model. Who's actually
  1602. 58:20responsible for, you know, using them?
  1603. 58:23Let's go right back to that scenario
  1604. 58:25from the beginning. A company has a
  1605. 58:27bunch of customer data sitting on an EBS
  1606. 58:29volume. They're in AWS, but they just
  1607. 58:32never bothered to enable encryption on
  1608. 58:33that volume. Then an attacker manages to
  1609. 58:36get into the physical AWS data center
  1610. 58:38and steals the disc. Is that data
  1611. 58:40compromised? What do you think? The
  1612. 58:42answer is absolutely 100% yes. That data
  1613. 58:46is completely exposed. And this is why
  1614. 58:49it is so so critical to understand this.
  1615. 58:51Under the shared responsibility model,
  1616. 58:53AWS is responsible for the security of
  1617. 58:56the cloud. That means the physical
  1618. 58:58buildings, the servers, the networking
  1619. 58:59gear. But you, the customer, are
  1620. 59:01responsible for security in the cloud.
  1621. 59:04AWS gives you the encryption checkbox,
  1622. 59:06but you are responsible for ticking it.
  1623. 59:08They provide the lock, but you have to
  1624. 59:10be the one to turn the key. All right,
  1625. 59:12now that we've got the whole picture,
  1626. 59:14the concepts, the tools, the
  1627. 59:15responsibility, let's boil this all down
  1628. 59:17to the absolute key takeaways you want
  1629. 59:19to have locked in. Okay, here are the
  1630. 59:22core connections you need to have down
  1631. 59:23cold. First, when you see data at rest,
  1632. 59:26data on services like S3 or EBS, your
  1633. 59:29mind should immediately jump to AWS KMS.
  1634. 59:32Second, when you see data in transit,
  1635. 59:34anything about securing network
  1636. 59:35connections, you should be thinking TLS
  1637. 59:37and AWS Certificate Manager or ACM. Just
  1638. 59:40remember, KMS manages encryption keys
  1639. 59:42for stored data. ACM manages TLS
  1640. 59:45certificates for network connections.
  1641. 59:47And the big one, you are always
  1642. 59:49responsible for enabling encryption. And
  1643. 59:51here is the classic exam trap. They love
  1644. 59:54to try and confuse the tools. So, an
  1645. 59:56exam question might suggest, I don't
  1646. 59:57know, using an ACM certificate to
  1647. 1:00:00encrypt an EBS volume. And that's just
  1648. 1:00:02nonsense. That's like trying to use your
  1649. 1:00:04armored truck sign key to open a bank
  1650. 1:00:06vault. Or maybe it'll suggest using a
  1651. 1:00:08KMS key to enable HTTPS on a load
  1652. 1:00:11balancer. Again, wrong tool for the job.
  1653. 1:00:14You have to know which tool belongs to
  1654. 1:00:15the vault and which one belongs to the
  1655. 1:00:17truck. So, let's do one last super fast
  1656. 1:00:20recap to tie it all together. Step one,
  1657. 1:00:22your data is either sitting still in a
  1658. 1:00:24safe that's at rest or it's moving in a
  1659. 1:00:26truck that's in transit. Step two, you
  1660. 1:00:29lock the safe using the keys that are
  1661. 1:00:30managed by AWSKMS.
  1662. 1:00:32Step three, you secure the armored truck
  1663. 1:00:34using TLS and you get the certificates
  1664. 1:00:36for that from ACM. And the most
  1665. 1:00:38important part, step four, remember it
  1666. 1:00:40is always your job to actually turn the
  1667. 1:00:42key and use these tools. So encryption
  1668. 1:00:45is awesome, right? It stops attackers
  1669. 1:00:47from being able to read your data if
  1670. 1:00:48they manage to get their hands on it.
  1671. 1:00:50But that leads to an even deeper
  1672. 1:00:52question for any architect out there.
  1673. 1:00:54What about the people who are authorized
  1674. 1:00:56to see the data? How do you stop them
  1675. 1:00:57from misusing it? How do you control
  1676. 1:00:59what they can and can't do? Well, that's
  1677. 1:01:02a whole other story, and it all comes
  1678. 1:01:03down to identity and access management.
  1679. 1:01:06All right, let's talk about two things
  1680. 1:01:07in AWS that trip up almost everyone.
  1681. 1:01:10Security groups and network ACL. They
  1682. 1:01:13both kind of act like firewalls, right?
  1683. 1:01:15But here's the deal. If you mix them up,
  1684. 1:01:16you could accidentally leave your whole
  1685. 1:01:18application wide open. So, let's get
  1686. 1:01:20this cleared up once and for all. So,
  1687. 1:01:23picture this. Your app is the hottest
  1688. 1:01:25new club in town, and it's running on
  1689. 1:01:27AWS. Every single connection, every
  1690. 1:01:30little packet of data is basically
  1691. 1:01:32someone trying to get in. And that
  1692. 1:01:33brings up the big question, right? Who
  1693. 1:01:35are you going to let pass that velvet
  1694. 1:01:36rope? And who gets told, "Sorry, not
  1695. 1:01:38tonight." Because think about it, in the
  1696. 1:01:41cloud, every single app needs to be a
  1697. 1:01:43fortress. You just can't leave the doors
  1698. 1:01:44unlocked and hope for the best. You've
  1699. 1:01:46got to have layers of defense to control
  1700. 1:01:48exactly who gets to talk to your servers
  1701. 1:01:50and well, what they're allowed to talk
  1702. 1:01:51about. And when you're building that
  1703. 1:01:53fortress in AWS, these are your two main
  1704. 1:01:56tools, security groups and network
  1705. 1:01:58access control lists. We just call them
  1706. 1:02:00knackles. Now, on the surface, they
  1707. 1:02:02sound like they do the exact same thing.
  1708. 1:02:04And that's exactly where everybody gets
  1709. 1:02:05confused. But trust me, they have very,
  1710. 1:02:08very different jobs. And both are super
  1711. 1:02:10important. Okay, to really get this to
  1712. 1:02:12stick, let's just forget all the
  1713. 1:02:14technical stuff for a second. Let's use
  1714. 1:02:16a super simple analogy. Imagine your
  1715. 1:02:18whole setup is like a secure apartment
  1716. 1:02:20complex. You've got a main gatekeeper at
  1717. 1:02:22the entrance to the whole property and
  1718. 1:02:24then you've got a personal bouncer at
  1719. 1:02:25every single apartment door. Let's start
  1720. 1:02:27with the security group. What is it?
  1721. 1:02:29Well, it's basically a firewall for your
  1722. 1:02:32individual server, your EC2 instance.
  1723. 1:02:34It's attached right to it. Think of it
  1724. 1:02:35as your personal uplose and personal
  1725. 1:02:38security detail. So, in our apartment
  1726. 1:02:40analogy, the security group, that's the
  1727. 1:02:42bouncer. He's standing right at the door
  1728. 1:02:44of one specific VIP apartment. His only
  1729. 1:02:47job is to protect that door. He doesn't
  1730. 1:02:50care about what's happening down the
  1731. 1:02:51hall, just his apartment. So, how does
  1732. 1:02:54this bouncer work? Well, first, he's at
  1733. 1:02:56the apartment door, right? That's the
  1734. 1:02:58instance level. Second, and this is
  1735. 1:03:01probably the most important thing to
  1736. 1:03:02remember, he is stateful. What does that
  1737. 1:03:04mean? It means he has a great memory. If
  1738. 1:03:06he lets you in, he remembers you. So,
  1739. 1:03:09when you leave, you can just walk right
  1740. 1:03:10out. The return trip is automatically
  1741. 1:03:12allowed. No one checks your ID on the
  1742. 1:03:14way out. And third, our bouncer is
  1743. 1:03:16pretty positive. He only has an allow
  1744. 1:03:18list. If your name isn't on his list,
  1745. 1:03:20you're not getting in. That's it. Okay,
  1746. 1:03:23so that's the bouncer. Now, let's zoom
  1747. 1:03:26out a bit and talk about the network
  1748. 1:03:27ACL, the NAC.
  1749. 1:03:30This is not personal security for one
  1750. 1:03:32server. Nope. This is the firewall for
  1751. 1:03:35the entire neighborhood or in AWS
  1752. 1:03:37language, your whole VPC subnet. This is
  1753. 1:03:41our gatekeeper. He's standing at the
  1754. 1:03:43main gate to the entire apartment
  1755. 1:03:45complex. So before you can even get
  1756. 1:03:46anywhere near an apartment door to talk
  1757. 1:03:48to one of those bouncers, you have to
  1758. 1:03:49get past this guy first. And this is
  1759. 1:03:52where things get really different. The
  1760. 1:03:54gatekeeper works at the subnet level.
  1761. 1:03:56And he is stateless. That means he has a
  1762. 1:03:59terrible memory, like zero memory. He
  1763. 1:04:02checks your ID when you come in and then
  1764. 1:04:04he checks it all over again when you go
  1765. 1:04:05out, every single time. And another huge
  1766. 1:04:08difference from the bouncer, this
  1767. 1:04:09gatekeeper has both an allow list and a
  1768. 1:04:12denial list. So you can tell him, "Hey,
  1769. 1:04:14let these people in." And you can also
  1770. 1:04:16say, "See that guy? Block him. I don't
  1771. 1:04:18ever want to see him here." So the
  1772. 1:04:19analogy is pretty straightforward,
  1773. 1:04:21right? What's cool is that the AWS
  1774. 1:04:23architecture lines up with it perfectly.
  1775. 1:04:25Let's actually put this on a map and see
  1776. 1:04:27how it all works. Okay, so here's what a
  1777. 1:04:29typical setup looks like. You've got
  1778. 1:04:31your VPC, your virtual private cloud.
  1779. 1:04:33That's your own private walledoff
  1780. 1:04:35section of AWS. Inside that you have a
  1781. 1:04:38subnet. Think of it as a fencedin
  1782. 1:04:39neighborhood. The NACL, that's our
  1783. 1:04:42gatekeeper, acts as the firewall for
  1784. 1:04:44that entire subnet. It is the absolute
  1785. 1:04:46first line of defense. Now, if traffic
  1786. 1:04:48makes it past the NACL, then it has to
  1787. 1:04:50deal with the security group, our
  1788. 1:04:52bouncer, which is wrapped super tightly
  1789. 1:04:53around the individual EC2 instance. You
  1790. 1:04:56see, it's all about layers of security.
  1791. 1:04:58So, let's just lay this all out nice and
  1792. 1:05:00clean. First, scope. The security group
  1793. 1:05:03is focused on just one instance. The
  1794. 1:05:05knackle, it covers the whole subnet.
  1795. 1:05:07Next up, rules. Security groups can only
  1796. 1:05:10have allow rules, but knackles, they can
  1797. 1:05:12have both allow and deny rules. Then
  1798. 1:05:14there's state. And this is the big one.
  1799. 1:05:16Remember, security groups are stateful.
  1800. 1:05:18They remember you. Knackles are
  1801. 1:05:20stateless. They check every single thing
  1802. 1:05:22coming in and going out. And finally,
  1803. 1:05:24what happens right out of the box? Well,
  1804. 1:05:26a brand new security group blocks
  1805. 1:05:28everything by default. It's super
  1806. 1:05:29paranoid. A new knackle on the other
  1807. 1:05:31hand allows everything by default. It's
  1808. 1:05:34way more trusting to start with. Okay,
  1809. 1:05:36theory's done. You've got the concepts.
  1810. 1:05:38Now, let's see how this works in the
  1811. 1:05:39real world. I'm going to give you a
  1812. 1:05:40scenario. You're the architect here.
  1813. 1:05:42You've got to make the call. So, here's
  1814. 1:05:44the situation. You're looking at your
  1815. 1:05:46monitoring dashboard and an alarm goes
  1816. 1:05:48off. There's a specific IP address
  1817. 1:05:50that's a known bad actor and it's just
  1818. 1:05:52hammering one of your web servers over
  1819. 1:05:54and over. You need to shut this down
  1820. 1:05:57now. So, here's my question for you.
  1821. 1:06:00Which tool are you going to grab? What's
  1822. 1:06:02the best choice to block this one single
  1823. 1:06:05IP address from ever reaching any server
  1824. 1:06:07in your subnet? Think about it. Are you
  1825. 1:06:10using the bouncer or the gatekeeper? If
  1826. 1:06:12you said the network ACL, you got it.
  1827. 1:06:15And the why here is the most important
  1828. 1:06:16part. You need to explicitly deny that
  1829. 1:06:19IP address. A security group just can't
  1830. 1:06:22do that. Remember, it only has an allow
  1831. 1:06:24list. It can't say no. Only the NACL,
  1832. 1:06:27our gatekeeper, has the power to create
  1833. 1:06:29a deny rule and say, "Nope, you are not
  1834. 1:06:32allowed in. Period." It blocks them
  1835. 1:06:34right at the front gate of the subnet
  1836. 1:06:36way before they can even get near one of
  1837. 1:06:38the apartment doors. Okay, we have
  1838. 1:06:40covered a lot of ground. So, let's boil
  1839. 1:06:42this down to the absolute mustnoss. If
  1840. 1:06:44you remember nothing else, remember
  1841. 1:06:46these things. Let's lock this in. First,
  1842. 1:06:49security groups are stateful. They have
  1843. 1:06:51a memory. Knackles are stateless. They
  1844. 1:06:53forget everything instantly. Second,
  1845. 1:06:56security groups are for the instance.
  1846. 1:06:57Knackles are for the subnet. And third,
  1847. 1:07:00security groups can only allow. Knackles
  1848. 1:07:02can both allow and deny. Seriously, if
  1849. 1:07:05you just get those three points, you are
  1850. 1:07:0790% of the way there. And look, if there
  1851. 1:07:09is only one thing you remember from all
  1852. 1:07:11of this, please let it be this. Stateful
  1853. 1:07:14versus stateless. The fact that security
  1854. 1:07:16groups remember connections and knackles
  1855. 1:07:18don't. That is the number one reason
  1856. 1:07:20people get confused. If you can get that
  1857. 1:07:22down cold, you've basically mastered
  1858. 1:07:24this whole concept. So, right about now,
  1859. 1:07:27you might be thinking, "Okay, so which
  1860. 1:07:30one do I use?" And that's actually the
  1861. 1:07:32wrong question. See, it's not a choice
  1862. 1:07:34between one or the other. The whole
  1863. 1:07:36point is to use them together. It's all
  1864. 1:07:39part of your security playbook. Real
  1865. 1:07:41solid layered security means you're
  1866. 1:07:43using both. You use the knack, the
  1867. 1:07:46gatekeeper for those big broad rules,
  1868. 1:07:49things like block these known bad IPs
  1869. 1:07:51from the whole neighborhood. Then you
  1870. 1:07:53use the security groups, the bouncers
  1871. 1:07:55for the really specific detailed rules
  1872. 1:07:57like only let web traffic on port 443
  1873. 1:08:01into this specific web server. They're
  1874. 1:08:03designed to work as a team. And there
  1875. 1:08:05you have it. A really clear way to think
  1876. 1:08:07about two of the most important security
  1877. 1:08:09tools in AWS. They're not the same
  1878. 1:08:12thing. They're a team. You've got the
  1879. 1:08:14gatekeeper for the whole neighborhood
  1880. 1:08:16and a bouncer for every single door. So,
  1881. 1:08:18the only question left for you is now
  1882. 1:08:20that you really get the difference, how
  1883. 1:08:22are you going to design your next VPC?
  1884. 1:08:24>> All right, let's talk about something
  1885. 1:08:26that is absolutely fundamental to AWS
  1886. 1:08:29security, public versus private subnets.
  1887. 1:08:32Seriously, getting this one concept
  1888. 1:08:34right, it changes everything. Let's get
  1889. 1:08:37into it. So, why should you care? Well,
  1890. 1:08:40how about this? One single wrong
  1891. 1:08:43setting, one little checkbox can expose
  1892. 1:08:45your entire company's data to the whole
  1893. 1:08:47internet. No joke. This isn't just some
  1894. 1:08:50abstract idea. This is the difference
  1895. 1:08:52between building a digital fortress and
  1896. 1:08:54well, leaving the front door wide open
  1897. 1:08:56with locomat out. If you're building
  1898. 1:08:58anything in the cloud, this is job
  1899. 1:09:00number one. So, let's start from the
  1900. 1:09:03beginning. We're going to break down the
  1901. 1:09:04core difference between public and
  1902. 1:09:06private. We're going to build this from
  1903. 1:09:07the ground up so you really truly get
  1904. 1:09:09not just what it is, but why it all
  1905. 1:09:11works the way it does. Okay, so before
  1906. 1:09:14we can even get to subnets, we got to
  1907. 1:09:16start with the bigger picture. The VPC.
  1908. 1:09:18That stands for virtual private cloud.
  1909. 1:09:20Think of it like this. AWS is this giant
  1910. 1:09:23sprawling digital landscape, right? When
  1911. 1:09:25you create a VPC, you're basically
  1912. 1:09:27carving out your own private isolated
  1913. 1:09:30piece of that landscape. It's your plot
  1914. 1:09:31of land. You put a big fence around it
  1915. 1:09:33and absolutely nothing gets in or out
  1916. 1:09:35unless you are the one who opens the
  1917. 1:09:37gate. Now, on your new plot of land, you
  1918. 1:09:39wouldn't just throw everything into one
  1919. 1:09:41big messy pile. No, you'd create
  1920. 1:09:44different zones, right? You'd have the
  1921. 1:09:46house over here, the front yard over
  1922. 1:09:48there. These zones inside your VPC are
  1923. 1:09:50called subnets. They're just a way for
  1924. 1:09:52you to divide up your network and apply
  1925. 1:09:54different rules to different areas for,
  1926. 1:09:56you guessed it, security. And here it
  1927. 1:09:58is, the single most important
  1928. 1:10:01difference. If you remember one thing
  1929. 1:10:02from this whole explainer, make it this.
  1930. 1:10:05A public subnet can talk directly to the
  1931. 1:10:07internet. A private subnet absolutely
  1932. 1:10:10cannot. It has no direct route. It is
  1933. 1:10:12completely intentionally walled off.
  1934. 1:10:15That's it. Seriously, that is the entire
  1935. 1:10:17game right there. But you know, how does
  1936. 1:10:20that actually work under the hood? It's
  1937. 1:10:22all about two little things. First,
  1938. 1:10:25something called an internet gateway or
  1939. 1:10:27IGW. This is literally the main gate
  1940. 1:10:29from your plot of land out to the public
  1941. 1:10:31road, the internet. Second, every single
  1942. 1:10:34subnet has something called a route
  1943. 1:10:36table. It's just a little rule book,
  1944. 1:10:38like a GPS telling traffic where to go.
  1945. 1:10:41So, for a subnet to be public, its rule
  1946. 1:10:43book simply says, "Hey, any traffic
  1947. 1:10:45trying to get to the internet, send it
  1948. 1:10:47over to the internet gateway." A private
  1949. 1:10:49subnet's rule book, it just doesn't have
  1950. 1:10:51that rule. No rule, no pathway. Simple
  1951. 1:10:53as that. Okay, so that was the technical
  1952. 1:10:56bit. Now, let's make it unforgettable
  1953. 1:10:58with a simple analogy. We're going to
  1954. 1:11:00build a digital fortress. Let's make
  1955. 1:11:03this stick. Imagine your whole setup is
  1956. 1:11:05a digital fortress. Your private subnet,
  1957. 1:11:08that's the house. That's where you keep
  1958. 1:11:09all the good stuff, right? The
  1959. 1:11:10valuables, your databases, your secret
  1960. 1:11:12keys, all that critical data. Now, the
  1961. 1:11:14public subnet, that's like your front
  1962. 1:11:16yard. It's the part of your property
  1963. 1:11:17that's accessible from the street. It's
  1964. 1:11:19where you meet people. And that main
  1965. 1:11:21gate to your property, that's the
  1966. 1:11:22internet gateway. It lets visitors come
  1967. 1:11:24into the front yard, but it does not
  1968. 1:11:26give them a key to the house. So, you
  1969. 1:11:28might be thinking, "Okay, but what if
  1970. 1:11:30the stuff inside my secure house needs
  1971. 1:11:32to get online? Like, what if it needs to
  1972. 1:11:34download a software update?" Well, it
  1973. 1:11:36can't just walk out the front gate.
  1974. 1:11:37That's too risky. This is where a NAT
  1975. 1:11:39gateway comes in. In our fortress
  1976. 1:11:41analogy, think of this like a super
  1977. 1:11:43secure one-way delivery door. It lets
  1978. 1:11:46things go out of the house to the
  1979. 1:11:47internet, but it will never ever let an
  1980. 1:11:49uninvited connection come back in. It's
  1981. 1:11:51outbound only. So, let's put this into
  1982. 1:11:54practice. Where do you put your stuff?
  1983. 1:11:56Your web servers, your EC2 instances
  1984. 1:11:58serving your website, they have to go in
  1985. 1:12:00the public subnet, that front yard. They
  1986. 1:12:02need to be reachable. But your
  1987. 1:12:03databases, the crown jewels with all
  1988. 1:12:05that sensitive user data, they go deep
  1989. 1:12:07inside the house in that private subnet.
  1990. 1:12:10The web servers out in the yard can talk
  1991. 1:12:11to the database in the house, but the
  1992. 1:12:13outside world can't. This is the
  1993. 1:12:15absolute bedrock of secure cloud
  1994. 1:12:17architecture. Okay, quick pop quiz. A
  1995. 1:12:20developer on your team, total mistake,
  1996. 1:12:22launches a brand new database right into
  1997. 1:12:24a public subnet. A week goes by and
  1998. 1:12:27surprise, it gets breached. So, who's
  1999. 1:12:30responsible here? Is that on AWS? The
  2000. 1:12:32answer, and this is a big one, is you
  2001. 1:12:35are 100%. This is all about the AWS
  2002. 1:12:39shared responsibility model. See, AWS
  2003. 1:12:42takes care of security of the cloud. The
  2004. 1:12:44physical buildings, the servers, the
  2005. 1:12:46cables, but you you are responsible for
  2006. 1:12:49security in the cloud. That means your
  2007. 1:12:51network settings, your firewall rules,
  2008. 1:12:53and yeah, your decision about where you
  2009. 1:12:55place your data. That's on you. All
  2010. 1:12:58right. Now that you've got the core idea
  2011. 1:12:59down cold, let's talk about how this
  2012. 1:13:01stuff shows up on the exam. Let's lock
  2013. 1:13:04in exactly what you need to know. Here's
  2014. 1:13:06the cheat sheet. A subnet is public if
  2015. 1:13:08it has a route to an internet gateway.
  2016. 1:13:10period. A private subnet does not. For
  2017. 1:13:13things inside that private subnet to get
  2018. 1:13:15out for, say software updates, they use
  2019. 1:13:17a NAT gateway for outbound traffic only.
  2020. 1:13:20And architecturally, it's always the
  2021. 1:13:22same pattern. Userfacing stuff like web
  2022. 1:13:24servers in the public subnet and the
  2023. 1:13:26important backend stuff like databases
  2024. 1:13:28in the private subnet. Okay, listen up
  2025. 1:13:30because this is a huge exam trap. They
  2026. 1:13:33love to use this one to see if you were
  2027. 1:13:34really paying attention. You might see a
  2028. 1:13:37question where an EC2 instance has a
  2029. 1:13:39public IP address and your brain might
  2030. 1:13:41instantly think, "Oh, public IP, it must
  2031. 1:13:44be public." Wrong. If that instance is
  2032. 1:13:47sitting in a private subnet, one with no
  2033. 1:13:50route to the internet gateway, that
  2034. 1:13:52public IP address does absolutely
  2035. 1:13:54nothing. The instance is totally
  2036. 1:13:56unreachable from the internet. Remember,
  2037. 1:13:58the subnet's route table is king. It's
  2038. 1:14:01the ultimate source of truth. All right,
  2039. 1:14:03let's boil this all down. If you forget
  2040. 1:14:05everything else, just burn these three
  2041. 1:14:07things into your brain. Number one,
  2042. 1:14:10public means one thing and one thing
  2043. 1:14:12only. It has a route to an internet
  2044. 1:14:14gateway. That's the definition. Number
  2045. 1:14:17two, private means it is isolated. It
  2046. 1:14:20has no direct path to or from the
  2047. 1:14:22internet. And number three, this is how
  2048. 1:14:25you build things. Always, always protect
  2049. 1:14:27your valuables, your databases, your
  2050. 1:14:29application secrets by putting them in a
  2051. 1:14:31private subnet. Look, at the end of the
  2052. 1:14:34day, this isn't just about theory. It's
  2053. 1:14:36about how you build things that are safe
  2054. 1:14:38and reliable. You now have the
  2055. 1:14:40foundational knowledge to design a
  2056. 1:14:42secure network from the ground up. So,
  2057. 1:14:44the real question is, what are you going
  2058. 1:14:46to go build?
  2059. 1:14:47>> All right, let's dive into three AWS
  2060. 1:14:50security services that are absolutely
  2061. 1:14:52critical, but let's be honest, can get a
  2062. 1:14:54little confusing. WAFT, Shield, and
  2063. 1:14:57Firewall Manager. We're going to make it
  2064. 1:14:59super simple. So, picture this. You've
  2065. 1:15:01just launched your masterpiece
  2066. 1:15:03application. It's running perfectly on
  2067. 1:15:05AWS. It's fast and your users love it.
  2068. 1:15:08But the second it went live, you painted
  2069. 1:15:10a giant target on its back. The real
  2070. 1:15:13question isn't if you'll face some kind
  2071. 1:15:15of attack. It's what happens when you
  2072. 1:15:17do. Are you ready? To get our heads
  2073. 1:15:20around this, we're going to use one
  2074. 1:15:21simple analogy through this whole thing.
  2075. 1:15:23Imagine your application is the hottest
  2076. 1:15:25nightclub in the city. There's a huge
  2077. 1:15:27line outside and your biggest job is
  2078. 1:15:29managing that crowd to keep everything
  2079. 1:15:31safe and running smoothly. Now, your
  2080. 1:15:33first problem isn't just one or two
  2081. 1:15:35troublemakers. It's the sheer chaos of
  2082. 1:15:37an unruly crowd. Imagine tens of
  2083. 1:15:40thousands of people showing up out of
  2084. 1:15:42nowhere, all trying to smash through
  2085. 1:15:44your front door at the exact same time.
  2086. 1:15:46Your real customers can't even get near
  2087. 1:15:48the place. In the world of AWS, that mob
  2088. 1:15:51is a distributed denial of service
  2089. 1:15:52attack, or DOS for short. Its goal is
  2090. 1:15:55just pure chaos. It wants to flood your
  2091. 1:15:57application with so much garbage traffic
  2092. 1:15:59that your servers get overwhelmed, they
  2093. 1:16:01slow down, and then they crash. And just
  2094. 1:16:03like that, your nightclub is shut down
  2095. 1:16:05for business. So, how in the world do
  2096. 1:16:07you deal with a massive outofcrol mob?
  2097. 1:16:10You don't ask the person taking tickets
  2098. 1:16:12to handle it, right? No, you need some
  2099. 1:16:14serious crowd control. And that's where
  2100. 1:16:17your first line of defense comes in.
  2101. 1:16:19Meet AWS Shield. Think of Shield as your
  2102. 1:16:22club's head bouncer. a really big
  2103. 1:16:24nononsense bouncer. Their one and only
  2104. 1:16:26job is to stand at the front and manage
  2105. 1:16:28the sheer volume of the crowd, making
  2106. 1:16:30sure a stampede never happens. They're
  2107. 1:16:32there to absorb the big brute force
  2108. 1:16:34hits. The cool thing is every single AWS
  2109. 1:16:38customer gets a basic bouncer for free.
  2110. 1:16:39That's Shield Standard. It's on by
  2111. 1:16:41default, protecting you from the most
  2112. 1:16:42common large-scale network attacks. But
  2113. 1:16:45if your nightclub is a high-profile VIP
  2114. 1:16:47spot, you might want to hire an elite
  2115. 1:16:49security team. That's Shield Advanced.
  2116. 1:16:51It's a paid service, but it gives you
  2117. 1:16:53way more sophisticated protection. And
  2118. 1:16:55get this, 24/7 access to AWS's own DOS
  2119. 1:16:58response team if things get really
  2120. 1:17:00hairy. Okay, great. Our bouncer, Shield,
  2121. 1:17:04has handled the huge mob. The flow of
  2122. 1:17:06people is now manageable. But that just
  2123. 1:17:08solves the volume problem. What about
  2124. 1:17:10the kind of people who are in that line?
  2125. 1:17:13See, the bouncer is awesome at stopping
  2126. 1:17:15a stampede, but they aren't looking at
  2127. 1:17:17every single person and inspecting their
  2128. 1:17:18ID. They're not checking to see if
  2129. 1:17:20someone's trying to sneak in with a
  2130. 1:17:22hidden weapon. These are the sneaky
  2131. 1:17:24targeted attacks that hide inside what
  2132. 1:17:26looks like normal traffic. And this is
  2133. 1:17:28where AWS WFT comes in. WAFT is the web
  2134. 1:17:31application firewall. So if Shield is
  2135. 1:17:34the bouncer managing the crowd outside,
  2136. 1:17:36WFT is the detailoriented security guard
  2137. 1:17:38right at the velvet rope inspecting
  2138. 1:17:40every single guest who tries to come
  2139. 1:17:42inside. The way it works is actually
  2140. 1:17:44pretty simple. A request comes into your
  2141. 1:17:47application. WAFT looks at it and checks
  2142. 1:17:49it against a list of rules that you get
  2143. 1:17:51to define. It's like a security
  2144. 1:17:53checklist. Is this person on our block
  2145. 1:17:55list? Does the request look suspicious
  2146. 1:17:57or contain some malicious code? And
  2147. 1:17:59based on those rules, WAFT makes a call.
  2148. 1:18:01Either they're allowed in or they're
  2149. 1:18:03blocked right there. So, what is WFT
  2150. 1:18:05really looking for? Well, it's designed
  2151. 1:18:07to stop nasty stuff like SQL injection,
  2152. 1:18:10which is kind of like someone trying to
  2153. 1:18:11whisper a secret command to your
  2154. 1:18:13bartender to get them to open the cash
  2155. 1:18:15register. or it stops cross-sight
  2156. 1:18:17scripting which is like a guest passing
  2157. 1:18:18a malicious note to another guest. And
  2158. 1:18:20here is the key, you are in control. You
  2159. 1:18:23can write your own custom rules like say
  2160. 1:18:25block all traffic from this specific
  2161. 1:18:27country or you can use pre-built rule
  2162. 1:18:28sets from AWS that protect against all
  2163. 1:18:30the common threats right out of the box.
  2164. 1:18:33Okay, our nightclub is looking pretty
  2165. 1:18:35secure now. Shield is handling the mob
  2166. 1:18:37and WFT is inspecting every single
  2167. 1:18:39guest. But what happens when your
  2168. 1:18:41business takes off? I mean really takes
  2169. 1:18:43off. Suddenly, you don't have just one
  2170. 1:18:45nightclub. You have a global franchise
  2171. 1:18:47with hundreds of locations. Imagine
  2172. 1:18:49trying to make sure that your security
  2173. 1:18:51rules are identical at every single one
  2174. 1:18:53of your hundreds of clubs, which might
  2175. 1:18:55be running in dozens of different AWS
  2176. 1:18:57accounts. It would be a total nightmare.
  2177. 1:19:00A new threat comes out and you have to
  2178. 1:19:01run around telling each security guard
  2179. 1:19:03what to do. No way. This is precisely
  2180. 1:19:06the problem that AWS Firewall Manager
  2181. 1:19:09solves. It's not another bouncer. It's
  2182. 1:19:11not another security guard. It's the
  2183. 1:19:12head of security sitting at the
  2184. 1:19:14corporate headquarters. Their job is to
  2185. 1:19:16write the security playbook and make
  2186. 1:19:17sure every single club follows it to the
  2187. 1:19:19letter. So, here's how it works. From
  2188. 1:19:21one single central AWS account, you
  2189. 1:19:24define your master security policy. You
  2190. 1:19:27say things like all of our applications
  2191. 1:19:29must be protected by these specific DAFF
  2192. 1:19:31rules or every public application must
  2193. 1:19:33have shield advanced enabled. Then you
  2194. 1:19:35apply that policy across your entire
  2195. 1:19:37organization. Firewall Manager just
  2196. 1:19:39takes care of the rest, automatically
  2197. 1:19:41pushing out those rules and making sure
  2198. 1:19:43they're enforced everywhere, even on
  2199. 1:19:44brand new accounts you spin up tomorrow.
  2200. 1:19:47All right, let's lock this in with a
  2201. 1:19:49quick scenario. It's the grand opening
  2202. 1:19:51of your nightclub. The pressure is on.
  2203. 1:19:54Let's see how your team handles the
  2204. 1:19:55heat. First up, out of nowhere, a
  2205. 1:19:58massive flood of bogus traffic tries to
  2206. 1:20:01crash your front door. Whose job is it
  2207. 1:20:03to take that hit and absorb all that
  2208. 1:20:05volume? You got it. That's your bouncer,
  2209. 1:20:08AWS Shield. Okay, next. The crowd is now
  2210. 1:20:12under control, but a single request
  2211. 1:20:13comes in that contains some malicious
  2212. 1:20:15code trying to trick your app. Who's
  2213. 1:20:17inspecting the content of that request
  2214. 1:20:18and stopping it? Yep, that's a job for
  2215. 1:20:21your security guard, AWS WAF. And last
  2216. 1:20:24one, corporate just sent down a memo.
  2217. 1:20:26There's a new no hats rule, and it has
  2218. 1:20:29to be enforced at all 100 of your clubs,
  2219. 1:20:31effective immediately. Who do you call
  2220. 1:20:33to get that rule deployed everywhere
  2221. 1:20:35instantly and consistently? Of course,
  2222. 1:20:38that's the head of security, AWS
  2223. 1:20:40firewall manager. Perfect. Now, let's
  2224. 1:20:43just nail these concepts down with a
  2225. 1:20:45final summary. Getting these
  2226. 1:20:47distinctions right is so important, not
  2227. 1:20:48just for an exam, but for making smart
  2228. 1:20:51architecture choices in the real world.
  2229. 1:20:53This table really says it all. Shield
  2230. 1:20:56protects against DOS attacks, and it
  2231. 1:20:58operates at the network edge. Your main
  2232. 1:21:00job is just to decide if you need to pay
  2233. 1:21:01for the advanced version. WFT protects
  2234. 1:21:04against application layer attacks like
  2235. 1:21:06SQL injection and your job there is to
  2236. 1:21:08define the specific inspection rules.
  2237. 1:21:10And finally, firewall manager protects
  2238. 1:21:13you from having inconsistent security
  2239. 1:21:14policies. Your job is to define those
  2240. 1:21:17central policies that then get applied
  2241. 1:21:18everywhere. Now, listen up because here
  2242. 1:21:21is a classic exam trap. You'll see
  2243. 1:21:24questions that try to trick you into
  2244. 1:21:25thinking WFT can manage rules across
  2245. 1:21:27your whole organization. It can't. Waff
  2246. 1:21:30is the guard at one door doing the
  2247. 1:21:31enforcing. Firewall manager is the boss
  2248. 1:21:34who writes the rulebook and gives a copy
  2249. 1:21:35to all the guards. Just remember that
  2250. 1:21:37difference. W enforces. Firewall manager
  2251. 1:21:40distributes. So if you remember nothing
  2252. 1:21:42else from this, remember these three
  2253. 1:21:44words. Shield is for scale, handling
  2254. 1:21:46huge attacks. W is for substance,
  2255. 1:21:48inspecting the content of individual
  2256. 1:21:50requests. And firewall manager is for
  2257. 1:21:52strategy, deploying your security plan
  2258. 1:21:54everywhere. Scale, substance, and
  2259. 1:21:57strategy. You get that and you've got
  2260. 1:21:58this.
  2261. 1:21:59>> Okay, let's be honest. Cloud Trail and
  2262. 1:22:01AWS Config, they can be a little
  2263. 1:22:04confusing, right? But getting them
  2264. 1:22:06straight isn't just about passing an
  2265. 1:22:07exam. It's absolutely fundamental to
  2266. 1:22:09knowing what's actually happening inside
  2267. 1:22:11your AWS account. So, today we're going
  2268. 1:22:13to make sure you understand these two
  2269. 1:22:15critical services once and for all.
  2270. 1:22:18Here's what we're going to do. We'll
  2271. 1:22:19start with the problem we're all trying
  2272. 1:22:21to solve. Then, we'll meet our two
  2273. 1:22:23security detectives. I've got a super
  2274. 1:22:25simple analogy that'll make it all
  2275. 1:22:27click. We'll put them to work in a real
  2276. 1:22:29scenario, cover what you really need to
  2277. 1:22:31know, and then finish up with a quick
  2278. 1:22:33debrief. Sound good? Let's go. All
  2279. 1:22:35right. First up, the security blind
  2280. 1:22:38spot. We have to understand the why
  2281. 1:22:40before we get to the what. I want you to
  2282. 1:22:42imagine this for a second. You get an
  2283. 1:22:44alert. A critical S3 bucket, the one
  2284. 1:22:47with all the sensitive customer data was
  2285. 1:22:49just made public. Your heart just stops,
  2286. 1:22:52right? The first questions screaming in
  2287. 1:22:55your mind are, "Who did this and when
  2288. 1:22:57did it happen?" Without the right tools,
  2289. 1:22:59you are totally flying blind. This is
  2290. 1:23:01the exact problem we're here to solve.
  2291. 1:23:04So, to solve mysteries like this, AWS
  2292. 1:23:06gives us two specialized detectives.
  2293. 1:23:09Let's meet them. Cloud Trail and AWS
  2294. 1:23:11Config. Now, they work together, but
  2295. 1:23:13you've got to understand they have very,
  2296. 1:23:15very different jobs. First up is Cloud
  2297. 1:23:17Trail. The easiest way to think about
  2298. 1:23:19Cloud Trail is that it's the official
  2299. 1:23:21recordkeeper. It's focused on the who,
  2300. 1:23:23what, and when. For every single action
  2301. 1:23:25taken in your account. You know,
  2302. 1:23:27anything that happens through an API
  2303. 1:23:28call. And in AWS, pretty much everything
  2304. 1:23:31is an API call. Cloudt trail is there
  2305. 1:23:34logging it. It's all about the actions.
  2306. 1:23:37And the way it works is actually
  2307. 1:23:39beautifully simple. So a user or maybe a
  2308. 1:23:42service makes an API call. Let's say run
  2309. 1:23:44instances to fire up an EC2. Cloud trail
  2310. 1:23:47immediately grabs all the details of
  2311. 1:23:49that call. who did it, what time it was,
  2312. 1:23:51their IP address. Then it just writes
  2313. 1:23:53that event into a log file and drops it
  2314. 1:23:55securely into an S3 bucket that you
  2315. 1:23:57control. It's just a non-stop
  2316. 1:23:59chronological paper trail of everything.
  2317. 1:24:02Okay, now for our second detective, AWS
  2318. 1:24:04config. And this is where it gets
  2319. 1:24:07interesting. If Cloud Trail is all about
  2320. 1:24:09the action, config is all about the
  2321. 1:24:11state of your resources. Its whole job
  2322. 1:24:14is to ask, hey, is this thing built
  2323. 1:24:16right? Is it configured according to my
  2324. 1:24:18rules? It's not watching the actions
  2325. 1:24:20happening. It's inspecting the results
  2326. 1:24:22of those actions. So, how does config do
  2327. 1:24:26its thing? Well, whenever a resource
  2328. 1:24:28changes, like a security group gets
  2329. 1:24:30updated, config swoops in and takes a
  2330. 1:24:32snapshot of its new setup. This snapshot
  2331. 1:24:35is called a configuration item. Then,
  2332. 1:24:38and this is the magic part, config looks
  2333. 1:24:40at that snapshot and compares it against
  2334. 1:24:42the rules you've defined, like, hey, no
  2335. 1:24:44security groups should allow port 22
  2336. 1:24:46open to the world. It then flags that
  2337. 1:24:48resource as either compliant or you
  2338. 1:24:50guessed it, non-compliant. Okay, this
  2339. 1:24:52slide right here, this is the whole
  2340. 1:24:54ballgame. This is what you really need
  2341. 1:24:56to lock in. Cloud trail is all about
  2342. 1:24:59actions, the API calls. It answers who
  2343. 1:25:02did what and when. It's for auditing and
  2344. 1:25:05forensics. AWS config on the other hand
  2345. 1:25:08is all about the resource state, its
  2346. 1:25:10configuration. It answers what does my
  2347. 1:25:12stuff look like right now and is it
  2348. 1:25:14compliant? It's for well compliance.
  2349. 1:25:17See, two different detectives, two
  2350. 1:25:19totally different jobs. All right, so
  2351. 1:25:21that's the technical breakdown. But to
  2352. 1:25:23make this difference really truly stick
  2353. 1:25:24in your brain, you can't beat a good
  2354. 1:25:26analogy. I want you to think of Cloud
  2355. 1:25:29Trail as your building's CCTV system. It
  2356. 1:25:31records every single thing that happens.
  2357. 1:25:34It sees who came in the door, what time
  2358. 1:25:35they came in, which door they used. It
  2359. 1:25:37doesn't care if they were supposed to be
  2360. 1:25:39there. It just records the facts. It
  2361. 1:25:41gives you an unchangeable chronological
  2362. 1:25:43video log of every single action. Now,
  2363. 1:25:46AWS Config, totally different job.
  2364. 1:25:49Config is the building inspector. The
  2365. 1:25:51inspector doesn't sit there watching the
  2366. 1:25:53CCTV tapes all day. Nope. They show up
  2367. 1:25:56with a clipboard and a checklist. Those
  2368. 1:25:58are your config rules. They walk through
  2369. 1:26:00the building and check its current state
  2370. 1:26:02against the building code. Is the fire
  2371. 1:26:04and zip locked? Are the sprinklers
  2372. 1:26:05working? They're assessing the state of
  2373. 1:26:07the building to see if it's up to code.
  2374. 1:26:09Okay. analogy locked in. Let's step out
  2375. 1:26:12of the building and get back into the
  2376. 1:26:13AWS console to see how our two
  2377. 1:26:15detectives work together on a realworld
  2378. 1:26:17resource. Let's take something super
  2379. 1:26:20common, an EC2 instance. Here's how
  2380. 1:26:22they'd split up the work. Cloud Trail is
  2381. 1:26:24going to tell you who made the run
  2382. 1:26:26instances API call to launch it or who
  2383. 1:26:28ran stop instances to shut it down. It's
  2384. 1:26:30tracking the verbs, the actions. AWS
  2385. 1:26:33config, meanwhile, is checking the
  2386. 1:26:35adjectives, the state. It's answered
  2387. 1:26:37questions like, "Is this a T2 micro like
  2388. 1:26:39our policy says it should be? Does it
  2389. 1:26:40have the project blue tag? Is the
  2390. 1:26:42storage attached to it encrypted?" All
  2391. 1:26:44right, time for a quick mini scenario. A
  2392. 1:26:48developer, maybe they're trying to speed
  2393. 1:26:50something up, changes a small T2.micro
  2394. 1:26:53test instance into a monstrously
  2395. 1:26:54expensive M5.24x
  2396. 1:26:57large. This totally violates your
  2397. 1:26:59company's policy on which instance types
  2398. 1:27:01you're allowed to use for development.
  2399. 1:27:03So, which service tells you what? Take a
  2400. 1:27:06second. Which one tells you that the
  2401. 1:27:07modify instance attribute API call was
  2402. 1:27:09made by that developer at 2:15 in the
  2403. 1:27:11afternoon? Well, that's the action,
  2404. 1:27:13right? So that's cloud trail. And which
  2405. 1:27:15service tells you that the EC2 instance
  2406. 1:27:17is now in a non-compliant state because
  2407. 1:27:18its instance type is wrong? That's the
  2408. 1:27:20state. So that's AWS Compig. You see,
  2409. 1:27:22this shows you perfectly why you need
  2410. 1:27:24both to get the whole story. Okay. Now
  2411. 1:27:26that you actually get how they work and
  2412. 1:27:28why they're different, let's just
  2413. 1:27:30crystallize this into the core concepts
  2414. 1:27:32you're going to need, whether it's for
  2415. 1:27:33an exam or just a design review at work,
  2416. 1:27:36let's just hammer these home. Cloudtrail
  2417. 1:27:38is for auditing API activity. Full stop.
  2418. 1:27:41AWS config is for checking resource
  2419. 1:27:43compliance and looking at configuration
  2420. 1:27:44history. Cloudtrail answers the
  2421. 1:27:46question, who did that? Config answers,
  2422. 1:27:48is this thing configured correctly? And
  2423. 1:27:50maybe most importantly, in the real
  2424. 1:27:52world, you almost always use them
  2425. 1:27:54together to get that complete security
  2426. 1:27:55picture. Now, let's talk about the
  2427. 1:27:57classic exam trap, cuz they love to do
  2428. 1:28:00this. They will write questions to try
  2429. 1:28:02and make you mix these two up. So,
  2430. 1:28:05here's your mental trigger. If the
  2431. 1:28:06question is asking about auditing an
  2432. 1:28:08action or finding out who did something,
  2433. 1:28:11you should immediately think cloud
  2434. 1:28:13trail. If the question is about
  2435. 1:28:14evaluating compliance or checking if a
  2436. 1:28:17resource meets a certain configuration,
  2437. 1:28:19your brain should go straight to AWS
  2438. 1:28:21config. Action versus compliance. That's
  2439. 1:28:24the whole game.
  2440. 1:28:25Fantastic. Let's wrap this whole thing
  2441. 1:28:27up with a super quick debrief just to
  2442. 1:28:29make sure this knowledge is locked in
  2443. 1:28:31for good. Just remember our two
  2444. 1:28:33detectives. You've got Cloud Trail, the
  2445. 1:28:35event detective. That's your CCTV just
  2446. 1:28:38watching everything that happens. And
  2447. 1:28:40you've got AWS Config, the compliance
  2448. 1:28:42inspector. That's your building
  2449. 1:28:44inspector checking to make sure
  2450. 1:28:45everything is in order. And when you use
  2451. 1:28:47them together, you get the complete
  2452. 1:28:49story. Cloud trail tells you the action
  2453. 1:28:52that took place and config tells you
  2454. 1:28:54about the resulting state and whether or
  2455. 1:28:56not that state is okay. That right there
  2456. 1:28:59is total visibility. So the last
  2457. 1:29:02question I'll leave you with is this.
  2458. 1:29:04Now that you have your detectives and
  2459. 1:29:05you know the unique evidence that each
  2460. 1:29:07one provides, how are you going to use
  2461. 1:29:09them together? Not just to solve
  2462. 1:29:10problems after they happen, but to
  2463. 1:29:12proactively design and build truly
  2464. 1:29:14secure and compliant architectures from
  2465. 1:29:16day one. Let's talk about one of the
  2466. 1:29:18most fundamental concepts in AWS.
  2467. 1:29:21Multi-AZ versus multi-reion. And trust
  2468. 1:29:24me, understanding this isn't just about
  2469. 1:29:26passing an exam. It's about knowing how
  2470. 1:29:28to build something that doesn't fall
  2471. 1:29:29over when things go wrong. Let's dig in.
  2472. 1:29:32Okay, picture this. It's 3:00 a.m. and
  2473. 1:29:34your phone starts buzzing. The site is
  2474. 1:29:36down. The database is gone. Your app is
  2475. 1:29:38completely offline. What you do in that
  2476. 1:29:41moment was actually decided months ago
  2477. 1:29:43by the design choices you made. And that
  2478. 1:29:45is what we're going to break down today.
  2479. 1:29:47So before we can build stuff that
  2480. 1:29:49doesn't break, we got to know what we're
  2481. 1:29:50building with, right? AWS gives us two
  2482. 1:29:53fundamental building blocks for
  2483. 1:29:54resilience. Availability zones and
  2484. 1:29:56regions. Let's start there. All right.
  2485. 1:29:59First up, regions. A region is super
  2486. 1:30:01simple. Just think of a big physical
  2487. 1:30:03location on a map. You know, like US
  2488. 1:30:05East1 in North Virginia or EU West One
  2489. 1:30:08in Ireland. The key thing to remember is
  2490. 1:30:10that each region is completely separate
  2491. 1:30:12and isolated from all the others. This
  2492. 1:30:14is your biggest highest level of
  2493. 1:30:16protection. Okay, so now let's zoom in.
  2494. 1:30:19Inside every single one of those
  2495. 1:30:21regions, AWS has these things called
  2496. 1:30:23availability zones or A's. Now, here's
  2497. 1:30:26the crucial part. An A is basically a
  2498. 1:30:28data center or maybe a few of them
  2499. 1:30:30bundled together. And every A is
  2500. 1:30:32physically separate from the other A's
  2501. 1:30:34in that same region. They've got their
  2502. 1:30:36own power, their own networking,
  2503. 1:30:37everything. They're built to be close
  2504. 1:30:39enough to talk to each other super fast,
  2505. 1:30:41but far enough apart so that if, say, a
  2506. 1:30:43fire or a flood hits one, the others are
  2507. 1:30:45totally fine. So, how do we actually use
  2508. 1:30:48these things? Well, think of it like
  2509. 1:30:50leveling up your app's defenses. Level
  2510. 1:30:52one, you stick everything on a single
  2511. 1:30:54server in one A. Super fragile, right?
  2512. 1:30:56If that one data center goes down,
  2513. 1:30:58you're toast. So, you level up. You
  2514. 1:31:00spread your servers across multiple AZs
  2515. 1:31:02in the same region. Now, we're talking.
  2516. 1:31:04This is what we call high availability.
  2517. 1:31:06But what if you need the ultimate
  2518. 1:31:07protection? Well, you level up one more
  2519. 1:31:09time and replicate your entire setup to
  2520. 1:31:11a different region. This is for true
  2521. 1:31:13disaster recovery. Okay, that's the
  2522. 1:31:15technical stuff. But to really make this
  2523. 1:31:17click, I've got a super simple analogy
  2524. 1:31:20for you that you'll probably never
  2525. 1:31:21forget. It's all about stores. This is
  2526. 1:31:24the easiest way to lock this in your
  2527. 1:31:25brain. A multi-AZ setup. That's like one
  2528. 1:31:28big grocery store with a bunch of
  2529. 1:31:29checkout lanes. If one cash register
  2530. 1:31:31breaks down, eh, no big deal. People
  2531. 1:31:33just move to the next one. the store
  2532. 1:31:35stays open. That's high availability.
  2533. 1:31:38Now, multi-reion, that's like a national
  2534. 1:31:40chain of grocery stores. If the entire
  2535. 1:31:42store in New York gets wiped out by a
  2536. 1:31:44hurricane, the business doesn't die.
  2537. 1:31:46Why? Cuz they still have stores open in
  2538. 1:31:48California and Texas. That, my friends,
  2539. 1:31:50is disaster recovery. All right, so the
  2540. 1:31:53theory makes sense, but how does this
  2541. 1:31:55actually work with real AWS services?
  2542. 1:31:57Because as the architect, you're the one
  2543. 1:31:59making these calls. Let's see what this
  2544. 1:32:01looks like in practice. This is so
  2545. 1:32:04important to get right. Resilience isn't
  2546. 1:32:06always automatic. Take something like
  2547. 1:32:08RDS, the database service. Getting
  2548. 1:32:10multi-AZ protection is literally just a
  2549. 1:32:13checkbox. You click it and AWS handles
  2550. 1:32:16all the magic. But for something like
  2551. 1:32:17EC2 instances, your virtual servers,
  2552. 1:32:20it's on you. You have to actually launch
  2553. 1:32:22instances in different as a load
  2554. 1:32:25balancer to spread the traffic. And S3
  2555. 1:32:27is kind of special. By default, it's
  2556. 1:32:28already multi-AZ. Your data is
  2557. 1:32:30automatically safe across multiple data
  2558. 1:32:32centers. But if you need multi-reion
  2559. 1:32:34protection, yep, that's on you again.
  2560. 1:32:36You have to go in and configure cross
  2561. 1:32:38region replication. And this really is
  2562. 1:32:40the key takeaway here. AWS provides
  2563. 1:32:43these incredible building blocks, but
  2564. 1:32:45you're the architect. You draw the
  2565. 1:32:48blueprint. The choices you make are what
  2566. 1:32:50will decide if your app survives when
  2567. 1:32:52things go wrong. Okay, let's put this
  2568. 1:32:54into a real world scenario. Let's say a
  2569. 1:32:57massive power grid failure takes down an
  2570. 1:32:59entire availability zone. Poof, it's
  2571. 1:33:01gone. But your company's database, which
  2572. 1:33:03is running on RDS, just keeps going.
  2573. 1:33:06Your app stays online. Users don't
  2574. 1:33:08notice a thing. It's like magic. So,
  2575. 1:33:11who's the hero here? Who gets the credit
  2576. 1:33:13for that save? Was it all AWS magic, or
  2577. 1:33:16was it you? The answer, it's a team
  2578. 1:33:19effort. It's a partnership. See, AWS did
  2579. 1:33:22the really hard part. They built the
  2580. 1:33:24physically separate data centers. They
  2581. 1:33:26engineered the automatic failover for
  2582. 1:33:28RDS. All that complex stuff, but none of
  2583. 1:33:31that would have done you any good if you
  2584. 1:33:32hadn't made that one crucial decision to
  2585. 1:33:34click the enable multi-AZ button when
  2586. 1:33:36you set it up. Your choice. Unlock the
  2587. 1:33:38power that AWS built. All right, now
  2588. 1:33:40that you really get the concept, let's
  2589. 1:33:42boil this down to the absolute must know
  2590. 1:33:45points. This is the stuff that will
  2591. 1:33:46really help you nail this, whether it's
  2592. 1:33:48on an exam or in a design discussion.
  2593. 1:33:51Here it is, plain and simple. When you
  2594. 1:33:53see words like high availability or you
  2595. 1:33:55need to survive a single data center
  2596. 1:33:57failing, your brain should just scream
  2597. 1:33:59multi-AZ. But if you see words like
  2598. 1:34:02disaster recovery or you're planning for
  2599. 1:34:04a massive event like an earthquake that
  2600. 1:34:06could take out a whole region, now
  2601. 1:34:08you're talking multi-reion. Another huge
  2602. 1:34:11difference here is how fast you can
  2603. 1:34:13recover. We talk about this with two
  2604. 1:34:15terms, RTO and RPO. Just think of it
  2605. 1:34:18like this. RTO is how much time can we
  2606. 1:34:22be down and RPO is how much data can we
  2607. 1:34:25lose. With multiAZ the failover is super
  2608. 1:34:28fast and automatic. So your downtime is
  2609. 1:34:30seconds and you lose basically zero
  2610. 1:34:33data. With multi-reion it's a much
  2611. 1:34:35bigger deal to switch over. So you're
  2612. 1:34:36looking at minutes maybe even hours of
  2613. 1:34:38downtime. And watch out because here
  2614. 1:34:41comes the classic exam trap. They'll
  2615. 1:34:43give you a scenario where you need to
  2616. 1:34:44survive one data center failing and one
  2617. 1:34:47of the answers will be multi-reion. It
  2618. 1:34:49sounds impressive, right? But it's
  2619. 1:34:51totally wrong. It's expensive, complex
  2620. 1:34:54overkill. Remember our analogy? It's
  2621. 1:34:56like calling in a SWAT team because one
  2622. 1:34:58cash register broke. For a single a
  2623. 1:35:00failure, multi-AZ is always the right
  2624. 1:35:03and most cost-effective answer. Okay,
  2625. 1:35:06time for the 30 secondond summary. If
  2626. 1:35:08you walk away with just one thing, make
  2627. 1:35:10it this. Multi-AZ, that's your multiple
  2628. 1:35:13checkout lanes in one store. It's for
  2629. 1:35:15high availability. It keeps you online
  2630. 1:35:17if one data center fails. Multi-reion,
  2631. 1:35:20that's your national chain of stores.
  2632. 1:35:22It's for disaster recovery. It saves
  2633. 1:35:23your business if an entire city-sized
  2634. 1:35:25region goes dark. So now you've got the
  2635. 1:35:28tools and the choice is yours. Think
  2636. 1:35:30about it. Does a small local banking app
  2637. 1:35:32need the same level of protection as a
  2638. 1:35:34global streaming service that millions
  2639. 1:35:36of people are watching right now?
  2640. 1:35:38Deciding where to draw that line? Well,
  2641. 1:35:40that's what being a great cloud
  2642. 1:35:41architect is all about. All right, let's
  2643. 1:35:44talk about one of the most important
  2644. 1:35:45concepts you'll ever come across in
  2645. 1:35:47cloud computing. High availability.
  2646. 1:35:50We're going to go from zero to building
  2647. 1:35:51something that is practically
  2648. 1:35:53unbreakable. Okay, picture this. Your
  2649. 1:35:56app just blew up. It's a massive hit.
  2650. 1:35:58You're trending. Millions of people are
  2651. 1:36:00signing up. And then it all just stops.
  2652. 1:36:03Your dashboard goes red. Twitter is
  2653. 1:36:05exploding with complaints. and every
  2654. 1:36:07second it's down, you're losing money.
  2655. 1:36:10This is the exact nightmare scenario
  2656. 1:36:12that high availability is built to
  2657. 1:36:14prevent. So, let's really dig in here.
  2658. 1:36:17What even is high availability? You hear
  2659. 1:36:19this term thrown around all the time,
  2660. 1:36:21but let's break down what it actually
  2661. 1:36:22means and more importantly, why you
  2662. 1:36:25absolutely have to understand it. At its
  2663. 1:36:27heart, it's super simple. Look, things
  2664. 1:36:30are going to break. Servers fail.
  2665. 1:36:32Networks go down. That's a guarantee.
  2666. 1:36:34High availability isn't about stopping
  2667. 1:36:36failure. It's about building a system so
  2668. 1:36:38tough that when one piece breaks, your
  2669. 1:36:40users have no idea. The show just goes
  2670. 1:36:42on. So, how do we actually build
  2671. 1:36:46something that resilient? Let's do it
  2672. 1:36:48right now, step by step, starting from
  2673. 1:36:50the most basic setup imaginable. First
  2674. 1:36:53things first, you got to know your
  2675. 1:36:55enemy. And in our world, the big bad is
  2676. 1:36:57something called a single point of
  2677. 1:36:59failure. Think of it like the one Jenga
  2678. 1:37:02block that if you pull it, the whole
  2679. 1:37:03tower comes crashing down. Our entire
  2680. 1:37:06job is to find and get rid of these.
  2681. 1:37:09Okay, so here's our starting point. One
  2682. 1:37:11lonely server. It's running your
  2683. 1:37:13website, your database, the whole
  2684. 1:37:15shebang. It looks clean, simple. But
  2685. 1:37:17what's the glaring problem here? I mean,
  2686. 1:37:20what's wrong with this picture? You got
  2687. 1:37:22it. If that one server hiccups, the
  2688. 1:37:25power supply dies, the disc fails,
  2689. 1:37:27whatever, your whole app is toast, dead
  2690. 1:37:30in the water. That server is the
  2691. 1:37:32definition of a single point of failure.
  2692. 1:37:35Okay, so the obvious fix, right? Let's
  2693. 1:37:37just add a second server. We've got a
  2694. 1:37:39backup now. We have redundancy. Awesome.
  2695. 1:37:42But wait a minute. This creates a new
  2696. 1:37:45problem. How does traffic from the
  2697. 1:37:47internet know which server to go to? How
  2698. 1:37:49do we balance the load? And that is
  2699. 1:37:51where a load balancer comes in. It's
  2700. 1:37:54literally a traffic cop for your
  2701. 1:37:55application. It stands out front and it
  2702. 1:37:58directs all the incoming user requests
  2703. 1:38:00to your healthy servers. And it's smart,
  2704. 1:38:03too. If it notices one server is sick or
  2705. 1:38:05offline, it just stops sending traffic
  2706. 1:38:07there. Problem solved, right? Well, not
  2707. 1:38:10quite. Okay, so we're feeling pretty
  2708. 1:38:13smart. We can survive a server dying.
  2709. 1:38:15But let's zoom out a bit. What if it's
  2710. 1:38:17not just one server? What if the whole
  2711. 1:38:19building they're both sitting in gets
  2712. 1:38:21hit by a backhoe and loses its network
  2713. 1:38:23connection? And this, my friends, is
  2714. 1:38:25where AWS's global infrastructure is
  2715. 1:38:28just genius. They had this concept
  2716. 1:38:30called availability zones or AZ. Now,
  2717. 1:38:33here's the absolute key you have to
  2718. 1:38:35remember. An A is one or more data
  2719. 1:38:38centers, but it's physically separate
  2720. 1:38:39from other A's. We're talking different
  2721. 1:38:41power grids, different flood planes,
  2722. 1:38:43often miles apart. They are designed to
  2723. 1:38:45be isolated from each other's failures.
  2724. 1:38:48So, what's the move? It's simple. You
  2725. 1:38:50put server one in a server 2 over in AB.
  2726. 1:38:54Our load balancer is smart enough to see
  2727. 1:38:56both of them. Now, if a fire, flood, or
  2728. 1:38:59power outage takes all of a offline, who
  2729. 1:39:01cares? The load balancer detects it
  2730. 1:39:03instantly and sends 100% of the traffic
  2731. 1:39:06over to the healthy server in ACB. Your
  2732. 1:39:08users have no idea anything even
  2733. 1:39:10happened. That right there is the core
  2734. 1:39:13of high availability on AWS. Okay, I
  2735. 1:39:15know that was a little technical, so
  2736. 1:39:17let's use a super simple analogy to make
  2737. 1:39:19this concept stick in your brain for
  2738. 1:39:21good. Imagine you're running a
  2739. 1:39:23restaurant. If you have just one cook
  2740. 1:39:25and he calls in sick, your restaurant is
  2741. 1:39:27closed for the day. That's a single
  2742. 1:39:29point of failure. So what do you do? You
  2743. 1:39:31hire a second cook. That's redundancy.
  2744. 1:39:34You also get a manager to shout out the
  2745. 1:39:36orders, making sure both cooks stay
  2746. 1:39:38busy. That manager is your load
  2747. 1:39:40balancer. But here's the real pro move.
  2748. 1:39:42You put those two cooks in two
  2749. 1:39:44completely separate, fully equipped
  2750. 1:39:45pitch across town from each other. Now,
  2751. 1:39:48if one kitchen has a power outage, the
  2752. 1:39:50other one just keeps on cooking. That's
  2753. 1:39:52what having multiple availability zones
  2754. 1:39:54is like. All right, now that you get the
  2755. 1:39:56idea, let's bring it back to AWS because
  2756. 1:39:59this is so important. Your job, your
  2757. 1:40:02responsibility changes depending on the
  2758. 1:40:04service you're using. Okay, check this
  2759. 1:40:07out. For something like EC2, you know,
  2760. 1:40:09your basic virtual servers, AWS handles
  2761. 1:40:11the physical stuff, the data centers
  2762. 1:40:13themselves, but it's on you to actually
  2763. 1:40:15launch your servers in different AS load
  2764. 1:40:18balancer. Now, move over to a managed
  2765. 1:40:20service like RDS, the database service.
  2766. 1:40:23Your life gets way easier. You literally
  2767. 1:40:25just check a box that says multi-AZ and
  2768. 1:40:28AWS does all the hard work for you
  2769. 1:40:30behind the scenes and then you get to a
  2770. 1:40:32service like S3 for storage and you do
  2771. 1:40:35nothing. It's just built to be highly
  2772. 1:40:36available from the get- go. See the
  2773. 1:40:38pattern? The more AWS manages for you,
  2774. 1:40:41the less HA work you have to do
  2775. 1:40:43yourself. Okay, let's put this to the
  2776. 1:40:45test with a little real world scenario.
  2777. 1:40:47This is exactly the kind of critical
  2778. 1:40:49thinking you need. Here's the situation.
  2779. 1:40:51Your app is running on a bunch of EC2
  2780. 1:40:53servers, but to save a little time, you
  2781. 1:40:55put them all on a single availability
  2782. 1:40:57zone. Let's say US East 1A. A freak
  2783. 1:40:59storm comes through and knocks that one
  2784. 1:41:01easy offline. Your app is down. The
  2785. 1:41:04question is, whose fault is it? Yours or
  2786. 1:41:07AWS's? The tough answer? It's on you.
  2787. 1:41:10This is the classic shared
  2788. 1:41:11responsibility model. AWS is responsible
  2789. 1:41:14for the cloud. They make sure the
  2790. 1:41:16physical data centers have power and
  2791. 1:41:17cooling, but you are responsible for
  2792. 1:41:19your architecture in the cloud. They
  2793. 1:41:22gave you all the tools, multiple A's,
  2794. 1:41:24load balancers to survive this exact
  2795. 1:41:27kind of failure. It was your job as the
  2796. 1:41:29architect to use them. Okay, we've gone
  2797. 1:41:32from zero to hopefully a pretty solid
  2798. 1:41:34understanding. Now, let's boil it all
  2799. 1:41:36down to the absolute key points you need
  2800. 1:41:39to have locked in. Look, if a question
  2801. 1:41:42mentions high availability, your brain
  2802. 1:41:44should immediately scream multiple
  2803. 1:41:46availability zones. It's that simple.
  2804. 1:41:48Your goal is always to hunt down and
  2805. 1:41:50kill single points of failure. And your
  2806. 1:41:52main weapon for that is an elastic load
  2807. 1:41:54balancer spreading traffic across at
  2808. 1:41:56least two A's. And here's a super
  2809. 1:41:58important distinction. AZs are for high
  2810. 1:42:00availability. Regions are for disaster
  2811. 1:42:03recovery. Totally different concepts for
  2812. 1:42:05totally different problems. And watch
  2813. 1:42:07out for this classic trap. They'll ask
  2814. 1:42:10for a highly available database
  2815. 1:42:11solution. They'll give you an option for
  2816. 1:42:13a really big, expensive, powerful RDS
  2817. 1:42:16instance, but it's only in one A. That's
  2818. 1:42:19the wrong answer. The correct answer is
  2819. 1:42:21always the one that says multi-AZ, even
  2820. 1:42:23if the server itself is smaller. High
  2821. 1:42:26availability comes from redundancy
  2822. 1:42:27across failure domains, not from a
  2823. 1:42:29bigger box. So, let's wrap this all up
  2824. 1:42:31with a simple mantra we use in the real
  2825. 1:42:33world. One is none. Two is one. If you
  2826. 1:42:37only have one of something, you really
  2827. 1:42:38have nothing because it's just waiting
  2828. 1:42:40to fail. To be truly resilient, you
  2829. 1:42:42always need at least two, running in at
  2830. 1:42:44least two availability zones. So, there
  2831. 1:42:46you have it. You now know how to build
  2832. 1:42:48an application that can survive an
  2833. 1:42:50entire data center campus disappearing
  2834. 1:42:52without your users ever noticing.
  2835. 1:42:54>> All right, if you're building anything
  2836. 1:42:56serious in AWS, you have got to master
  2837. 1:42:58load balancing. Seriously, it is the key
  2838. 1:43:00to handling a flood of traffic and
  2839. 1:43:02making sure your app doesn't just fall
  2840. 1:43:04over. So, we're going to break down the
  2841. 1:43:06big three: application, network, and
  2842. 1:43:08gateway load balancers. By the end of
  2843. 1:43:10this, you'll know exactly which one to
  2844. 1:43:12use, and more importantly, you'll know
  2845. 1:43:13why. Okay, so just picture this for a
  2846. 1:43:16second. You've been working on your app
  2847. 1:43:18for months. You finally launch it, and
  2848. 1:43:21boom, overnight, it just explodes. It's
  2849. 1:43:25trending. It's on the news. And millions
  2850. 1:43:27of users are trying to get in. I mean,
  2851. 1:43:29this is the dream, right? Well, that
  2852. 1:43:32dream can turn into a total nightmare in
  2853. 1:43:34about 5 seconds. So, what's happening
  2854. 1:43:36behind the scenes? All of that traffic,
  2855. 1:43:38every single one of those million users
  2856. 1:43:41is hammering one single lonely server.
  2857. 1:43:44Things start to slow down. Pages are
  2858. 1:43:46just spinning. And then poof, it's gone.
  2859. 1:43:50The server crashes. And just like that,
  2860. 1:43:52your huge success story becomes a
  2861. 1:43:54cautionary tale about an app that
  2862. 1:43:56couldn't handle the spotlight. And that
  2863. 1:43:58right there is the core problem we're
  2864. 1:44:00here to solve. It's what we call a
  2865. 1:44:02single point of failure. If that one
  2866. 1:44:04server goes down, your entire
  2867. 1:44:06application goes down with it. There's
  2868. 1:44:08no backup, no plan B. It's basically a
  2869. 1:44:10house of cards just waiting for a tiny
  2870. 1:44:12gust of wind. So, how do we fix this?
  2871. 1:44:15Enter the hero of our story, the load
  2872. 1:44:18balancer. The easiest way to think about
  2873. 1:44:20it is as the ultimate traffic cop
  2874. 1:44:22standing at the front door of your
  2875. 1:44:23application. Its job sounds simple, but
  2876. 1:44:25it is absolutely critical. It takes all
  2877. 1:44:28those incoming requests and smartly
  2878. 1:44:30hands them out across a whole team of
  2879. 1:44:32servers. So, what's it actually doing?
  2880. 1:44:34It's really just a simple three-step
  2881. 1:44:36dance happening over and over. Step one,
  2882. 1:44:39a request comes in. Step two, it does a
  2883. 1:44:42super quick health check on all its
  2884. 1:44:43servers to see who's ready for work. And
  2885. 1:44:46step three, it sends the request to a
  2886. 1:44:48server that's healthy and available. And
  2887. 1:44:50it does this millions of times, keeping
  2888. 1:44:52everything perfectly balanced.
  2889. 1:44:54Now, to really make the different types
  2890. 1:44:56of AWS load balancers stick in your
  2891. 1:44:58head, we're going to use an analogy,
  2892. 1:45:00let's imagine your application is a
  2893. 1:45:02brand new, incredibly popular
  2894. 1:45:04restaurant, and there's a huge line out
  2895. 1:45:06the door. Okay, so at the front of this
  2896. 1:45:09restaurant, the big difference is how
  2897. 1:45:10smart the person greeting you is. First,
  2898. 1:45:13you have the simple host. This is our
  2899. 1:45:14layer 4 guy. All he cares about is the
  2900. 1:45:17size of your party, your IP address, and
  2901. 1:45:18port, and he just points you to the very
  2902. 1:45:20first empty table he sees. He's super
  2903. 1:45:22fast but not very clever. This is your
  2904. 1:45:24network load balancer. But then you have
  2905. 1:45:26the sophisticated matra. This is our
  2906. 1:45:28layer 7 pro. He looks at your
  2907. 1:45:30reservation details, the specific URL
  2908. 1:45:32you're trying to visit, and finds the
  2909. 1:45:34perfect table for you. Maybe in the
  2910. 1:45:35quiet section or by the window. He's
  2911. 1:45:37much smarter. This is your application
  2912. 1:45:39load balancer. And what about that third
  2913. 1:45:42one, the gateway load balancer? Well,
  2914. 1:45:44this person isn't trying to see you at
  2915. 1:45:46all. Think of this one as the security
  2916. 1:45:49guard at the front door. Their entire
  2917. 1:45:51job is to check your ID and inspect what
  2918. 1:45:53you're carrying before you even get a
  2919. 1:45:55chance to talk to the host or the matra.
  2920. 1:45:57So that restaurant analogy is pretty
  2921. 1:45:59helpful, right? But now let's get
  2922. 1:46:02practical. We need to map this directly
  2923. 1:46:04to the real AWS services so you know
  2924. 1:46:06exactly when to hire the simple host,
  2925. 1:46:08the smart mitrad or the security guard
  2926. 1:46:10for your own architecture. This table
  2927. 1:46:13right here really pulls it all together.
  2928. 1:46:15You've got our miter d the application
  2929. 1:46:16load balancer operating way up at layer
  2930. 1:46:187 where it can understand the language
  2931. 1:46:20of the web HTTP and HTTPS. Then you have
  2932. 1:46:23our simple host the network load
  2933. 1:46:25balancer down at layer 4 dealing with
  2934. 1:46:27raw TCP and UDP connections for maximum
  2935. 1:46:30speed. And finally you have our security
  2936. 1:46:32guard the gateway load balancer working
  2937. 1:46:34at the foundation layer 3 where it can
  2938. 1:46:36inspect every single IP packet. Okay so
  2939. 1:46:39each of these has its own superpower.
  2940. 1:46:41The AOB's special power is something
  2941. 1:46:43called contentbased routing. And this is
  2942. 1:46:45a huge deal for modern apps. It can
  2943. 1:46:47literally read the URL and say, "Oh,
  2944. 1:46:50you're asking for SL images. You go over
  2945. 1:46:52to this group of servers. Oh, you're
  2946. 1:46:54asking for SL API. You need to go to
  2947. 1:46:56this other group of servers." This
  2948. 1:46:58intelligence is exactly why it's the
  2949. 1:46:59go-to choice for things like
  2950. 1:47:00microservices. Now, the NLB's superpower
  2951. 1:47:03isn't about being smart. It's about
  2952. 1:47:05being insanely fast. We are talking raw
  2953. 1:47:09bruteforce performance handling millions
  2954. 1:47:10of requests a second with almost no
  2955. 1:47:12latency. Its other killer feature is
  2956. 1:47:15that it gives you a static IP address
  2957. 1:47:17for things like gaming or any system
  2958. 1:47:19that needs a single predictable IP to
  2959. 1:47:21connect to. This is an absolute gamecher
  2960. 1:47:24and the GWLB its superpower is just
  2961. 1:47:28incredible. It's all about making
  2962. 1:47:30security seamless. It creates this
  2963. 1:47:33invisible checkpoint that forces all
  2964. 1:47:34your traffic coming in and going out
  2965. 1:47:37through a fleet of security appliances
  2966. 1:47:39like firewalls from other vendors. And
  2967. 1:47:41the best part, your application has no
  2968. 1:47:43idea this is even happening. No code
  2969. 1:47:46changes, nothing. It just works. All
  2970. 1:47:49right, theory is great, but let's put
  2971. 1:47:50this knowledge into practice with a
  2972. 1:47:52quick real world scenario. So imagine
  2973. 1:47:55the security team comes to you with a
  2974. 1:47:57new mandate. They say from now on, every
  2975. 1:48:00single packet of data entering our VPC
  2976. 1:48:03must be inspected by this fleet of third
  2977. 1:48:05party firewall appliances we just
  2978. 1:48:07bought. So what do you do? Which tool do
  2979. 1:48:10you reach for? You got it right. It has
  2980. 1:48:12to be the gateway load balancer. And
  2981. 1:48:15this little scenario perfectly explains
  2982. 1:48:16the AWS shared responsibility model.
  2983. 1:48:19It's a really important concept.
  2984. 1:48:21Basically, AWS is responsible for the
  2985. 1:48:24security of the cloud. That means making
  2986. 1:48:26sure the GWLB service itself is running,
  2987. 1:48:28secure, and available. But you are
  2988. 1:48:30responsible for security in the cloud.
  2989. 1:48:32That means it's your job to choose the
  2990. 1:48:34GWLB, configure it correctly, and manage
  2991. 1:48:36those firewalls.
  2992. 1:48:38Okay, we have covered a lot of ground.
  2993. 1:48:41So, let's just take a second and boil
  2994. 1:48:43all of this down to the absolute most
  2995. 1:48:46important things you need to remember.
  2996. 1:48:48Look, if you forget everything else,
  2997. 1:48:50just remember these three words. ALB is
  2998. 1:48:52for flexibility. It's the smart one for
  2999. 1:48:54web traffic. NLB is for performance.
  3000. 1:48:56It's the fast one for raw speed. And
  3001. 1:48:58GWLB is for inspection. It's the
  3002. 1:49:00security guard. Flexibility,
  3003. 1:49:02performance, inspection. Got it? Okay.
  3004. 1:49:05Before we wrap up, I want to give you a
  3005. 1:49:06heads up about the number one trap that
  3006. 1:49:08people fall into when they're thinking
  3007. 1:49:09about this stuff. Here's the trap.
  3008. 1:49:12People see web application or HTTP and
  3009. 1:49:14their brain immediately jumps to
  3010. 1:49:16application load balancer. I mean, it
  3011. 1:49:19makes sense, right? It's in the name.
  3012. 1:49:21But it's not always the right call. If
  3013. 1:49:22your web app is pretty simple and what
  3014. 1:49:24you really need is just face melting
  3015. 1:49:26speed or a permanent static IP address,
  3016. 1:49:29then the network load balancer might
  3017. 1:49:30actually be the better choice even for
  3018. 1:49:32web traffic. All right, one last time,
  3019. 1:49:35let's do a final super fast recap just
  3020. 1:49:38to make sure this is locked into your
  3021. 1:49:39brain. Think of this as your personal
  3022. 1:49:41cheat sheet. It really just comes down
  3023. 1:49:43to this. If you hear the words flexible
  3024. 1:49:45routing for web traffic or
  3025. 1:49:47microservices, your brain should be
  3026. 1:49:49screaming ALB. If you hear the
  3027. 1:49:51requirement for extreme speed, low
  3028. 1:49:52latency, or a static IP, you're thinking
  3029. 1:49:55NLB. And if you hear inspect all traffic
  3030. 1:49:57or third party security appliances, it
  3031. 1:49:59has got to be the GWLB. It's as simple
  3032. 1:50:02as that. So, let's go all the way back
  3033. 1:50:05to that viral app from the beginning.
  3034. 1:50:07That potential nightmare scenario. A
  3035. 1:50:09load balancer is the tool that turns it
  3036. 1:50:11into an incredible success story. It's
  3037. 1:50:13the foundation for building
  3038. 1:50:14architectures that don't fall over when
  3039. 1:50:16things get crazy. So the blueprint is
  3040. 1:50:19yours now.
  3041. 1:50:19>> Hey everyone and welcome to this
  3042. 1:50:21explainer. Today we're diving head first
  3043. 1:50:23into one of the absolute most critical
  3044. 1:50:25concepts in cloud computing and that's
  3045. 1:50:27autoscaling. Now we aren't just going to
  3046. 1:50:29sit here and memorize textbook
  3047. 1:50:31definitions today. Instead we're going
  3048. 1:50:33to build a rockolid intuitive
  3049. 1:50:34understanding of how resilient
  3050. 1:50:36architecture actually works out there in
  3051. 1:50:38the real world. By the end of this you
  3052. 1:50:40won't just know the cloud buzzwords.
  3053. 1:50:41You're going to understand the
  3054. 1:50:42underlying logic so well that you could
  3055. 1:50:44easily turn around and teach it to a
  3056. 1:50:45total beginner. So, picture this. You've
  3057. 1:50:48just launched a brand new app. You wake
  3058. 1:50:50up, grab your phone, and realize some
  3059. 1:50:52massive influencer just dropped a link
  3060. 1:50:54to your project. You're going viral.
  3061. 1:50:56Literally, millions of people are
  3062. 1:50:58flooding your site all at once. What
  3063. 1:51:00happens next? Well, in traditional IT,
  3064. 1:51:03your server CPU spikes to 100%. The
  3065. 1:51:06memory maxes out and boom, the server
  3066. 1:51:08crashes. Just like that, your huge viral
  3067. 1:51:11moment turns into a total disaster. This
  3068. 1:51:14terrifying, incredibly real world
  3069. 1:51:16nightmare is exactly why today's topic
  3070. 1:51:18matters so much. To make sure that
  3071. 1:51:20nightmare never happens to us, we need
  3072. 1:51:22to build what's known as a resilient
  3073. 1:51:24architecture. But you know, what does
  3074. 1:51:26that actually mean in plain English?
  3075. 1:51:28Simply put, a resilient architecture is
  3076. 1:51:30a system that can take a heavy punch and
  3077. 1:51:32just keep ticking. It gracefully handles
  3078. 1:51:34failure. And honestly, the most
  3079. 1:51:36important part is that it adapts to
  3080. 1:51:37changes in your workload dynamically. It
  3081. 1:51:40doesn't sit around waiting for a human
  3082. 1:51:41to wake up and step in. It reacts
  3083. 1:51:43automatically to keep the whole system
  3084. 1:51:45online no matter how chaotic the traffic
  3085. 1:51:47gets. Okay, let's dive into this. How do
  3086. 1:51:50we actually handle all that sudden extra
  3087. 1:51:52traffic? You basically have two choices
  3088. 1:51:54here. Vertical scaling or horizontal
  3089. 1:51:56scaling. Vertical scaling is taking your
  3090. 1:51:59one existing server and just making it
  3091. 1:52:01beefier. You know, giving it more RAM or
  3092. 1:52:03a faster CPU. It's kind of like ripping
  3093. 1:52:05out your car's engine to install a
  3094. 1:52:06bigger one. The problem? Well, there's
  3095. 1:52:08always a physical limit, and doing that
  3096. 1:52:10almost always requires taking your
  3097. 1:52:12system offline. Horizontal scaling, on
  3098. 1:52:14the other hand, just means adding more
  3099. 1:52:16servers to share the load. And in the
  3100. 1:52:18cloud, horizontal scaling is the
  3101. 1:52:20absolute undisputed champion because it
  3102. 1:52:22gives you virtually infinite elasticity.
  3103. 1:52:24If that still feels a little abstract,
  3104. 1:52:27just think of it like your local grocery
  3105. 1:52:28store. It's a Sunday afternoon, it's
  3106. 1:52:31super busy, and suddenly 50 people line
  3107. 1:52:33up to check out all at once. The store
  3108. 1:52:36manager doesn't pause the whole store to
  3109. 1:52:38build one giant super fast mega
  3110. 1:52:40register, right? Because that would be
  3111. 1:52:42vertical scaling. Instead, the manager
  3112. 1:52:44just gets on the intercom and calls more
  3113. 1:52:46cashiers to open up more lanes. That is
  3114. 1:52:48horizontal scaling. And the best part,
  3115. 1:52:51when the rush is finally over and the
  3116. 1:52:52store empties out, they close those
  3117. 1:52:54extra lanes and send the cashiers home.
  3118. 1:52:56So, they aren't paying people just to
  3119. 1:52:57stand around doing nothing. And this
  3120. 1:52:59brilliantly illustrates exactly how
  3121. 1:53:01things work in AWS. First up, we have
  3122. 1:53:03AWS Cloudatch. This acts as our
  3123. 1:53:05monitoring eyes, constantly watching for
  3124. 1:53:07that traffic spike. Second, Amazon EC2
  3125. 1:53:10autoscaling steps in as our store
  3126. 1:53:12manager, automatically launching new EC2
  3127. 1:53:14servers, which is essentially opening
  3128. 1:53:15those new lanes. But here's the really
  3129. 1:53:18critical third step, the application
  3130. 1:53:19load balancer, or ALB. Think of the ALB
  3131. 1:53:22as the traffic cop standing right at the
  3132. 1:53:24front doors. It evenly distributes all
  3133. 1:53:26those incoming users across your newly
  3134. 1:53:28opened servers, making sure no single
  3135. 1:53:30machine gets totally overwhelmed. Now,
  3136. 1:53:32it's really important to know that
  3137. 1:53:33scaling isn't just for those traditional
  3138. 1:53:35EC2 servers. As you start designing
  3139. 1:53:37resilient architectures, you're going to
  3140. 1:53:38see this elasticity everywhere. Like, if
  3141. 1:53:41you're using AWS Fargate for containers,
  3142. 1:53:43it scales automatically behind the
  3143. 1:53:44scenes. Or if you use AWS Lambda for
  3144. 1:53:47serverless functions, AWS can spin up
  3145. 1:53:49thousands of concurrent executions in a
  3146. 1:53:51matter of seconds and you don't have to
  3147. 1:53:52provision a single thing. Even databases
  3148. 1:53:54like Amazon Dynamob, they automatically
  3149. 1:53:57scale their read and write capacity
  3150. 1:53:58based on whatever the demand is.
  3151. 1:54:00Horizontal scaling really is the
  3152. 1:54:02heartbeat of the modern cloud. All
  3153. 1:54:04right, let's test your understanding
  3154. 1:54:05here with a quick scenario. Say you've
  3155. 1:54:08built your app. A massive traffic spike
  3156. 1:54:10hits out of nowhere, but your servers
  3157. 1:54:12end up crashing anyway because no new
  3158. 1:54:14instances actually spun up to help. Now,
  3159. 1:54:16the physical AWS data center, it was
  3160. 1:54:18working perfectly fine, but your app
  3161. 1:54:20still went down. So, who is responsible
  3162. 1:54:23here? Is it AWS's fault for not handing
  3163. 1:54:25over the servers when you needed them,
  3164. 1:54:27or is this your fault? Well, the answer
  3165. 1:54:29comes straight from the AWS shared
  3166. 1:54:31responsibility model. In this scenario,
  3167. 1:54:33you are responsible. Why? Because AWS
  3168. 1:54:36controls the physical hardware and the
  3169. 1:54:38global infrastructure. They make
  3170. 1:54:40absolutely sure the capacity is sitting
  3171. 1:54:41there ready to go, but you control the
  3172. 1:54:44architecture design. It's totally on you
  3173. 1:54:46to set the scaling metrics and define
  3174. 1:54:47the exact rules that trigger a scaleout
  3175. 1:54:49event. AWS gives you an endless supply
  3176. 1:54:51of cashiers for sure, but you have to be
  3177. 1:54:53the manager who actually tells them to
  3178. 1:54:55open the lanes. Now that you have a
  3179. 1:54:57solid grasp on how this all plays out in
  3180. 1:54:59the real world, let's quickly ground
  3181. 1:55:01ourselves in the official exam guide.
  3182. 1:55:03Everything we've been talking about
  3183. 1:55:04falls right into domain 2, specifically
  3184. 1:55:06task 2.1, which is all about designing
  3185. 1:55:09scalable and loosely coupled
  3186. 1:55:11architectures. You see, you aren't just
  3187. 1:55:13memorizing random services here. You are
  3188. 1:55:15actually learning how to fulfill the
  3189. 1:55:17core day-to-day requirements of a real
  3190. 1:55:19cloud architect. Okay, let's rapid fire
  3191. 1:55:22some key points you absolutely need to
  3192. 1:55:24lock in. First, decouple your workloads.
  3193. 1:55:26If your web tier and your database tier
  3194. 1:55:28are super tightly connected to each
  3195. 1:55:30other, they simply can't scale
  3196. 1:55:31independently. You've got to break them
  3197. 1:55:33apart. Second, autoscaling works way
  3198. 1:55:35better with stateless workloads. That
  3199. 1:55:37just means your server shouldn't be
  3200. 1:55:38saving user data locally. Think about
  3201. 1:55:40it. If a server scales in and gets
  3202. 1:55:42deleted to save money, you definitely
  3203. 1:55:43don't want to lose a user's active
  3204. 1:55:45shopping cart, right? You want to store
  3205. 1:55:46that state externally in a database. And
  3206. 1:55:49third, always know how to identify the
  3207. 1:55:51right metrics like CPU utilization to
  3208. 1:55:53actually trigger those scaling actions.
  3209. 1:55:55So a absolutely crucial point here
  3210. 1:55:58before we wrap up is to watch out for
  3211. 1:56:00this classic exam trap. They love to
  3212. 1:56:02test if you know the exact difference
  3213. 1:56:04between two services with very very
  3214. 1:56:07similar names. Listen closely. Amazon
  3215. 1:56:10EC2 autoscaling is a service
  3216. 1:56:12specifically just for scaling your EC2
  3217. 1:56:14virtual servers. But AWS autoscaling
  3218. 1:56:17that is a separate much broader service.
  3219. 1:56:20It lets you configure scaling for
  3220. 1:56:21multiple different resources like EC2,
  3221. 1:56:24DynamoB, and ECS all from one unified
  3222. 1:56:27dashboard. So read those questions super
  3223. 1:56:29carefully. Let's do a fast clean recap
  3224. 1:56:31to really cement this in your brain.
  3225. 1:56:33Number one, horizontal scaling is the
  3226. 1:56:35winner in the cloud. Add more instances.
  3227. 1:56:38Don't just try to build bigger ones.
  3228. 1:56:40Number two, automate your reactions. You
  3229. 1:56:43want to combine Cloudatch, EC2
  3230. 1:56:44autoscaling, and a load balancer so you
  3231. 1:56:47can survive crazy traffic spikes
  3232. 1:56:48completely automatically. And number
  3233. 1:56:50three, know your shared
  3234. 1:56:52responsibilities. AWS provides the
  3235. 1:56:54infinite resources, but it's up to you
  3236. 1:56:56to actually design the architecture that
  3237. 1:56:58uses them. And that brings us to our
  3238. 1:56:59final thought for this explainer. The
  3239. 1:57:01cloud has completely wiped out the
  3240. 1:57:03traditional hardware barriers. You don't
  3241. 1:57:05need to go buy a million dollars worth
  3242. 1:57:06of physical servers just to handle a
  3243. 1:57:08million users anymore. All you need is a
  3244. 1:57:10well-designed, highly resilient
  3245. 1:57:12architecture. So, if you literally have
  3246. 1:57:14the power to scale infinitely on demand,
  3247. 1:57:16what's stopping you from building the
  3248. 1:57:18next massive viral app right now? All
  3249. 1:57:20right, picture this. You're finally
  3250. 1:57:22launching your app to the world and it
  3251. 1:57:24goes viral. I mean, users are just
  3252. 1:57:26pouring in from everywhere. It's the
  3253. 1:57:28moment you've been waiting for. But
  3254. 1:57:30then, disaster strikes. Your European
  3255. 1:57:33users start complaining that the app
  3256. 1:57:35takes 10 full seconds to load. and then
  3257. 1:57:38your main database just completely
  3258. 1:57:39crashes under the pressure. Your app
  3259. 1:57:41goes totally dark. You are losing
  3260. 1:57:44thousands of dollars every single
  3261. 1:57:46minute. It is an absolute nightmare. And
  3262. 1:57:49you know what? It's exactly what happens
  3263. 1:57:51when you let the internet blindly decide
  3264. 1:57:53how traffic reaches your servers. To fix
  3265. 1:57:55this, we absolutely have to take control
  3266. 1:57:58of our traffic. We need Amazon Route 53.
  3267. 1:58:02So, what does Route 53 actually do?
  3268. 1:58:04Well, at its core, it's a domain name
  3269. 1:58:06system or DNS. I want you to think of it
  3270. 1:58:09like a massive global switchboard. When
  3271. 1:58:11someone types your website into their
  3272. 1:58:12phone, Route 53 is the operator that
  3273. 1:58:15connects them to the exact right server
  3274. 1:58:17IP address. But it's not just a basic
  3275. 1:58:19switchboard. It's incredibly smart. You
  3276. 1:58:21actually get to give this operator a set
  3277. 1:58:23of strict rules for exactly how to route
  3278. 1:58:25people. We call these rules routing
  3279. 1:58:27policies. Let's walk through how they
  3280. 1:58:29all work. Okay, we'll start with simple
  3281. 1:58:32routing. Basically, what it does is just
  3282. 1:58:34hand out the IP address for your server.
  3283. 1:58:36There's no special logic attached
  3284. 1:58:38whatsoever. So, why does it even exist?
  3285. 1:58:41Well, because sometimes you really just
  3286. 1:58:43have one single web server running a
  3287. 1:58:44simple blog. You just don't need fancy
  3288. 1:58:46global routing for that. Think of it
  3289. 1:58:49like a front desk receptionist at a
  3290. 1:58:51small office building. You walk in, you
  3291. 1:58:53ask for Dave, and they just point
  3292. 1:58:54directly to Dave's desk. Simple, right?
  3293. 1:58:56Because if you don't use it, you end up
  3294. 1:58:58over complicating a totally basic setup
  3295. 1:59:01and wasting your time configuring rules
  3296. 1:59:03you just don't need. Now, this is where
  3297. 1:59:04people mess up, though. They think
  3298. 1:59:06simple routing means it can only ever
  3299. 1:59:07return one single IP address. Actually,
  3300. 1:59:10scratch that. You can attach multiple IP
  3301. 1:59:12addresses to a simple record and route
  3302. 1:59:1453 will just hand them all back to the
  3303. 1:59:15user in a totally random order. But
  3304. 1:59:17there is a huge catch here. It does not
  3305. 1:59:20check if those servers are actually
  3306. 1:59:22awake or if they're dead. Now, here's
  3307. 1:59:24where things get really interesting. Let
  3308. 1:59:26me show you weighted routing. This
  3309. 1:59:28policy lets you split your incoming
  3310. 1:59:30traffic based on custom percentages. So,
  3311. 1:59:32you can send 80% of your traffic to
  3312. 1:59:34server A and 20% to server B. Why does
  3313. 1:59:37this exist? Think about that for a
  3314. 1:59:38second. Imagine you're rolling out a
  3315. 1:59:40massive, super complicated update to
  3316. 1:59:42your app. If you send a 100% of your
  3317. 1:59:44users to the brand new code on day one
  3318. 1:59:46and it breaks, your whole company is
  3319. 1:59:47offline. It's kind of like a bouncer at
  3320. 1:59:49a club directing 90% of the crowd into
  3321. 1:59:52the main room and then carefully letting
  3322. 1:59:54just 10% into a VIP room just to see if
  3323. 1:59:57it gets too crowded. If you don't use
  3324. 2:00:00weighted routing, you are basically
  3325. 2:00:02forced to push updates to everyone at
  3326. 2:00:04exactly the same time. And you just have
  3327. 2:00:06to pray nothing breaks. But with
  3328. 2:00:08weighted routing, you send 5% of traffic
  3329. 2:00:11to the new version. If it works
  3330. 2:00:12smoothly, you dial it up to 20, then 50,
  3331. 2:00:15then 100%. It's a real gamecher. Next up
  3332. 2:00:19is latency routing. This policy routes
  3333. 2:00:22your users to the AWS region that gives
  3334. 2:00:24them the absolute fastest response time.
  3335. 2:00:26Why do we need this? Because physical
  3336. 2:00:28data actually travels through cables
  3337. 2:00:30running under the ocean. If I'm sitting
  3338. 2:00:32in Tokyo and your server is all the way
  3339. 2:00:33in New York, that data has a very, very
  3340. 2:00:36long commute. Latency routing constantly
  3341. 2:00:38measures the network and actively finds
  3342. 2:00:40the absolute fastest path. It's exactly
  3343. 2:00:43like calling for a taxi and the
  3344. 2:00:45dispatcher automatically sending the car
  3345. 2:00:47that is physically closest to you right
  3346. 2:00:48now instead of one all the way across
  3347. 2:00:51town. If you don't use this, your global
  3348. 2:00:53users are going to get laggy, incredibly
  3349. 2:00:55frustrating experiences. All right,
  3350. 2:00:57let's talk about survival failover
  3351. 2:00:59routing. What this does is let you set a
  3352. 2:01:01primary server and a standby backup
  3353. 2:01:03server. If your primary server goes
  3354. 2:01:05down, Route 53 automatically flips the
  3355. 2:01:07switch and sends all your traffic
  3356. 2:01:09straight to the backup. Why does it
  3357. 2:01:10exist? Because let's face it, hardware
  3358. 2:01:12fails, the power goes out. This is
  3359. 2:01:15literally the backup generator for a
  3360. 2:01:17hospital. It just sits there quietly
  3361. 2:01:18until the main power dies and then boom,
  3362. 2:01:21it instantly kicks on so the lights stay
  3363. 2:01:23on. What happens if you don't use
  3364. 2:01:25failover? Well, a crash server means
  3365. 2:01:27your users just stare at an error screen
  3366. 2:01:29until you have to wake up at 3 in the
  3367. 2:01:30morning to fix it manually. And nobody
  3368. 2:01:33wants that. Okay, moving on. Let's look
  3369. 2:01:36at geoloccation routing. This one routes
  3370. 2:01:38traffic based on the actual physical
  3371. 2:01:40location of your user. We're talking
  3372. 2:01:42their specific country or even their
  3373. 2:01:43state. Why does this exist? Think about
  3374. 2:01:46legal borders and licensing constraints.
  3375. 2:01:49Now, imagine this scenario in your app.
  3376. 2:01:51You have the legal rights to stream a
  3377. 2:01:53movie in France, but you absolutely do
  3378. 2:01:55not have the rights in Germany. You need
  3379. 2:01:57a hard border. Geoloccation is like a
  3380. 2:02:00passport checkpoint at an airport. If
  3381. 2:02:02you have a French IP address, you go
  3382. 2:02:04right to the French servers. If you have
  3383. 2:02:06a German IP address, you are blocked
  3384. 2:02:08entirely or may be sent to a totally
  3385. 2:02:10different site. If you don't use this,
  3386. 2:02:11you could literally get sued for
  3387. 2:02:13broadcasting content where you legally
  3388. 2:02:15shouldn't. Geoproximity routing is next.
  3389. 2:02:17And honestly, this is usually the
  3390. 2:02:19concept where people finally go, "Oh,
  3391. 2:02:21okay. Now I get it. It sounds exactly
  3392. 2:02:24like geoloccation, but it is completely
  3393. 2:02:26different." Geoproximity routes traffic
  3394. 2:02:28based on where your servers are located,
  3395. 2:02:30but it lets you artificially shift
  3396. 2:02:32traffic using something called a bias.
  3397. 2:02:35Why does this exist? Well, let's say you
  3398. 2:02:37have a massive server farm in Texas and
  3399. 2:02:39just a tiny little one in New York. You
  3400. 2:02:41obviously don't want to split the US
  3401. 2:02:43traffic evenly between them. So, you add
  3402. 2:02:45a bias to the Texas server, making its
  3403. 2:02:47gravity stronger, so it pulls in more
  3404. 2:02:49users from across the entire country. It
  3405. 2:02:52basically acts like a giant magnet. You
  3406. 2:02:54make the Texas magnet bigger, so it
  3407. 2:02:56pulls more iron filings toward it.
  3408. 2:02:58Without it, your tiny New York server
  3409. 2:03:00gets completely overwhelmed and crushed
  3410. 2:03:02while your massive Texas servers just
  3411. 2:03:04sit there empty. Finally, we have
  3412. 2:03:06multialue answer routing. It acts
  3413. 2:03:08exactly like simple routing, meaning it
  3414. 2:03:11hands back a list of IP addresses to the
  3415. 2:03:13user, but it actually performs critical
  3416. 2:03:15health checks first. Why does this
  3417. 2:03:17exist? Because handing a user a
  3418. 2:03:19completely dead IP address, is just
  3419. 2:03:21terrible for business. It's exactly like
  3420. 2:03:23a restaurant host handing you a menu,
  3421. 2:03:26but making sure they cross off the items
  3422. 2:03:28that are sold out before they even give
  3423. 2:03:29it to you. If you don't use multialue,
  3424. 2:03:32Route 53 might literally send your users
  3425. 2:03:34to a server that is currently on fire.
  3426. 2:03:37All right, let's do a quick recap of the
  3427. 2:03:39whole shebang. Weighted is for testing
  3428. 2:03:41new versions. Latency is for pure speed.
  3429. 2:03:44Failover is for disaster backups.
  3430. 2:03:46Geoloccation is for hard borders and
  3431. 2:03:48compliance. Geoproximity is for server
  3432. 2:03:51gravity and shifting loads and multialue
  3433. 2:03:53is for returning a list of strictly
  3434. 2:03:55healthy servers. Now here are your three
  3435. 2:03:58exam bullets. First, if the scenario
  3436. 2:04:01talks about AB testing or blue green
  3437. 2:04:03deployments, the answer is always
  3438. 2:04:06weighted routing. Second, if the
  3439. 2:04:07requirement mentions compliance, legal
  3440. 2:04:10rights or localized languages, you
  3441. 2:04:12absolutely need geoloccation routing.
  3442. 2:04:14And third, if the question talks about
  3443. 2:04:16an active passive setup or disaster
  3444. 2:04:18recovery, the answer is always failover
  3445. 2:04:21routing. But before we wrap this
  3446. 2:04:23explainer up, we really need to talk
  3447. 2:04:25about the exam because there is one
  3448. 2:04:27massive trap they're definitely going to
  3449. 2:04:28use to trick you. Do not confuse latency
  3450. 2:04:31routing with geoloccation. The exam will
  3451. 2:04:33say something like, "A user lives in
  3452. 2:04:35South America. How do we give them the
  3453. 2:04:36fastest experience?" And people blindly
  3454. 2:04:39choose geoloccation just because the
  3455. 2:04:40question mentioned a physical location.
  3456. 2:04:42That is wrong. A user in Brazil might
  3457. 2:04:45actually have a much faster fiber optic
  3458. 2:04:46connection to a server in Miami than to
  3459. 2:04:48a server in South America. Latency only
  3460. 2:04:51cares about the fastest cable.
  3461. 2:04:52Geoloccation only cares about the map.
  3462. 2:04:54If it asks for speed, choose latency. So
  3463. 2:04:57look at your own architecture. Are you
  3464. 2:04:58routing your users based on where they
  3465. 2:05:00live or how fast they can actually reach
  3466. 2:05:02you? Because on the modern internet,
  3467. 2:05:03milliseconds are literally the
  3468. 2:05:05difference between a loyal customer and
  3469. 2:05:06a completely lost sale.
  3470. 2:05:08>> Picture this. It's Black Friday. You've
  3471. 2:05:10spent literally months preparing for
  3472. 2:05:12this exact day. Your e-commerce site is
  3473. 2:05:15just absolutely printing money and your
  3474. 2:05:17marketing team, they're already popping
  3475. 2:05:18the champagne. But then out of nowhere,
  3476. 2:05:21a single database server actually
  3477. 2:05:23catches fire or worse, an entire data
  3478. 2:05:26center just goes offline. And just like
  3479. 2:05:28that, boom, the whole site crashes.
  3480. 2:05:31You're staring at that dreaded 502 bad
  3481. 2:05:34gateway error. And let's be real, every
  3482. 2:05:36single second you are down, you are
  3483. 2:05:38losing thousands of dollars. Worse yet,
  3484. 2:05:41your customers are getting super
  3485. 2:05:42frustrated and they're flocking straight
  3486. 2:05:45over to your competitors. And to top it
  3487. 2:05:47all off, your phone just starts blowing
  3488. 2:05:48up with angry texts from the CEO. Yeah,
  3489. 2:05:51it's a total nightmare. So, how do we
  3490. 2:05:53stop that nightmare from ever happening?
  3491. 2:05:56We're talking about failover. Section
  3492. 2:05:58one, what is failover? Let's dive right
  3493. 2:06:00in. What does failover actually mean in
  3494. 2:06:04plain English? Well, at its core, it
  3495. 2:06:06really just means having a rock-solid
  3496. 2:06:08backup plan. One that kicks in
  3497. 2:06:10automatically the second things go
  3498. 2:06:12wrong. Because, and here is the harsh
  3499. 2:06:14truth we all have to accept, systems
  3500. 2:06:16fail all the time. Hardware degrades.
  3501. 2:06:19Sometimes entire AWS regions just go
  3502. 2:06:21offline unexpectedly. So, your failover
  3503. 2:06:24strategies, they're your ultimate
  3504. 2:06:25insurance policy. They are exactly what
  3505. 2:06:27ensures your business stays alive. All
  3506. 2:06:29right, moving to section two. Let's talk
  3507. 2:06:32about our first big strategy,
  3508. 2:06:34active/passive failover. So, in this
  3509. 2:06:37kind of setup, you have a primary system
  3510. 2:06:39that's doing 100% of the heavy lifting.
  3511. 2:06:42This guy right here is your active
  3512. 2:06:44system, but you also have a backup
  3513. 2:06:46system sitting in a totally different
  3514. 2:06:47location. It's perfectly healthy, but
  3515. 2:06:49it's completely hidden from the
  3516. 2:06:50internet. Honestly, it does absolutely
  3517. 2:06:52nothing. It's passive. It just sits
  3518. 2:06:55there and waits. It's kind of like
  3519. 2:06:57having a stunt double on a massive
  3520. 2:06:59blockbuster movie set. You know, the
  3521. 2:07:01main Hollywood actor is out there
  3522. 2:07:03filming all the scenes, taking all the
  3523. 2:07:05spotlight. Meanwhile, the stunt double
  3524. 2:07:08is just sitting in a chair drinking
  3525. 2:07:10coffee off camera. But the very second
  3526. 2:07:12that main actor gets hurt, bam, the
  3527. 2:07:14stunt double steps in immediately and
  3528. 2:07:16the movie just keeps on filming. Because
  3529. 2:07:19if you don't use a setup like this, your
  3530. 2:07:21app just goes completely offline. We're
  3531. 2:07:24talking raw extended downtime, which is
  3532. 2:07:26incredibly painful. Now, here's where
  3533. 2:07:29this gets really interesting. The
  3534. 2:07:31biggest trade-off with active/passive is
  3535. 2:07:33all about cost versus utilization.
  3536. 2:07:35You're basically paying pure money for
  3537. 2:07:37an identical backup environment that
  3538. 2:07:39just sits there doing literally nothing
  3539. 2:07:4199% of the time, just so you have that
  3540. 2:07:44peace of mind. Okay, let's flip to the
  3541. 2:07:46other side of the coin. Section three,
  3542. 2:07:48active/active failover. Welcome to the
  3543. 2:07:51big leagues. In an active/active setup,
  3544. 2:07:55instead of a primary and a backup, you
  3545. 2:07:57have multiple primary systems spanning
  3546. 2:07:59across different availability zones or
  3547. 2:08:01even regions. And here's the kicker,
  3548. 2:08:03they are all running. They are all
  3549. 2:08:06actively taking traffic at the exact
  3550. 2:08:08same time. There is no stunk double
  3551. 2:08:10here. Everyone is a star. I always tell
  3552. 2:08:13people to think about it like a massive
  3553. 2:08:15supermarket with 10 checkout lanes open
  3554. 2:08:17at once. If one cash register suddenly
  3555. 2:08:19breaks, what happens? The cashier simply
  3556. 2:08:21turns off their light and the customers
  3557. 2:08:23naturally flow over to the other nine
  3558. 2:08:25open lanes. The store never stops
  3559. 2:08:26operating. That is usually the moment
  3560. 2:08:28people hear this and say, "Oh, now I get
  3561. 2:08:31it. The system just absorbs the failure
  3562. 2:08:34completely naturally without anyone
  3563. 2:08:35panicking." But of course, there's a
  3564. 2:08:38catch. The trade-off here is massive
  3565. 2:08:40architectural complexity. I mean,
  3566. 2:08:42keeping multiple databases perfectly
  3567. 2:08:44synced across the globe in real time,
  3568. 2:08:46that is brutally expensive. Think about
  3569. 2:08:49that for a second. If you have a true
  3570. 2:08:51active/active architecture, you aren't
  3571. 2:08:54just building a backup plan anymore. You
  3572. 2:08:56are actually building an immune system
  3573. 2:08:57for your application. With this level of
  3574. 2:09:00true fault tolerance if an entire
  3575. 2:09:02availability zone drops offline, your
  3576. 2:09:04users wouldn't even see a glitch or an
  3577. 2:09:07error screen. Services like Amazon Route
  3578. 2:09:0953 will instantly redirect that traffic
  3579. 2:09:11to the surviving active zones. When you
  3580. 2:09:14realize your users will literally never
  3581. 2:09:16know that a fire happened in your data
  3582. 2:09:18center. I mean that is the absolute
  3583. 2:09:20magic of true fall tolerance. Moving on
  3584. 2:09:23to section four, choosing your strategy.
  3585. 2:09:26Now listen closely because this is where
  3586. 2:09:28people mess up. So many folks think they
  3587. 2:09:31always need active active just because
  3588. 2:09:33it sounds bigger and cooler. Let me tell
  3589. 2:09:35you, you don't. You choose
  3590. 2:09:37active/passive to save money, especially
  3591. 2:09:40when your system is fairly simple and
  3592. 2:09:42your business can actually tolerate a
  3593. 2:09:43few minutes of downtime. On the flip
  3594. 2:09:45side, you choose active/active when you
  3595. 2:09:47are building missionritical, massive
  3596. 2:09:49global applications where a single
  3597. 2:09:51minute of downtime literally costs
  3598. 2:09:53millions of dollars. All right, let's
  3599. 2:09:55bring it all together. Section five,
  3600. 2:09:57critical exam takeaways. Keep those
  3601. 2:09:59stunt double and supermarket analogies
  3602. 2:10:01in mind as we validate these cloud
  3603. 2:10:03skills. Let's do a quick methodical
  3604. 2:10:06recap of what we've covered. First
  3605. 2:10:08point, active/active failover provides
  3606. 2:10:11the absolute lowest recovery time
  3607. 2:10:13objective. Essentially giving you near
  3608. 2:10:15zero downtime. Got that? Okay. Second
  3609. 2:10:17point, disaster recovery strategies that
  3610. 2:10:19you might hear about like pilot light or
  3611. 2:10:21warm standby. Those are essentially just
  3612. 2:10:24variations of the active/passive
  3613. 2:10:26approach. And third, Amazon Route 53 is
  3614. 2:10:29the primary global routing service
  3615. 2:10:31you're going to use to manage both of
  3616. 2:10:32these failover strategies. Before we
  3617. 2:10:35wrap up, here is your final trap
  3618. 2:10:37warning. Please do not confuse true
  3619. 2:10:40multi-AZ disaster recovery with simple
  3620. 2:10:42local load balancing. Because let me
  3621. 2:10:44tell you, simple load balancing on a
  3622. 2:10:46single server rack, that will not save
  3623. 2:10:48you if the whole building loses power.
  3624. 2:10:50So, I want you to look at your own
  3625. 2:10:52architecture right now and ask yourself
  3626. 2:10:54honestly, are you truly fault tolerant,
  3627. 2:10:56or are you just one bad power grid away
  3628. 2:10:58from going completely dark? Imagine you
  3629. 2:11:01wake up at 3:00 a.m. Your phone is
  3630. 2:11:03ringing off the hook. A massive
  3631. 2:11:05hurricane just flooded the entire data
  3632. 2:11:07center hosting your application. Your
  3633. 2:11:10database is gone. Your servers are dead.
  3634. 2:11:13Every passing minute is costing your
  3635. 2:11:15company tens of thousands of dollars.
  3636. 2:11:17The CEO is literally screaming on the
  3637. 2:11:20conference call asking two questions.
  3638. 2:11:22How much customer data did we just lose?
  3639. 2:11:25And when will we be back online? Listen,
  3640. 2:11:27if you don't know the exact answer to
  3641. 2:11:29those two questions, your cloud
  3642. 2:11:31architecture is fundamentally broken.
  3643. 2:11:34So, let's talk about disaster recovery.
  3644. 2:11:36Systems fail. It's not a matter of if,
  3645. 2:11:38but when. Natural disasters happen.
  3646. 2:11:40Hardware catches fire. And you know,
  3647. 2:11:42sometimes a tired engineer accidentally
  3648. 2:11:44deletes a production database. Disaster
  3649. 2:11:47recovery is your blueprint for survival.
  3650. 2:11:49But to build that blueprint, you really
  3651. 2:11:51have to master the two acronyms that
  3652. 2:11:53dictate whether your business lives or
  3653. 2:11:54dies. RTO and RPO. Let's break them down
  3654. 2:11:57into their simplest forms. First up is
  3655. 2:12:00RTO, recovery time objective. This is a
  3656. 2:12:02stopwatch. The clock starts the exact
  3657. 2:12:04second your system goes down. How long
  3658. 2:12:06does it take to turn the lights back on?
  3659. 2:12:08Is it 10 minutes or is it 10 hours? It
  3660. 2:12:10is entirely about downtime. Next is RPO,
  3661. 2:12:13recovery point objective. Think of this
  3662. 2:12:16as a time machine. When the disaster
  3663. 2:12:18hit, how far back in time do we have to
  3664. 2:12:20go to find our last good backup? Did we
  3665. 2:12:23back up the database 5 minutes ago or
  3666. 2:12:25yesterday at midnight? It is entirely
  3667. 2:12:27about data loss. Think about that for a
  3668. 2:12:30second. If your RPO is 24 hours and your
  3669. 2:12:33system crashes at 11 p.m., you just
  3670. 2:12:36permanently lost an entire day of
  3671. 2:12:38customer orders. There's no getting them
  3672. 2:12:39back. They are gone forever. That is why
  3673. 2:12:42RPO isn't just an engineering metric. It
  3674. 2:12:44is your accepted level of permanent data
  3675. 2:12:47loss. Now, here's the part that actually
  3676. 2:12:49matters. You might be thinking, great,
  3677. 2:12:53let's just make both RTO and RPO zero.
  3678. 2:12:55Zero downtime, zero data loss. Here is
  3679. 2:12:59where people completely fail this
  3680. 2:13:00concept. Getting to zero is brutally
  3681. 2:13:03hard, highly risky, and insanely
  3682. 2:13:05expensive. To get a zero RPO, you have
  3683. 2:13:07to synchronously replicate every single
  3684. 2:13:10database transaction across the country
  3685. 2:13:11in real time. That creates network lag.
  3686. 2:13:14It slows down your app. And worse, if an
  3687. 2:13:16engineer accidentally deletes a table,
  3688. 2:13:18that deletion is replicated instantly,
  3689. 2:13:20destroying your backup, too. And to get
  3690. 2:13:22a zero RTO, you have to run your servers
  3691. 2:13:24at full blast in multiple regions
  3692. 2:13:26simultaneously that literally doubles
  3693. 2:13:28your AWS bill the very next day. So
  3694. 2:13:31instead of just spending millions of
  3695. 2:13:33dollars, we use a spectrum of four
  3696. 2:13:35disaster recovery strategies to balance
  3697. 2:13:37cost versus survival. Strategy one,
  3698. 2:13:40backup and restore. This is the absolute
  3699. 2:13:43cheapest option. You just take snapshots
  3700. 2:13:45of your data and store them. But the
  3701. 2:13:47trade-off is massive pain. If you crash,
  3702. 2:13:50you have to manually provision new
  3703. 2:13:52servers, install software, and restore
  3704. 2:13:54the data from scratch. Your RTO is
  3705. 2:13:56measured in hours or even days. It's
  3706. 2:13:58exactly like keeping a box of car parts
  3707. 2:14:00in your garage. If your car breaks, you
  3708. 2:14:02have to build a new one yourself.
  3709. 2:14:04Strategy 2, pilot light. In this setup,
  3710. 2:14:07your core database is always running and
  3711. 2:14:08replicating data, but your application
  3712. 2:14:10servers are completely turned off. It's
  3713. 2:14:12exactly like the pilot light in a gas
  3714. 2:14:14furnace. The small flame is always on,
  3715. 2:14:16and when the house gets cold, it
  3716. 2:14:18instantly ignites the main burners. It
  3717. 2:14:20saves you money on compute, but gives
  3718. 2:14:21you a much faster RTO when disaster
  3719. 2:14:23strikes. Strategy 3, warm standby. This
  3720. 2:14:27is a fully functional, scaled down
  3721. 2:14:29version of your entire application
  3722. 2:14:31running in the background. It's like a
  3723. 2:14:32car sitting in your driveway with the
  3724. 2:14:34engine idling. If an emergency happens,
  3725. 2:14:36you just jump in, hit the gas, and scale
  3726. 2:14:38it up to handle the traffic. Your RTO is
  3727. 2:14:40just minutes. Strategy four, multi-sight
  3728. 2:14:44active active. Everything is running at
  3729. 2:14:46full capacity, taking live traffic
  3730. 2:14:48across multiple regions. It is a twin
  3731. 2:14:50engine commercial jet. One engine
  3732. 2:14:52explodes, the other takes the full load,
  3733. 2:14:54and the passengers never even notice.
  3734. 2:14:56Zero RTO. But it costs an absolute
  3735. 2:14:59fortune. Now, imagine this scenario in
  3736. 2:15:02your system. Your boss wants to use
  3737. 2:15:04Pilot Light to save money, but the
  3738. 2:15:06marketing team says the site cannot go
  3739. 2:15:08down for more than 5 minutes or you lose
  3740. 2:15:10the biggest deal of the year. Those two
  3741. 2:15:12demands completely conflict. Because
  3742. 2:15:15here's the reality. Disaster recovery is
  3743. 2:15:17not an IT choice. It is a harsh business
  3744. 2:15:20negotiation between your budget and your
  3745. 2:15:22survival. If you are preparing for an
  3746. 2:15:24AWS solutions architect exam, this is
  3747. 2:15:27exactly how they test you. Do not miss
  3748. 2:15:30this. They will almost never ask you for
  3749. 2:15:32a simple definition. They will give you
  3750. 2:15:34a scenario. If the question asks for the
  3751. 2:15:37most cost-effective way to survive a
  3752. 2:15:38disaster and says the business can
  3753. 2:15:40tolerate a recovery time of several
  3754. 2:15:42hours, you immediately look for backup
  3755. 2:15:44and restore or pilot light. But if the
  3756. 2:15:46question says mission critical and
  3757. 2:15:48demands near zero downtime, you must
  3758. 2:15:50choose multi-sight active active no
  3759. 2:15:52matter the cost. Let's wrap this up
  3760. 2:15:54fast. RTO is time. How long are we down?
  3761. 2:15:58RPO is data. How much did we lose? The
  3762. 2:16:01closer you get to zero, the more
  3763. 2:16:03complicated and expensive your
  3764. 2:16:04architecture becomes. So, here are your
  3765. 2:16:06three rapidfire takeaways. One, pilot
  3766. 2:16:09light keeps the database alive, but the
  3767. 2:16:10app server sleeping. Two, warm standby
  3768. 2:16:13keeps a scaled down fully functional
  3769. 2:16:15environment ready to scale. Three,
  3770. 2:16:17multicight active active gives you near
  3771. 2:16:19zero RTO, but requires massive financial
  3772. 2:16:21investment. And here is your final trap.
  3773. 2:16:24Never ever confuse them. RTO is turning
  3774. 2:16:28the lights back on. RPO is what got
  3775. 2:16:30stolen while the room was dark? Do not
  3776. 2:16:32mix them up. Which makes you wonder
  3777. 2:16:34which of these four strategies is your
  3778. 2:16:36company relying on right now. And what
  3779. 2:16:38happens if that system fails tonight?
  3780. 2:16:40>> Imagine a tired junior engineer pushing
  3781. 2:16:43a database update on a Friday afternoon.
  3782. 2:16:47They mistype one single line of code,
  3783. 2:16:49hit enter, and instantly your entire
  3784. 2:16:51production database is completely wiped.
  3785. 2:16:53Years of customer data, order history,
  3786. 2:16:56passwords, all just gone. The CEO is
  3787. 2:16:58calling your phone right now. The
  3788. 2:17:00company is literally facing bankruptcy
  3789. 2:17:02in minutes. So, how do you get it back?
  3790. 2:17:05Well, you get it back with backups.
  3791. 2:17:07Let's start from zero here. What
  3792. 2:17:08actually is a backup strategy? It's a
  3793. 2:17:11guaranteed safe point for your entire
  3794. 2:17:13architecture to ensure data availability
  3795. 2:17:15and durability. You know, systems don't
  3796. 2:17:17just fail from hurricanes or power
  3797. 2:17:19outages. They fail from ransomware,
  3798. 2:17:21malicious attacks, and simple human
  3799. 2:17:23error. Without a backup, a single
  3800. 2:17:25mistake permanently destroys your
  3801. 2:17:27business. To fix this, you have to
  3802. 2:17:29master a concept called RPO or recovery
  3803. 2:17:33point objective. RPO is really just a
  3804. 2:17:36timer for data loss. It's the exact
  3805. 2:17:38amount of data you are mathematically
  3806. 2:17:40willing to lose. If your boss says the
  3807. 2:17:42business can only survive losing 1 hour
  3808. 2:17:44of customer orders, your RPO is 1 hour.
  3809. 2:17:47That means you must save the state of
  3810. 2:17:49your system every single hour. Now, let
  3811. 2:17:52me show you the two core ways AWS
  3812. 2:17:54handles this. First, we have snapshots.
  3813. 2:17:57A snapshot is a point in time copy of a
  3814. 2:18:00single resource, like an Amazon EBS
  3815. 2:18:02storage drive attached to a server.
  3816. 2:18:05Think about it like taking a photo of a
  3817. 2:18:06highly complex math equation on a
  3818. 2:18:08whiteboard. If someone accidentally
  3819. 2:18:10erases the board, you don't panic. You
  3820. 2:18:12just look at your photo and write the
  3821. 2:18:14numbers back out. It's incredibly simple
  3822. 2:18:16and effective. But what happens if you
  3823. 2:18:19don't use it? you lose the data on that
  3824. 2:18:21drive permanently and you are building
  3825. 2:18:24from scratch. The trade-off with simple
  3826. 2:18:27snapshots is manual overhead. If you
  3827. 2:18:29have five web servers, taking manual
  3828. 2:18:31snapshots of each drive is easy. But now
  3829. 2:18:34imagine this in your system. You don't
  3830. 2:18:36have five servers. You have 500 EC2
  3831. 2:18:39instances, 50 Amazon RDS databases, and
  3832. 2:18:42a dozen Amazon EFS file systems. You
  3833. 2:18:45can't manually click create snapshot on
  3834. 2:18:47all of those every single hour. you will
  3835. 2:18:49miss one and that will be the exact
  3836. 2:18:51drive that crashes. And that brings us
  3837. 2:18:54to the second approach, AWS backup. AWS
  3838. 2:18:58backup is a centralized, fully managed
  3839. 2:19:00service. Instead of you running around
  3840. 2:19:02taking photos of whiteboards, AWS backup
  3841. 2:19:05is a highly trained security guard you
  3842. 2:19:07hire. This guard automatically walks
  3843. 2:19:09through every single room in your
  3844. 2:19:10company, takes a photo of every single
  3845. 2:19:12whiteboard, and locks those photos in a
  3846. 2:19:14concrete vault, completely hands-off.
  3847. 2:19:17So, if snapshots are the actual photos,
  3848. 2:19:19AWS Backup is the automated photographer
  3849. 2:19:22managing all of it. Now, here's the part
  3850. 2:19:24that actually matters. Here is where
  3851. 2:19:26people completely fail this in the real
  3852. 2:19:27world. Backups are entirely useless if
  3853. 2:19:30they get deleted alongside your main
  3854. 2:19:32data. If a hacker gets into your AWS
  3855. 2:19:34account and deletes your servers, they
  3856. 2:19:36will just delete your snapshots, too.
  3857. 2:19:38Your business still dies. This is where
  3858. 2:19:41true engineering comes in. AWS backup
  3859. 2:19:44allows you to force your backups into a
  3860. 2:19:45completely separate AWS account or a
  3861. 2:19:47completely different AWS region. Even if
  3862. 2:19:50your entire primary account is
  3863. 2:19:51compromised, corrupted, or completely
  3864. 2:19:53destroyed, your data is locked away and
  3865. 2:19:55perfectly safe in another time zone.
  3866. 2:19:58Think about that for a second. Your
  3867. 2:19:59primary data center burns to the ground,
  3868. 2:20:02but you just log into a backup account,
  3869. 2:20:03hit restore, and your entire application
  3870. 2:20:06spins back to life exactly as it was.
  3871. 2:20:08The key takeaway here is that true
  3872. 2:20:11resiliency means physically and
  3873. 2:20:13logically separating the backup from the
  3874. 2:20:15source. So when do you choose which? You
  3875. 2:20:17use manual snapshots when you are
  3876. 2:20:19testing a single server doing a quick
  3877. 2:20:21software update and just want a fast
  3878. 2:20:23undo button. You choose AWS backup when
  3879. 2:20:26you are running an enterprise
  3880. 2:20:27environment and need guaranteed
  3881. 2:20:29automated compliance across thousands of
  3882. 2:20:31resources at once. If you are taking the
  3883. 2:20:33AWS solutions architect exam, do not
  3884. 2:20:37miss this trap. AWS will test your
  3885. 2:20:39knowledge on cost optimization for these
  3886. 2:20:41resilient architectures. They will ask
  3887. 2:20:44you the most cost-effective way to store
  3888. 2:20:46long-term backups. Remember that EBS
  3889. 2:20:48snapshots are incremental. They only
  3890. 2:20:51save the tiny blocks of data that
  3891. 2:20:52changed since your last snapshot, which
  3892. 2:20:54saves you a massive amount of storage
  3893. 2:20:56money. But for true long-term
  3894. 2:20:58compliance, AWS will want you to use AWS
  3895. 2:21:02Backup to automatically transition your
  3896. 2:21:04old backups into cheaper, cold storage
  3897. 2:21:06tiers. Let's do a fast punchy recap.
  3898. 2:21:10Snapshots are point-in time pictures of
  3899. 2:21:12your data. AWS backup is the automated
  3900. 2:21:14brain that manages all of those pictures
  3901. 2:21:17across your entire AWS environment.
  3902. 2:21:19Cross region and cross account backups
  3903. 2:21:21save you from total disaster. Here are
  3904. 2:21:24your three rapidfire takeaways. One,
  3905. 2:21:27snapshots are incremental, saving you
  3906. 2:21:29storage costs. Two, AWS backup centrally
  3907. 2:21:33manages data across multiple AWS
  3908. 2:21:35services like Amazon EBS, Amazon EFS,
  3909. 2:21:38and Amazon RDS. And three, your RPO
  3910. 2:21:42dictates exactly how often you need to
  3911. 2:21:44trigger these backups. And here is your
  3912. 2:21:47final warning. Never assume a snapshot
  3913. 2:21:50is a full disaster recovery plan. If you
  3914. 2:21:53do not actively practice restoring that
  3915. 2:21:55snapshot, you do not have a backup. You
  3916. 2:21:57just have a false sense of security. So
  3917. 2:21:59ask yourself, when was the last time you
  3918. 2:22:02actually tested your disaster recovery
  3919. 2:22:04plan?
  3920. 2:22:04>> Let's jump right in. I want you to
  3921. 2:22:06imagine this scenario. Your company just
  3922. 2:22:09dropped a massive multi-million dollar
  3923. 2:22:11Super Bowl ad. It's the absolute biggest
  3924. 2:22:14moment in your company's history.
  3925. 2:22:15Millions of people see it. They pull out
  3926. 2:22:17their phones and they flood your website
  3927. 2:22:19at the exact same second to buy your
  3928. 2:22:21product. Your web servers, they actually
  3929. 2:22:24handle it perfectly. But your backad
  3930. 2:22:26database, it gets completely crushed by
  3931. 2:22:28the sudden flood of transactions. It
  3932. 2:22:30chokes and then it crashes. The entire
  3933. 2:22:33site goes down. You're looking at
  3934. 2:22:34millions of dollars in lost sales and
  3935. 2:22:37your brand is suddenly an absolute joke
  3936. 2:22:38on social media. That pain right there,
  3937. 2:22:41that is exactly what we're fixing today.
  3938. 2:22:44So the big question is why did your
  3939. 2:22:46website actually crash? Your web servers
  3940. 2:22:49were fine, right? Well, they handled the
  3941. 2:22:51front-end traffic beautifully, but the
  3942. 2:22:53underlying architecture was inherently
  3943. 2:22:55flawed. It was what we call tightly
  3944. 2:22:58coupled. Because it was tightly coupled,
  3945. 2:23:00the overwhelmed back-end database
  3946. 2:23:02choked. And because the backend choked,
  3947. 2:23:04it literally dragged the entire website
  3948. 2:23:06down with it. Let's do a direct
  3949. 2:23:08comparison here. Tightly coupled versus
  3950. 2:23:11decoupled. Any tightly coupled system,
  3951. 2:23:14component A talks directly to component
  3952. 2:23:16B. It relies on it completely. For
  3953. 2:23:18example, your web server hands a
  3954. 2:23:20customer order directly to the payment
  3955. 2:23:21server. If that payment server is slow,
  3956. 2:23:23your web server just has to stand there
  3957. 2:23:25and wait. And if the payment server
  3958. 2:23:27completely dies, the web server drops
  3959. 2:23:29the order entirely. To fix this, we have
  3960. 2:23:31to use a concept called decoupling.
  3961. 2:23:34Decoupling just means breaking your
  3962. 2:23:35application apart so the individual
  3963. 2:23:37components don't rely directly on each
  3964. 2:23:39other. If one piece breaks, the rest of
  3965. 2:23:41the system doesn't even care. And this
  3966. 2:23:43is brilliantly where Amazon Web Services
  3967. 2:23:45comes in. The ultimate AWS tool for
  3968. 2:23:47decoupling is Amazon SQS. SQS stands for
  3969. 2:23:50a simple Q service. And honestly, it is
  3970. 2:23:53exactly what it sounds like. It's simply
  3971. 2:23:54a waiting line for your data. Let's
  3972. 2:23:57picture this using a really relatable
  3973. 2:23:58fast food analogy. Think about a
  3974. 2:24:00drive-thru. If there's no line, the
  3975. 2:24:03cashier taking your order has to
  3976. 2:24:04literally run to the kitchen, cook your
  3977. 2:24:06burger, and hand it to you before they
  3978. 2:24:08can even look at the next car. That's
  3979. 2:24:10our tightly coupled system. If a whole
  3980. 2:24:12tour bus shows up, the whole restaurant
  3981. 2:24:14crashes. But now, introduce SQS. SQS is
  3982. 2:24:17the ticket rail in the kitchen. The
  3983. 2:24:19cashier instantly takes your order,
  3984. 2:24:20slaps the ticket on the SQS rail, and
  3985. 2:24:22immediately greets the next car. They
  3986. 2:24:24are completely free. The cooks in the
  3987. 2:24:26kitchen then pull those tickets off the
  3988. 2:24:27rail at their own pace. If a cook goes
  3989. 2:24:29on break or if the kitchen catches fire,
  3990. 2:24:31the cashier out front doesn't care. They
  3991. 2:24:33just keep putting tickets on the rail.
  3992. 2:24:34Think about that for a second. If your
  3993. 2:24:36backend payment server dies, your web
  3994. 2:24:38server doesn't crash. It just keeps
  3995. 2:24:40tossing customer orders into the SQSQ.
  3996. 2:24:43When you finally fix that backend server
  3997. 2:24:4510 minutes later, it wakes up, looks at
  3998. 2:24:47the queue, and seamlessly starts
  3999. 2:24:49processing the orders that were sitting
  4000. 2:24:50there waiting for it. The queue is a
  4001. 2:24:52shock absorber. It completely protects
  4002. 2:24:54your fragile backend from massive,
  4003. 2:24:56unpredictable spikes in traffic. Now,
  4004. 2:24:58pay close attention here because this is
  4005. 2:25:00where people absolutely mess up in the
  4006. 2:25:02real world. You might assume that SQS
  4007. 2:25:04pushes data directly to your backend
  4008. 2:25:06servers. It doesn't. SQS is a completely
  4009. 2:25:09passive pollbased system. Your backend
  4010. 2:25:11EC2 instances have to actively pull the
  4011. 2:25:14queue. They have to constantly ask,
  4012. 2:25:15"Hey, got any messages for me? Hey, got
  4013. 2:25:17any messages for me?" And that brings us
  4014. 2:25:19to a massive engineering challenge.
  4015. 2:25:21Imagine you suddenly have a thousand
  4016. 2:25:23messages sitting in your queue. If your
  4017. 2:25:25web servers are dropping 10,000 messages
  4018. 2:25:27a second into the queue, but you only
  4019. 2:25:29have two backend servers pulling
  4020. 2:25:30messages out, that queue gets deeper and
  4021. 2:25:33deeper and deeper. Eventually, those
  4022. 2:25:35messages expire, and you literally lose
  4023. 2:25:37real customer data. So, what do you do?
  4024. 2:25:40Well, instead of guessing how many
  4025. 2:25:41servers you need, use the SQSQP
  4026. 2:25:43threshold to trigger AWS autoscaling.
  4027. 2:25:46You tell AWS, hey, if there are more
  4028. 2:25:48than a thousand messages waiting in the
  4029. 2:25:50queue, automatically spin up 50 more EC2
  4030. 2:25:52instances to process them. And when the
  4031. 2:25:54que is finally empty, shut them all down
  4032. 2:25:55to save money. SQS doesn't just hold
  4033. 2:25:58data. It acts as the core metric that
  4034. 2:26:00actually drives your cloud elasticity.
  4035. 2:26:02So when do you actually use this? Let's
  4036. 2:26:05slow down slightly and really look at
  4037. 2:26:07the difference between asynchronous and
  4038. 2:26:09synchronous processing. You use SQS
  4039. 2:26:12strictly for asynchronous processing.
  4040. 2:26:14These are things like sending batch
  4041. 2:26:16emails, processing user uploads, or
  4042. 2:26:18rendering heavy video files. Basically,
  4043. 2:26:20any task where the user clicks a button
  4044. 2:26:22and does not need a subsecond instant
  4045. 2:26:24response. You absolutely do not use SQS
  4046. 2:26:27for real-time synchronous actions. If
  4047. 2:26:30you're streaming a live video or
  4048. 2:26:31querying a live database where the user
  4049. 2:26:33is staring at a loading screen waiting
  4050. 2:26:35for an instant answer, SQS is definitely
  4051. 2:26:37the wrong tool. Now, if you're studying
  4052. 2:26:40for the AWS solutions architect exam,
  4053. 2:26:42SA3, listen up. AWS absolutely loves
  4054. 2:26:46testing this. They'll give you a
  4055. 2:26:47scenario where a monolithic application
  4056. 2:26:49is failing because a back-end component
  4057. 2:26:51can't keep up with web traffic. The
  4058. 2:26:53question will ask for the most resilient
  4059. 2:26:54or loosely coupled solution. The answer
  4060. 2:26:57almost always involves throwing an SQSQ
  4061. 2:26:59right in the middle of the architecture.
  4062. 2:27:01But watch out for their favorite trap.
  4063. 2:27:02They will constantly try to confuse you
  4064. 2:27:04between Amazon SQS and Amazon SNS. Let's
  4065. 2:27:07clear this up right now. SNS is a
  4066. 2:27:09pushbased notification service. It
  4067. 2:27:11blasts messages out. SQS is a pollbased
  4068. 2:27:14queue. It simply holds messages until a
  4069. 2:27:16worker is ready. Do not mix those up on
  4070. 2:27:18exam day. Okay, let's bring this all
  4071. 2:27:21together with three rapidfire takeaways.
  4072. 2:27:24Number one, tightly coupled systems
  4073. 2:27:26break under pressure, but decoupling
  4074. 2:27:28isolates your components. And SQS is the
  4075. 2:27:30primary AWS service used to do this.
  4076. 2:27:33Number two, it's a pull-based polling
  4077. 2:27:35system, not a push system. And number
  4078. 2:27:37three, you should always use the SQSQ to
  4079. 2:27:40trigger horizontal autoscaling for your
  4080. 2:27:42compute resources. And that brings us to
  4081. 2:27:44our final point today. SQS has no brain.
  4082. 2:27:49It is literally just a waiting room. I
  4083. 2:27:51want to leave you with that thought.
  4084. 2:27:53Don't fall into the trap of thinking SQS
  4085. 2:27:55solves all your processing problems
  4086. 2:27:57magically on its own. It holds the data
  4087. 2:27:59safely, yes, but you still need to
  4088. 2:28:01actively design the compute resources
  4089. 2:28:03that actually pull that data and do the
  4090. 2:28:05heavy lifting. Imagine this scenario for
  4091. 2:28:07a second. A customer is on your massive
  4092. 2:28:10e-commerce site and they finally hit buy
  4093. 2:28:12now. Behind the scenes, your web server
  4094. 2:28:15springs into action. It instantly tries
  4095. 2:28:17to charge their credit card, update your
  4096. 2:28:19inventory database, print out a physical
  4097. 2:28:21shipping label, and then finally send
  4098. 2:28:22them a confirmation email. At first
  4099. 2:28:25glance, everything seems perfectly fine,
  4100. 2:28:27right? Just a standard transaction. But
  4101. 2:28:30what happens if your email server is
  4102. 2:28:31temporarily down? Because everything in
  4103. 2:28:34this specific pipeline is tightly tied
  4104. 2:28:35together, one broken link means the
  4105. 2:28:37entire transaction fails. Your customer
  4106. 2:28:40screen freezes up. They get this giant
  4107. 2:28:42frustrating error message. And you,
  4108. 2:28:44well, you just lost a massive sale all
  4109. 2:28:46over a broken email server. Think about
  4110. 2:28:48that for a second. How do we actually
  4111. 2:28:50stop this from happening? Well, the
  4112. 2:28:52answer is you stop building rigid
  4113. 2:28:54pipelines and you start building
  4114. 2:28:56eventdriven architectures. Let's break
  4115. 2:28:58down exactly what that means. In an
  4116. 2:29:00event- driven architecture, your
  4117. 2:29:02components literally do not give
  4118. 2:29:03commands to each other. They don't boss
  4119. 2:29:05each other around. Instead, they simply
  4120. 2:29:07announce things. A component just says,
  4121. 2:29:09"Hey, an event just happened." And then
  4122. 2:29:10it immediately goes right back to its
  4123. 2:29:12own job. This completely decouples your
  4124. 2:29:14workloads, meaning your components can
  4125. 2:29:16now scale up and fail completely
  4126. 2:29:18independently of one another. But to
  4127. 2:29:20make this magic work, you really need a
  4128. 2:29:22middleman. You need a publish and
  4129. 2:29:24subscribe system, which you'll usually
  4130. 2:29:25hear called pub. Look at the contrast
  4131. 2:29:27here. It's pretty stark. In a
  4132. 2:29:29traditional system, component A directly
  4133. 2:29:31tells component B what to do. So if
  4134. 2:29:33component B is broken, component A
  4135. 2:29:35crashes right along with it. It's
  4136. 2:29:37incredibly fragile. But in an event-
  4137. 2:29:40driven system, those components just
  4138. 2:29:42announce their events to a pub/
  4139. 2:29:44middleman. That middleman acts as a
  4140. 2:29:46buffer between the two. And honestly,
  4141. 2:29:48this is the resilient magic of event-
  4142. 2:29:49driven architectures.
  4143. 2:29:51All right, let's jump into section one,
  4144. 2:29:54Amazon SNS, the ultimate megaphone.
  4145. 2:29:57Let's talk about our first heavy hitter
  4146. 2:29:59in AWS that makes all this happen. Think
  4147. 2:30:03of Amazon SNS as exactly that, the
  4148. 2:30:05ultimate megaphone. SNS is a pushbased
  4149. 2:30:08service and it's designed to instantly
  4150. 2:30:11blast messages out to multiple receivers
  4151. 2:30:13at the exact same time. It's kind of
  4152. 2:30:16like a radio tower. The DJ speaks into
  4153. 2:30:18the microphone and that audio is
  4154. 2:30:20instantly pushed out in every possible
  4155. 2:30:23direction. That radio tower absolutely
  4156. 2:30:25does not care if one car is listening or
  4157. 2:30:27if a million cars are listening. It just
  4158. 2:30:29broadcasts. Now, without a service like
  4159. 2:30:32SNS, your web server has to run custom
  4160. 2:30:35code to individually connect to your
  4161. 2:30:36database, then your analytics engine,
  4162. 2:30:39and then your email server one by one.
  4163. 2:30:41That creates a tightly coupled
  4164. 2:30:43bottleneck. But here is where people
  4165. 2:30:45mess up. The trap with SNS is that it
  4166. 2:30:48just shouts and forgets. It absolutely
  4167. 2:30:51does not hold on to messages if the
  4168. 2:30:53receiving system happens to be offline.
  4169. 2:30:55Think about it. If your car radio is
  4170. 2:30:57turned off, you miss the song. Let's
  4171. 2:30:59walk through that orderplace scenario
  4172. 2:31:01again, but doing it the right way. Your
  4173. 2:31:03web server just drops one single message
  4174. 2:31:05into SNS. Order placed. And that's it.
  4175. 2:31:08The web server's job is literally done
  4176. 2:31:10in one millisecond. SNS then instantly
  4177. 2:31:13takes over and pushes that message to
  4178. 2:31:15five different backend microservices in
  4179. 2:31:18parallel. This is the absolute magic of
  4180. 2:31:21loose coupling. Your web server doesn't
  4181. 2:31:23even know those other backend services
  4182. 2:31:25exist, which means it can never ever be
  4183. 2:31:27slowed down by them. But here is a
  4184. 2:31:29really crucial question. Where do people
  4185. 2:31:32completely fail with this in the real
  4186. 2:31:34world? Well, SNS is amazing for simple,
  4187. 2:31:37loud broadcasting, but what if your
  4188. 2:31:39architecture gets complicated? For
  4189. 2:31:41example, what if you only want the
  4190. 2:31:43shipping department to get a message if
  4191. 2:31:45the customer ordered a physical item,
  4192. 2:31:46but definitely not if they just bought a
  4193. 2:31:48digital download? Well, SNS simply isn't
  4194. 2:31:51smart enough to read the message and
  4195. 2:31:53selectively route it based on complex
  4196. 2:31:54rules like that. And that brings us to
  4197. 2:31:57section two, Amazon Event Bridge, the
  4198. 2:32:00smart router. Event Bridge is our
  4199. 2:32:02solution for that complex routing. It's
  4200. 2:32:04a highly intelligent event bus. So
  4201. 2:32:07instead of just blindly shouting like
  4202. 2:32:09SNS, EventBridge actually inspects the
  4203. 2:32:11data inside the event. It filters it
  4204. 2:32:13based on custom rules that you define
  4205. 2:32:15and then it routes it to very specific
  4206. 2:32:17targets. Think of Event Bridge like a
  4207. 2:32:20massive fully automated post office. The
  4208. 2:32:22mail sorter literally looks at the zip
  4209. 2:32:24code on every single envelope. It
  4210. 2:32:26filters them out and drops them into the
  4211. 2:32:28exact right bucket for the exact right
  4212. 2:32:29delivery driver. What happens if you try
  4213. 2:32:31to build a system without it? you end up
  4214. 2:32:33writing hundreds of lines of complex
  4215. 2:32:35messy if then routing logic directly
  4216. 2:32:37into your application code and that just
  4217. 2:32:39creates a fragile mess that breaks every
  4218. 2:32:41single time you try to update it. Now I
  4219. 2:32:43want you to imagine this running in your
  4220. 2:32:45system. An EC2 server crashes in your
  4221. 2:32:47environment. Instantly AWS drops an
  4222. 2:32:49event into Event Bridge. Event bridge
  4223. 2:32:51reads that event, filters it based on a
  4224. 2:32:53specific rule you built and then it
  4225. 2:32:55automatically triggers an AWS Lambda
  4226. 2:32:57function to go and reboot the server.
  4227. 2:32:59Think about that for a second. Event
  4228. 2:33:01Bridge is acting as the central nervous
  4229. 2:33:03system for your entire AWS account. It's
  4230. 2:33:05automatically choreographing fixes
  4231. 2:33:07before a human even notices there was a
  4232. 2:33:09problem. So let's slow down and
  4233. 2:33:11carefully contrast these two because you
  4234. 2:33:13need to know when to choose which. You
  4235. 2:33:15go with Amazon SNS when you need high
  4236. 2:33:17throughput simple pub sub broadcasting.
  4237. 2:33:20You just need that dumb megaphone to
  4238. 2:33:21push one message out to many subscribers
  4239. 2:33:23instantly. On the flip side, you choose
  4240. 2:33:26Amazon Event Bridge when you need
  4241. 2:33:27complex rule-based routing, scheduled
  4242. 2:33:29events, or when you want to trigger
  4243. 2:33:31workflows automatically based on exactly
  4244. 2:33:33what is happening inside your AWS
  4245. 2:33:35infrastructure. Moving on to section
  4246. 2:33:38three, the AWS exam trap. Look, if you
  4247. 2:33:42are preparing for the AWS solutions
  4248. 2:33:44architect associate exam right now, do
  4249. 2:33:47not miss this. It is a classic pitfall.
  4250. 2:33:49AWS will constantly try to confuse you
  4251. 2:33:52between Amazon SNS and Amazon SQS. Pay
  4252. 2:33:55attention to the exact wording. If the
  4253. 2:33:58exam asks for a publish subscribe
  4254. 2:34:00messaging model to push alerts, the
  4255. 2:34:02answer is always SNS. But if the exam
  4256. 2:34:05asks you to decouple an architecture by
  4257. 2:34:07holding or storing messages until a
  4258. 2:34:09worker is ready to pull them, the answer
  4259. 2:34:11is the SQSQ. SNS pushes alerts
  4260. 2:34:14instantly. SQS holds messages safely.
  4261. 2:34:18Okay, let's do a fast punchy recap to
  4262. 2:34:20really lock this all in. Event-driven
  4263. 2:34:22architectures decouple your systems so
  4264. 2:34:25they literally can't break each other.
  4265. 2:34:27Here are your three rapidfire takeaways.
  4266. 2:34:29Number one, both of these services are
  4267. 2:34:31absolutely critical for building highly
  4268. 2:34:33available fault tolerant cloud
  4269. 2:34:35environments. Number two, SNS uses a pub
  4270. 2:34:38sub model to instantly push data to
  4271. 2:34:40subscribers exactly like a megaphone.
  4272. 2:34:42And number three, EventBridge is heavily
  4273. 2:34:44used to trigger serverless workflows
  4274. 2:34:46like AWS Lambda based on custom rules
  4275. 2:34:49acting as your smart router. And before
  4276. 2:34:52we wrap up, here is your final warning.
  4277. 2:34:55Never assume that event driven means
  4278. 2:34:56reliable delivery all by itself. If you
  4279. 2:34:59push an event from SNS and the target
  4280. 2:35:00server happens to be down, that message
  4281. 2:35:02is just gone. For true reliability, you
  4282. 2:35:05often have to combine SNS with SQS to
  4283. 2:35:07catch and hold that data safely. So
  4284. 2:35:10think about how you are building your
  4285. 2:35:11pipelines right now. Are they rigid and
  4286. 2:35:13fragile or are they truly decoupled?
  4287. 2:35:15>> Designing fault tolerant systems. All
  4288. 2:35:17right, let's just dive straight into
  4289. 2:35:19this one. I want you to imagine for a
  4290. 2:35:21second that you are checking out on a
  4291. 2:35:23massive e-commerce site on Black Friday.
  4292. 2:35:25You've been waiting all week for this
  4293. 2:35:27exact deal. You finally hit that
  4294. 2:35:30purchase button on a brand new $1,000
  4295. 2:35:32TV. But exactly at that specific
  4296. 2:35:35millisecond, the physical server
  4297. 2:35:37processing your order literally catches
  4298. 2:35:39fire in the data center. I'm talking
  4299. 2:35:42motherboards frying, cables melting,
  4300. 2:35:44that machine is completely 100% dead.
  4301. 2:35:47So, what happens next? Does your screen
  4302. 2:35:50just suddenly freeze up? Do you actually
  4303. 2:35:52lose your money? Or does the order just
  4304. 2:35:54somehow go through completely normally?
  4305. 2:35:56Think about that for a second because
  4306. 2:35:58the difference between those outcomes is
  4307. 2:36:00exactly what we're looking at in today's
  4308. 2:36:02explainer fault tolerance. Let's start
  4309. 2:36:04from zero here. At the end of the day,
  4310. 2:36:06servers are just computers. And we all
  4311. 2:36:09know computers break, network cables get
  4312. 2:36:11accidentally cut, and sometimes entire
  4313. 2:36:13data centers just lose power. If your
  4314. 2:36:16architecture relies on one single server
  4315. 2:36:18to do its job, well, that is called a
  4316. 2:36:20single point of failure. When that
  4317. 2:36:22server dies, your business dies with it.
  4318. 2:36:25Designing resilient architectures is
  4319. 2:36:27entirely about mitigating those single
  4320. 2:36:28points of failure so your application
  4321. 2:36:30can actually survive the chaos. Section
  4322. 2:36:33one, high availability versus fault
  4323. 2:36:35tolerance. Let's look at the core
  4324. 2:36:37differences between these two concepts.
  4325. 2:36:40High availability essentially means the
  4326. 2:36:42system might actually go down, but it
  4327. 2:36:43recovers incredibly fast. The user is
  4328. 2:36:46definitely going to experience a brief
  4329. 2:36:47interruption. Maybe they see a loading
  4330. 2:36:49spinner, a slight delay, or maybe a
  4331. 2:36:51quick retry screen, but eventually the
  4332. 2:36:53system does recover and gets back to
  4333. 2:36:54normal. Fault tolerance, on the other
  4334. 2:36:56hand, means the system never stops. It
  4335. 2:36:59literally tolerates the failure with
  4336. 2:37:02absolutely zero interruption to the end
  4337. 2:37:04user. Traffic is instantly rerouted to
  4338. 2:37:06backup systems and the user experience
  4339. 2:37:09continues seamlessly. They have
  4340. 2:37:11absolutely no idea anything went wrong
  4341. 2:37:13behind the scenes. Think about it like
  4342. 2:37:15driving a vehicle. High availability is
  4343. 2:37:17basically a standard car with a spare
  4344. 2:37:19tire. If you blow a tire, you have to
  4345. 2:37:21pull over, jack up the car, and
  4346. 2:37:23physically change it. Sure, it saves you
  4347. 2:37:25from being completely stranded, but
  4348. 2:37:27there is a clear, noticeable delay. Your
  4349. 2:37:29trip was interrupted. Fault tolerance is
  4350. 2:37:31driving a massive 18-wheeler truck. If
  4351. 2:37:34one of those tires completely blows out
  4352. 2:37:35on the highway at 70 mph, the driver
  4353. 2:37:37doesn't even have to tap the brakes. The
  4354. 2:37:39other 17 tires instantly absorb all that
  4355. 2:37:41massive weight. The truck just keeps
  4356. 2:37:43driving like nothing happened. Section
  4357. 2:37:45two, building the 18-wheeler in AWS.
  4358. 2:37:48Let's see how we actually build this
  4359. 2:37:5018-wheeler truck in the cloud. Because
  4360. 2:37:52if you don't use the strategy, a single
  4361. 2:37:54hardware failure is going to cause drop
  4362. 2:37:56transactions, corrupted databases, and
  4363. 2:37:58massive brand damage. We do this by
  4364. 2:38:01using what AWS calls availability zones.
  4365. 2:38:03An availability zone is simply a
  4366. 2:38:05physically separated data center with
  4367. 2:38:07its own independent power and its own
  4368. 2:38:09independent cooling. You put your main
  4369. 2:38:11servers over in zone A. Then you put
  4370. 2:38:14redundant exact clone servers over in
  4371. 2:38:16zone B. But here's the thing. Servers
  4372. 2:38:19can't do this alone. You need a traffic
  4373. 2:38:21cop. So you put an application load
  4374. 2:38:23balancer right in front of them. This
  4375. 2:38:25load balancer is constantly pinging the
  4376. 2:38:27servers. Basically asking, "Hey, are you
  4377. 2:38:30healthy? Are you still there?" Now
  4378. 2:38:32imagine this happening in your system.
  4379. 2:38:34The load balancer detects that a server
  4380. 2:38:36in zone A just crashed. It stops sending
  4381. 2:38:38traffic there in a fraction of a second
  4382. 2:38:40and it silently reroutes all new traffic
  4383. 2:38:43straight over to the surviving servers
  4384. 2:38:45in zone B. The system isn't actually
  4385. 2:38:47invincible. It just hides the failure
  4386. 2:38:50perfectly from the end user. Let that
  4387. 2:38:53sink in for a second. That is the real
  4388. 2:38:55magic of this architecture. Section
  4389. 2:38:58three, the cost of perfection. And
  4390. 2:39:00listen, this is where people completely
  4391. 2:39:02mess up in the real world. Building true
  4392. 2:39:05fault tolerance is incredibly complex.
  4393. 2:39:07Think about it. If server A dies right
  4394. 2:39:09in the middle of a transaction, server B
  4395. 2:39:11needs to know exactly what was in that
  4396. 2:39:13user's shopping cart so it can
  4397. 2:39:14immediately take over. That means you
  4398. 2:39:16absolutely cannot store user data on the
  4399. 2:39:19compute servers themselves. You have to
  4400. 2:39:20design stateless workloads. You push
  4401. 2:39:23that cart data to external databases or
  4402. 2:39:25caching layers, completely decoupling
  4403. 2:39:27the stateful data so back-end processing
  4404. 2:39:29can happen at its own pace. Doing this
  4405. 2:39:31changes your entire engineering
  4406. 2:39:33codebase. It is also absolutely brutal
  4407. 2:39:35on your budget. You are paying out of
  4408. 2:39:37pocket to run duplicate servers and
  4409. 2:39:39duplicate databases across multiple
  4410. 2:39:41zones. If you blindly make every single
  4411. 2:39:43application perfectly fall tolerant, you
  4412. 2:39:44will bankrupt your company. You only
  4413. 2:39:46choose true fault tolerance for mission
  4414. 2:39:48critical systems. Things like payment
  4415. 2:39:49processors, healthcare records, stock
  4416. 2:39:51trading platforms, systems where
  4417. 2:39:53dropping one single transaction
  4418. 2:39:54literally costs a million dollars or
  4419. 2:39:56ruins someone's life. For basic internal
  4420. 2:39:58tools, a three-minute hiccup is
  4421. 2:39:59annoying. Sure, but it's totally fine.
  4422. 2:40:02So, the crucial point to remember is
  4423. 2:40:04that fault tolerance isn't just a cool
  4424. 2:40:06IT feature. It is a massive financial
  4425. 2:40:10insurance policy, and you pay for that
  4426. 2:40:13policy with heavy cloud infrastructure.
  4427. 2:40:15Section four, AWS exam strategy. Here
  4428. 2:40:19are a few quick tips for the test. If
  4429. 2:40:22you are a focused learner currently
  4430. 2:40:24studying for the AWS Solutions Architect
  4431. 2:40:26exam, pay really close attention here.
  4432. 2:40:28AWS will definitely try to trick you.
  4433. 2:40:31Designing resilient architectures makes
  4434. 2:40:33up 26% of your entire test. This is what
  4435. 2:40:37actually matters for passing. If an exam
  4436. 2:40:40question asks how to implement a fault
  4437. 2:40:42tolerant architecture to mitigate a
  4438. 2:40:44single point of failure, do not pick the
  4439. 2:40:46answer that just says take daily
  4440. 2:40:48backups. Backups are just data recovery.
  4441. 2:40:51They absolutely do not keep the site
  4442. 2:40:53online. Do pick the answer that combines
  4443. 2:40:55an application load balancer with an
  4444. 2:40:58autoscaling group spread across multiple
  4445. 2:41:00availability zones. And if the question
  4446. 2:41:02scales up to global disaster recovery
  4447. 2:41:04across entire regions, you need to look
  4448. 2:41:07for Amazon Route 53. That is the
  4449. 2:41:09critical answer to manage that massive
  4450. 2:41:11failover traffic. Section five, rapid
  4451. 2:41:14fire takeaways. Let's do a really fast
  4452. 2:41:17punchy recap to lock this all in.
  4453. 2:41:20Remember, high availability is
  4454. 2:41:21recovering fast while fault tolerance is
  4455. 2:41:24never going down. We achieve this by
  4456. 2:41:26spreading redundant infrastructure
  4457. 2:41:27across multiple AWS availability zones
  4458. 2:41:30and load balancing the traffic. Here are
  4459. 2:41:32your three rapidfire takeaways. One,
  4460. 2:41:34single points of failure are the
  4461. 2:41:36absolute biggest enemy in your cloud
  4462. 2:41:38architecture. Two, true fault tolerance
  4463. 2:41:40requires decoupling your stateful data
  4464. 2:41:42from your compute servers. Three,
  4465. 2:41:44application load balancers and Amazon
  4466. 2:41:46Route 553 are the critical routing
  4467. 2:41:48mechanisms that make that failover
  4468. 2:41:50completely invisible to your users. And
  4469. 2:41:53here is your final warning for today.
  4470. 2:41:55Are you buying an 18-wheeler just to go
  4471. 2:41:57get groceries? Do not overengineer.
  4472. 2:42:01Building a perfectly fault tolerant
  4473. 2:42:03architecture for a simple personal blog
  4474. 2:42:05is exactly like that. Always match your
  4475. 2:42:08cloud architecture to your actual
  4476. 2:42:10business risk. Keep learning. Keep
  4477. 2:42:13building and make sure you're always
  4478. 2:42:14designing for the real world.
  4479. 2:42:16>> All right, let's set the scene. Imagine
  4480. 2:42:18a customer on your app. They just hit
  4481. 2:42:20buy now on a $1,000 flight. But then the
  4482. 2:42:23loading spinner just freezes. They
  4483. 2:42:25panic, right? So what do they do? They
  4484. 2:42:27hit the button three more times. A
  4485. 2:42:29minute later, their phone buzzes. But
  4486. 2:42:31they weren't charged once. They were
  4487. 2:42:33charged four times. $4,000 instantly
  4488. 2:42:37drained from their bank account. Your
  4489. 2:42:38support inbox is absolutely about to
  4490. 2:42:41explode. in your company. Yeah, you're
  4491. 2:42:43about to be humiliated on social media.
  4492. 2:42:45So, how do you stop this from happening?
  4493. 2:42:48Well, in this explainer, we're going to
  4494. 2:42:49see that you really just need to master
  4495. 2:42:51two concepts. Retries and it impotency.
  4496. 2:42:54Let's start from zero here. The cloud is
  4497. 2:42:56really just a giant web of cables and
  4498. 2:42:58servers. And you know how it goes.
  4499. 2:43:00Sometimes network connections drop.
  4500. 2:43:02Sometimes a database takes a millisecond
  4501. 2:43:04too long to answer. In a distributed
  4502. 2:43:06microser architecture, things fail
  4503. 2:43:08constantly. It's just a fact of life.
  4504. 2:43:11Now, think about the blind retry
  4505. 2:43:13nightmare. If your web server sends a
  4506. 2:43:15charge request to the payment server and
  4507. 2:43:18doesn't hear back, what does it do?
  4508. 2:43:20Naturally, it retries. But here is the
  4509. 2:43:23real nightmare scenario. What if the
  4510. 2:43:26payment server actually did charge the
  4511. 2:43:28card, but the success message just got
  4512. 2:43:30lost on the way back? If your web server
  4513. 2:43:32just blindly retries, you charge the
  4514. 2:43:34customer twice. To fix this exact
  4515. 2:43:36problem, we need item potency. I know
  4516. 2:43:39it's a massive, intimidating word, but
  4517. 2:43:41it has an incredibly simple meaning.
  4518. 2:43:43Item potency simply means that no matter
  4519. 2:43:45how many times you run the exact same
  4520. 2:43:47request, the end result only happens the
  4521. 2:43:50very first time. Think about it like an
  4522. 2:43:52elevator button. You press the button
  4523. 2:43:54for the fifth floor and the elevator
  4524. 2:43:56takes you to the fifth floor. If you
  4525. 2:43:58panic and smash that button 10 more
  4526. 2:44:00times, it doesn't take you to the 50th
  4527. 2:44:02floor. It just takes you to the fifth
  4528. 2:44:03floor. The extra clicks do absolutely
  4529. 2:44:05nothing. It really is the ultimate
  4530. 2:44:07safety net against duplicate actions.
  4531. 2:44:09Okay, so how do we actually build this
  4532. 2:44:11into our apps? It's simple. We use an
  4533. 2:44:14item potency key. Here's how it works.
  4534. 2:44:17When the user hits buy, your app
  4535. 2:44:19generates a unique string of letters and
  4536. 2:44:21numbers, basically a token. It sends
  4537. 2:44:23that token right along with the payment.
  4538. 2:44:25If the network drops and the app has to
  4539. 2:44:27retry, it sends the exact same token.
  4540. 2:44:30The payment server looks at it and says,
  4541. 2:44:31"Wait a minute. I already processed
  4542. 2:44:33token XYZ. I'm not charging them again.
  4543. 2:44:35I'll just send back the success message
  4544. 2:44:38because what happens if you don't use
  4545. 2:44:39it? You bankrupt your customers.
  4546. 2:44:42Think about that for a second. Now,
  4547. 2:44:44listen closely because this is where
  4548. 2:44:46people completely mess up. They
  4549. 2:44:48understand they need to retry failed
  4550. 2:44:50requests, but they build naive retries.
  4551. 2:44:52Think about it. If your database gets
  4552. 2:44:54overloaded, it slows down. If your web
  4553. 2:44:56servers aggressively retry every single
  4554. 2:44:58failed request every half second, what
  4555. 2:45:00happens? They double the traffic. Then
  4556. 2:45:02they quadruple it. You literally DDoS
  4557. 2:45:05your own architecture and crash the
  4558. 2:45:07entire company. To survive this, you
  4559. 2:45:09absolutely must use exponential backoff
  4560. 2:45:12and jitter. Exponential backoff means
  4561. 2:45:14you wait longer after every single
  4562. 2:45:16failure. First retry, you wait 1 second.
  4563. 2:45:19Second retry, wait 2 seconds. Third,
  4564. 2:45:22wait 4 seconds. You see what's
  4565. 2:45:23happening? You're backing off. You are
  4566. 2:45:25giving that struggling database some
  4567. 2:45:27much needed room to breathe. But you
  4568. 2:45:30also need jitter. Jitter adds pure
  4569. 2:45:33randomness to the mix. Think about two
  4570. 2:45:36people walking down a hallway who
  4571. 2:45:38accidentally step into each other's
  4572. 2:45:39path. They both step left, then they
  4573. 2:45:42both step right. They're stuck in a
  4574. 2:45:43loop. That right there is a retry storm.
  4575. 2:45:47Jitter is like one person waiting a
  4576. 2:45:48random fraction of a second before
  4577. 2:45:50moving. The collision is instantly
  4578. 2:45:52solved. By randomizing the retry timers,
  4579. 2:45:55your servers don't all attack the
  4580. 2:45:56database at the exact same millisecond.
  4581. 2:45:58So when do you actually use this stuff
  4582. 2:46:01in the real world? Well, when you design
  4583. 2:46:04solutions based on the AWS
  4584. 2:46:06wellarchchitected framework, you really
  4585. 2:46:08have to look at the action being taken.
  4586. 2:46:10Is it a read request? Like are you just
  4587. 2:46:12fetching a user profile? If so, you
  4588. 2:46:15don't need item potency keys. If it
  4589. 2:46:17fails, just retry. But is it a write
  4590. 2:46:20request? Are you processing a payment,
  4591. 2:46:22launching a server, or updating a
  4592. 2:46:24database record? If yes, you absolutely
  4593. 2:46:26must build in IDM potency. And here is a
  4594. 2:46:29huge exam trap warning. If you're taking
  4595. 2:46:32the AWS solutions architect exam, domain
  4596. 2:46:352 heavily tests your ability to design
  4597. 2:46:37loosely coupled resilient architectures.
  4598. 2:46:40AWS loves testing this concept using
  4599. 2:46:42Amazon API gateway and AWS Step
  4600. 2:46:44Functions. So, if a test scenario
  4601. 2:46:46describes an API that's failing due to
  4602. 2:46:48too many requests or throttling, do not
  4603. 2:46:51pick the answer that tells you to
  4604. 2:46:52immediately provision a bigger database.
  4605. 2:46:54Don't do it. The correct architectural
  4606. 2:46:56answer is almost always to implement
  4607. 2:46:57exponential backoff in your application
  4608. 2:46:59code to handle that throttling
  4609. 2:47:01gracefully. All right, let's do a fast
  4610. 2:47:03punchy recap. Edom potency means doing
  4611. 2:47:06something multiple times only changes
  4612. 2:47:07the data once. Retries save you from
  4613. 2:47:10temporary network drops and exponential
  4614. 2:47:12backoff and jitter save you from DDoSing
  4615. 2:47:14your own system. Here are your three
  4616. 2:47:16rapidfire takeaways for this explainer.
  4617. 2:47:18One, use item potency keys for any API
  4618. 2:47:21request that changes data or spends
  4619. 2:47:23money. Two, designing scalable and
  4620. 2:47:25loosely coupled microservices requires
  4621. 2:47:27intelligent retry strategies. And three,
  4622. 2:47:30never use fixed retry intervals. Always
  4623. 2:47:32add random jitter. Oh, and here is your
  4624. 2:47:35final trap. Item potency tokens
  4625. 2:47:37shouldn't live forever. If your database
  4626. 2:47:39has to remember every token ever
  4627. 2:47:41generated since the beginning of time,
  4628. 2:47:43your storage costs will absolutely
  4629. 2:47:45explode. Set them to expire
  4630. 2:47:46automatically after 24 hours. Keep your
  4631. 2:47:49system safe and keep them fast. So ask
  4632. 2:47:52yourself, if your network dropped right
  4633. 2:47:54now, would your retry logic save your
  4634. 2:47:57business or accidentally take it
  4635. 2:47:58offline? Welcome to this explainer on
  4636. 2:48:00AWS instance types. You know, if you've
  4637. 2:48:03ever spun up a server in the cloud and
  4638. 2:48:05just wondered why your monthly bill
  4639. 2:48:06looks like a phone number or why your
  4640. 2:48:08app keeps freezing up even though you're
  4641. 2:48:10paying top dollar, well, you are in
  4642. 2:48:12exactly the right place. Let's just dive
  4643. 2:48:14right into it. Picture this. You just
  4644. 2:48:17launched this massive realtime analytics
  4645. 2:48:19tool. Customers are flooding in. They're
  4646. 2:48:21uploading gigabytes of data and then
  4647. 2:48:23your server completely locks up. It is
  4648. 2:48:27literally frozen. So you look at your
  4649. 2:48:29AWS metrics and your CPU is barely
  4650. 2:48:31hovering at 10%. But your memory, it's
  4651. 2:48:34totally maxed out. Your users are
  4652. 2:48:36getting timeout errors. Your boss is
  4653. 2:48:38furiously asking why the thousands of
  4654. 2:48:39dollars you just dropped on AWS compute
  4655. 2:48:42wasn't enough to keep the site online.
  4656. 2:48:44So why did it crash? Well, because you
  4657. 2:48:46bought the absolute wrong type of
  4658. 2:48:48server. Let's start from zero and talk
  4659. 2:48:50about the basics. CPU versus memory.
  4660. 2:48:53Getting this ratio wrong, that's where
  4661. 2:48:55everything falls apart. Let's break this
  4662. 2:48:57down into its absolute simplest form.
  4663. 2:49:00When you launch an instance, you aren't
  4664. 2:49:02just picking some generic server off a
  4665. 2:49:04shelf. You're actually picking an exact
  4666. 2:49:06hardware recipe. It's a specific ratio
  4667. 2:49:08of CPU, memory, networking, and storage.
  4668. 2:49:12But really, a server just has two main
  4669. 2:49:14resources you need to care about right
  4670. 2:49:15now. CPU, which is the brain doing the
  4671. 2:49:18math, and memory or RAM, which is the
  4672. 2:49:20workbench holding the data. Different
  4673. 2:49:22applications need completely different
  4674. 2:49:23balances of these two things. If you get
  4675. 2:49:25this ratio wrong, your application
  4676. 2:49:27either suffocates and dies or you end up
  4677. 2:49:29wasting tens of thousands of dollars on
  4678. 2:49:31hardware you aren't even using. So, the
  4679. 2:49:33absolutely crucial point here is
  4680. 2:49:35understanding your hardware choices. Let
  4681. 2:49:38me show you the three main instance
  4682. 2:49:39families that you really must know.
  4683. 2:49:41First up, general purpose instances.
  4684. 2:49:44Think of the M and T families here.
  4685. 2:49:46These give you a perfectly balanced
  4686. 2:49:48ratio of CPU and memory. Think about it
  4687. 2:49:51kind of like a reliable Honda Civic. You
  4688. 2:49:53know, it's not the absolute fastest car
  4689. 2:49:55on the track, and it definitely can't
  4690. 2:49:57haul a giant commercial trailer, but it
  4691. 2:49:59gets you to work every single day
  4692. 2:50:00without failing. You're going to use
  4693. 2:50:02these for standard web servers, small
  4694. 2:50:04databases, and everyday codebased
  4695. 2:50:06testing. If you don't use them for these
  4696. 2:50:08basic workloads, you're just going to
  4697. 2:50:09end up overpaying for specialized
  4698. 2:50:11hardware you simply do not need. Second,
  4699. 2:50:14we have compute optimized instances, the
  4700. 2:50:16C family. These give you massive,
  4701. 2:50:18incredibly highowered CPUs. Think about
  4702. 2:50:21it like a genius math professor. You
  4703. 2:50:23hand them a massively complex equation
  4704. 2:50:25and they solve it instantly, but they
  4705. 2:50:27don't need a huge physical desk to do
  4706. 2:50:29it. you're going to use compute
  4707. 2:50:31optimized instances for things like
  4708. 2:50:32multiplayer gaming servers, high-res
  4709. 2:50:34video encoding, or heavy machine
  4710. 2:50:36learning inference. And this brilliantly
  4711. 2:50:38illustrates exactly why that distinction
  4712. 2:50:40matters. If you're encoding a 4K video,
  4713. 2:50:43you do not need massive amounts of
  4714. 2:50:45memory to hold user profiles. What you
  4715. 2:50:47need is raw processing power. Think
  4716. 2:50:49about that for a second. By switching to
  4717. 2:50:50a cype instance, your video processes 10
  4718. 2:50:53times faster for half the cost. It's
  4719. 2:50:55like a light bulb goes off, right? you
  4720. 2:50:57are buying the exact tool for the exact
  4721. 2:50:59job. Third, we have memory optimized
  4722. 2:51:02instances. That's the R and X families.
  4723. 2:51:04These come with absolutely massive
  4724. 2:51:06amounts of RAM. Think of it like a giant
  4725. 2:51:0810-ft long workbench. It lets you lay
  4726. 2:51:11out a million puzzle pieces all at once,
  4727. 2:51:13so you can see literally everything
  4728. 2:51:14without having to dig through boxes. You
  4729. 2:51:16use these for high performance
  4730. 2:51:18relational databases or massive
  4731. 2:51:20in-memory caching systems. So, what
  4732. 2:51:22happens if you don't use this? Well, if
  4733. 2:51:24you try to run a heavy memory intensive
  4734. 2:51:25database on a compute optimized server,
  4735. 2:51:28it instantly runs out of memory and
  4736. 2:51:29crashes just like that analytics tool we
  4737. 2:51:31talked about earlier. Now, let's talk
  4738. 2:51:34about the realworld scaling trap. Pay
  4739. 2:51:36close attention here because this this
  4740. 2:51:38is where people completely mess up in
  4741. 2:51:40the real world. Here is how developers
  4742. 2:51:43tend to get lazy. They launch a basic
  4743. 2:51:45web app, it starts running a little
  4744. 2:51:47slow, so they panic and just double the
  4745. 2:51:49size of their general purpose instance.
  4746. 2:51:51Then inevitably it gets slow again down
  4747. 2:51:53the road. So they double it again. They
  4748. 2:51:56are just scaling up vertically using the
  4749. 2:51:58exact same resource ratio. What happens
  4750. 2:52:00is they end up paying for massive
  4751. 2:52:02amounts of memory they aren't even
  4752. 2:52:03touching just to squeeze out a slightly
  4753. 2:52:05better CPU. You literally bankrupt your
  4754. 2:52:08cloud budget by using a massive
  4755. 2:52:09sledgehammer just to push in a tiny
  4756. 2:52:11thumbtack. So how do you actually make
  4757. 2:52:14this choice? It is a strict business and
  4758. 2:52:17engineering decision. You have to look
  4759. 2:52:19at your actual application metrics. If
  4760. 2:52:21the server is starving for brain power,
  4761. 2:52:23you choose compute optimized. If it's
  4762. 2:52:26choking because it just cannot hold
  4763. 2:52:27enough data at once, you choose memory
  4764. 2:52:29optimized. And if it's just doing a
  4765. 2:52:31little bit of everything, you stick to
  4766. 2:52:33general purpose. Once you see it, it
  4767. 2:52:35makes total sense. The application
  4768. 2:52:36workload dictates the hardware family,
  4769. 2:52:38not the other way around. Now, let's
  4770. 2:52:40look at how this applies to the AWS
  4771. 2:52:42exam. Because if you're studying for the
  4772. 2:52:44solutions architect associate,
  4773. 2:52:46understanding this logic is absolutely
  4774. 2:52:48critical. Choosing the right EC2
  4775. 2:52:51instance hits exactly on domain 3, high
  4776. 2:52:53performing architectures, and domain 4,
  4777. 2:52:56costoptimized architectures. Listen, AWS
  4778. 2:52:59will absolutely test your ability to
  4779. 2:53:00select the appropriate compute options,
  4780. 2:53:02instance families, and sizes to meet
  4781. 2:53:04specific business requirements. And here
  4782. 2:53:07is the trap they love to set. AWS will
  4783. 2:53:09give you a scenario where an application
  4784. 2:53:11is memory constrained, but the company
  4785. 2:53:13wants to keep costs low. Do not pick the
  4786. 2:53:15answer that tells you to just upgrade to
  4787. 2:53:17a larger general purpose instance. That
  4788. 2:53:18forces you to pay for extra CPU you just
  4789. 2:53:20don't need. Always select the exact
  4790. 2:53:22instance family memory optimized in this
  4791. 2:53:25case that solves the specific bottleneck
  4792. 2:53:27without wasting money on the other
  4793. 2:53:28resources. All right, let's do a fast
  4794. 2:53:31punchy recap with some rapidfire
  4795. 2:53:33takeaways. Remember, general purpose is
  4796. 2:53:36balanced for everyday traffic. Compute
  4797. 2:53:38is pure brain power. Memory is a massive
  4798. 2:53:41workbench space. We can simplify all of
  4799. 2:53:43this into three core principles. One,
  4800. 2:53:45sizing your instances correctly is the
  4801. 2:53:47absolute foundation of costoptimized
  4802. 2:53:49comput solutions. Two, decoupling your
  4803. 2:53:52workloads allows you to pick different
  4804. 2:53:54specialized instance types for different
  4805. 2:53:55parts of your application. And three,
  4806. 2:53:58the letter in the instance name is your
  4807. 2:53:59actual cheat code. C for compute, R for
  4808. 2:54:02RAM, and M for mainstream. And that
  4809. 2:54:04brings us to your final trap. Never ever
  4810. 2:54:07guess your instance size. Always load
  4811. 2:54:10test your application in a dev
  4812. 2:54:11environment first so you can actually
  4813. 2:54:13see whether it runs out of CPU or memory
  4814. 2:54:15and then pick your family. Guessing in
  4815. 2:54:18production is quite literally just
  4816. 2:54:19gambling with your company's money. So
  4817. 2:54:21I'll leave you with this. Are you going
  4818. 2:54:23to architect for actual success or are
  4819. 2:54:25you going to keep treating your cloud
  4820. 2:54:27budget like a casino?
  4821. 2:54:28>> Imagine you just built a highfrequency
  4822. 2:54:30stock trading bot. We're talking about a
  4823. 2:54:32scenario where literally milliseconds
  4824. 2:54:34equal millions of dollars. You go ahead
  4825. 2:54:37and launch two massive, insanely
  4826. 2:54:40expensive EC2 instances. You've got one
  4827. 2:54:42calculating the market trends and the
  4828. 2:54:44other one executing the actual trades.
  4829. 2:54:46The market opens, but your system is
  4830. 2:54:49lagging. You are bleeding money on every
  4831. 2:54:52single trade. So why is this happening?
  4832. 2:54:55I mean, you bought the absolute best
  4833. 2:54:57servers in the world. Well, it's because
  4834. 2:54:59AWS randomly placed them in completely
  4835. 2:55:02different buildings inside their massive
  4836. 2:55:03data center. The actual physical network
  4837. 2:55:06cable connecting your two instances is
  4838. 2:55:08literally 2 m long. How do we fix this?
  4839. 2:55:11We take direct control of the hardware
  4840. 2:55:13using EC2 placement groups. Let's start
  4841. 2:55:16right from zero here. When you launch a
  4842. 2:55:18virtual server in AWS, they usually just
  4843. 2:55:20throw it onto any available hardware
  4844. 2:55:22rack with open space. And honestly, for
  4845. 2:55:2499% of web apps out there, that's
  4846. 2:55:26perfectly fine. But when you're building
  4847. 2:55:28high performing architectures, physical
  4848. 2:55:30distance matters, hardware failures
  4849. 2:55:32matter. Placement groups give you direct
  4850. 2:55:34absolute control over the actual
  4851. 2:55:36physical placement of your virtual
  4852. 2:55:37servers inside the AWS data center. In
  4853. 2:55:40this explainer, I'm going to show you
  4854. 2:55:42the three exact strategies you
  4855. 2:55:43absolutely must know. Let's dive right
  4856. 2:55:46into strategy number one, cluster
  4857. 2:55:48placement. This one is all about getting
  4858. 2:55:50blistering network speed. With a cluster
  4859. 2:55:53setup, you're essentially telling AWS,
  4860. 2:55:55"Hey, put all of my servers on the exact
  4861. 2:55:58same physical rack and plug them into
  4862. 2:56:00the exact same network switch." Why does
  4863. 2:56:02this exist? It's for blistering,
  4864. 2:56:04ridiculously fast network speed. We are
  4865. 2:56:07talking 10 GBs per second of pure
  4866. 2:56:09throughput. Think about it like moving
  4867. 2:56:11your entire engineering team into one
  4868. 2:56:13tiny conference room. If you need to ask
  4869. 2:56:15a question, you don't write up an email
  4870. 2:56:17and wait around. You just yell across
  4871. 2:56:19the table. It's completely instant. What
  4872. 2:56:21happens if you don't use this strategy?
  4873. 2:56:23Well, your high performance computing
  4874. 2:56:25jobs or your superheavy machine learning
  4875. 2:56:27models could take weeks to run instead
  4876. 2:56:29of hours. All because the servers are
  4877. 2:56:30constantly waiting for data to travel
  4878. 2:56:32across a massive data center. But, and
  4879. 2:56:34this is a big butt, the trade-off is
  4880. 2:56:36extreme risk. If that one specific
  4881. 2:56:38hardware rack loses power, your entire
  4882. 2:56:40cluster dies instantly. And that brings
  4883. 2:56:43us to the exact opposite approach.
  4884. 2:56:45Strategy number two, spread placement.
  4885. 2:56:48This one is for paranoid fault
  4886. 2:56:50tolerance. Here you are telling AWS
  4887. 2:56:52absolutely never put these servers on
  4888. 2:56:54the same rack. I want them on completely
  4889. 2:56:56different physical hardware, plugged
  4890. 2:56:58into different power supplies, and
  4891. 2:57:00connected to completely different
  4892. 2:57:01network switches. Analogy time. It's
  4893. 2:57:04kind of like the top executives of a
  4894. 2:57:06massive corporation. The CEO, the CFO,
  4895. 2:57:09and the COO are strictly forbidden from
  4896. 2:57:12flying on the same airplane. If one
  4897. 2:57:14plane goes down, the company survives.
  4898. 2:57:16If you don't use a spread placement
  4899. 2:57:18group, a single hardware failure in the
  4900. 2:57:20AWS data center could accidentally wipe
  4901. 2:57:23out your primary database and your
  4902. 2:57:24backup database at the exact same
  4903. 2:57:26millisecond. And we definitely do not
  4904. 2:57:28want that. So now it clicks, right?
  4905. 2:57:31Spread placement really isn't about
  4906. 2:57:33speed at all. It is pure paranoid fault
  4907. 2:57:36tolerance. Now listen closely because
  4908. 2:57:39this is where people mess up. You might
  4909. 2:57:41be sitting there thinking,"Great, I'll
  4910. 2:57:43just put my entire massive company's
  4911. 2:57:45infrastructure into a spread group."
  4912. 2:57:46Well, you can't. AWS strictly limits
  4913. 2:57:49spread groups to just seven servers per
  4914. 2:57:51availability zone. It's really only
  4915. 2:57:53meant for a few missionritical
  4916. 2:57:54instances. Now, here's where this gets
  4917. 2:57:57really interesting. What if you have
  4918. 2:57:58hundreds of servers, but you still
  4919. 2:58:00absolutely need that hardware fall
  4920. 2:58:02tolerance? Well, that is where our third
  4921. 2:58:04type comes in. Number three, partition
  4922. 2:58:07placement, which is explicitly designed
  4923. 2:58:09for large distributed safety. Partition
  4924. 2:58:12groups divide all your servers into
  4925. 2:58:14separate logical chunks, appropriately
  4926. 2:58:16called partitions. And each partition
  4927. 2:58:18gets its own entirely isolated power and
  4928. 2:58:21network source. Think of it like
  4929. 2:58:23dividing your company across three
  4930. 2:58:25completely different office buildings.
  4931. 2:58:26Let's call them building A, building B,
  4932. 2:58:29and building C. If building A
  4933. 2:58:31unfortunately catches fire and loses
  4934. 2:58:33power, everyone in buildings B and C
  4935. 2:58:35just keeps on working normally. You'd
  4936. 2:58:37use this strategy specifically for
  4937. 2:58:39massive distributed workloads like
  4938. 2:58:41Hadoop, Cassandra, or Kafka. These
  4939. 2:58:43software platforms are incredibly smart.
  4940. 2:58:45They actually look at your physical AWS
  4941. 2:58:47partitions and say, "Okay, I'll save the
  4942. 2:58:49primary data over in partition A and
  4943. 2:58:51I'll safely place the backup copy over
  4944. 2:58:52in partition B." Think about that for a
  4945. 2:58:55second. Your database software actually
  4946. 2:58:57communicates with the physical AWS
  4947. 2:58:59architecture to ensure it never puts all
  4948. 2:59:01its eggs in one basket. It's a total
  4949. 2:59:03gamecher. Partition gives you massive
  4950. 2:59:06scale and physical safety at the exact
  4951. 2:59:07same time. So when do you actually need
  4952. 2:59:10to make this choice? Well, if you're
  4953. 2:59:12gearing up to take the AWS solutions
  4954. 2:59:14architect exam, domain 3 is entirely
  4955. 2:59:17about high-erforming architectures. And
  4956. 2:59:19believe me, AWS will test this topic
  4957. 2:59:22ruthlessly. Here's your cheat sheet. If
  4958. 2:59:25an exam question mentions high
  4959. 2:59:26performance computing, HPC or low
  4960. 2:59:29network latency, the answer is always a
  4961. 2:59:31cluster placement group. Now, if the
  4962. 2:59:33question says a small number of critical
  4963. 2:59:35instances or strictly mentions different
  4964. 2:59:37underlying hardware, your answer is
  4965. 2:59:39spread. And if the question explicitly
  4966. 2:59:41throws out names like Hadoop, Kafka, or
  4967. 2:59:44mentions large distributed workloads,
  4968. 2:59:46the answer is partition. Seriously, do
  4969. 2:59:48not miss those keywords. All right,
  4970. 2:59:51let's do a fast punchy recap. Cluster is
  4971. 2:59:54for extreme speed on one rack. Spread is
  4972. 2:59:57for extreme separation of a few critical
  4973. 2:59:59servers and partition is for large-scale
  4974. 3:00:02distributed safety. Here are your three
  4975. 3:00:05rapidfire takeaways to burn into your
  4976. 3:00:07memory. Number one, cluster placement
  4977. 3:00:10introduces a massive single point of
  4978. 3:00:12failure for the absolute sake of speed.
  4979. 3:00:14Number two, spread placement is strictly
  4980. 3:00:17limited to just seven instances per
  4981. 3:00:19availability zone. And number three,
  4982. 3:00:21partition placement brilliantly ties
  4983. 3:00:23application level data replication
  4984. 3:00:25directly to physical hardware isolation.
  4985. 3:00:27And here is your final trap to watch out
  4986. 3:00:30for. You cannot simply take an existing
  4987. 3:00:33running EC2 instance and magically move
  4988. 3:00:35it into a placement group. No way. You
  4989. 3:00:38literally have to stop the instance
  4990. 3:00:40completely before making the change.
  4991. 3:00:42Plan your physical architecture before
  4992. 3:00:44you launch, not after. So before your
  4993. 3:00:46next big AWS deployment, I want you to
  4994. 3:00:49ask yourself, is your system designed to
  4995. 3:00:51prioritize blistering speed, paranoid
  4996. 3:00:53survival, or massive scale?
  4997. 3:00:55>> Okay, picture this. You've just finished
  4998. 3:00:57patching your company's primary database
  4999. 3:00:59server. Routine stuff, right? You hit
  5000. 3:01:01restart, the server takes a minute, it
  5001. 3:01:03boots back up, and you log in. And your
  5002. 3:01:05database is completely gone. I don't
  5003. 3:01:08mean corrupted, I mean gone. the actual
  5004. 3:01:11physical hard drive that your data was
  5005. 3:01:13sitting on literally vanished into thin
  5006. 3:01:15air. You just permanently destroyed your
  5007. 3:01:18entire company's order history. So why
  5008. 3:01:20did this happen? Well, it happens
  5009. 3:01:22because of a simple but absolutely
  5010. 3:01:24devastating misunderstanding between
  5011. 3:01:26temporary and permanent cloud storage.
  5012. 3:01:29Let's back up and start from zero for
  5013. 3:01:31this explainer. When you launch a
  5014. 3:01:33virtual server in AWS, an Amazon EC2
  5015. 3:01:35instance, it obviously needs a hard
  5016. 3:01:38drive. It needs a place to install the
  5017. 3:01:40operating system, store your files, and
  5018. 3:01:42you know, actually run your database. In
  5019. 3:01:45the cloud world, we call this block
  5020. 3:01:47storage. And here is the kicker. If you
  5021. 3:01:49choose the wrong type of block storage,
  5022. 3:01:51your data is either going to be
  5023. 3:01:52painfully slow or perfectly capable of
  5024. 3:01:54deleting itself without any warning.
  5025. 3:01:56Let's look at the two main ways AWS
  5026. 3:01:58gives you these block storage hard
  5027. 3:02:00drives. Option number one, the EC2
  5028. 3:02:03instance store. Blistering speed
  5029. 3:02:05physically attached. Now, what's really
  5030. 3:02:08fascinating about this setup is the
  5031. 3:02:10physical reality of the cloud. An
  5032. 3:02:12instance store is a physical hard drive
  5033. 3:02:14physically plugged into the exact same
  5034. 3:02:16hardware rack as your virtual server.
  5035. 3:02:19It's exactly like the hard drive built
  5036. 3:02:20directly into your personal laptop right
  5037. 3:02:22now. And because that drive is literally
  5038. 3:02:24touching the motherboard, the speed is
  5039. 3:02:26absolutely blistering. We are talking
  5040. 3:02:28millions of input and output operations
  5041. 3:02:30every single second. It is the ultimate
  5042. 3:02:32raw higherformance storage. But here is
  5043. 3:02:36the massive catch. It is ephemeral. That
  5044. 3:02:39means it's temporary. If you shut down
  5045. 3:02:42that EC2 instance, AWS takes that
  5046. 3:02:44physical hardware and just hands it over
  5047. 3:02:46to someone else. And your data, it's
  5048. 3:02:48wiped forever. Think about that for a
  5049. 3:02:50second. So the absolutely crucial point
  5050. 3:02:53here is this. If the underlying physical
  5051. 3:02:56hardware fails, or even worse, if you
  5052. 3:02:58just innocently click stop in the AWS
  5053. 3:03:01console to maybe save a few bucks over
  5054. 3:03:03the weekend, your hard drive is
  5055. 3:03:04literally thrown in the virtual trash.
  5056. 3:03:06You get pure raw speed, but with
  5057. 3:03:09absolutely zero long-term safety. Which
  5058. 3:03:12brings us to option number two, Amazon
  5059. 3:03:14Elastic Block Store, or EBS, the
  5060. 3:03:17networkattached safety net. EBS is a
  5061. 3:03:20networkattached drive. It is not
  5062. 3:03:22physically inside your server. It lives
  5063. 3:03:24somewhere completely different in the
  5064. 3:03:25data center and it connects to your EC2
  5065. 3:03:27instance over a lightning fast network
  5066. 3:03:29cable. The best way to think about it is
  5067. 3:03:31like a massive indestructible USB thumb
  5068. 3:03:33drive. You could literally unplug it
  5069. 3:03:35from server A, walk it over, and plug it
  5070. 3:03:37right into server B. Now, imagine that
  5071. 3:03:40same disastrous scenario in your system.
  5072. 3:03:43Your EC2 server completely crashes and
  5073. 3:03:46burns. But this time, you don't panic.
  5074. 3:03:49Why? Because the EBS volume is sitting
  5075. 3:03:51safely over on the network, you just
  5076. 3:03:53calmly spin up a brand new server,
  5077. 3:03:56attach that old EBS volume, and boom,
  5078. 3:03:58your database is perfectly intact. And
  5079. 3:04:01this brilliantly illustrates exactly why
  5080. 3:04:03this matters. EBS completely decouples
  5081. 3:04:06your persistent data from your fragile
  5082. 3:04:08comput hardware. It separates the two.
  5083. 3:04:10Now, this is where people mess up. You
  5084. 3:04:13might be sitting there thinking, "Wait a
  5085. 3:04:15minute. Why would I ever use an instance
  5086. 3:04:17store if it intentionally deletes my
  5087. 3:04:19data? And honestly, it's a really great
  5088. 3:04:22question. Well, this is where it gets
  5089. 3:04:24super interesting. If you're building,
  5090. 3:04:26say, a massive highfrequency trading
  5091. 3:04:28platform or maybe a giant in-memory
  5092. 3:04:30cache, network latency will literally
  5093. 3:04:33kill your application. EBS is incredibly
  5094. 3:04:36fast. Sure, it offers both solid state
  5095. 3:04:38and hard disk drive options, but that
  5096. 3:04:39data still has to physically travel
  5097. 3:04:41across a network cable. An instant store
  5098. 3:04:44on the other hand has zero network
  5099. 3:04:45latency. None. So when do you actually
  5100. 3:04:48choose which? You are going to choose
  5101. 3:04:50Amazon EBS for about 95% of your
  5102. 3:04:53workloads. We're talking your databases,
  5103. 3:04:55web servers, boot volumes, basically
  5104. 3:04:57anything where your data absolutely must
  5105. 3:04:59survive a server stop. You choose an
  5106. 3:05:01instance store only for temporary data,
  5107. 3:05:04things like caches, buffers, scratch
  5108. 3:05:06data, or maybe load balanced session
  5109. 3:05:08data that you've already backed up
  5110. 3:05:09somewhere else. You use it when you need
  5111. 3:05:11absolute maximum performance and you
  5112. 3:05:13literally do not care if the drive
  5113. 3:05:14explodes. Section three, the AWS exam
  5114. 3:05:18trap. Solutions architect associate
  5115. 3:05:20domain 3. If you are studying for the
  5116. 3:05:23AWS solutions architect associate exam,
  5117. 3:05:26domain 3 specifically tests your ability
  5118. 3:05:28to pick high performing and scalable
  5119. 3:05:30storage solutions. Please do not miss
  5120. 3:05:33this trap. AWS loves to give you a
  5121. 3:05:36scenario asking for the highest possible
  5122. 3:05:37IO performance for a database cache. If
  5123. 3:05:40the data is temporary, the answer is
  5124. 3:05:42always instance store. Always. But watch
  5125. 3:05:46their exact wording. Again, this is
  5126. 3:05:49where people mess up. If the question
  5127. 3:05:51mentions that the data must be
  5128. 3:05:52persistent or that the architecture must
  5129. 3:05:54be fault tolerant against EC2
  5130. 3:05:56termination, you absolutely cannot use
  5131. 3:05:59an instance store. You must choose an
  5132. 3:06:00EBS volume. Specifically, you'd want a
  5133. 3:06:03provisioned IOPS solidstate drive, which
  5134. 3:06:05guarantees that high performance without
  5135. 3:06:07losing the data. All right, let's do a
  5136. 3:06:10fast punchy recap. Block storage gives
  5137. 3:06:12your EC2 instances a hard drive. The
  5138. 3:06:14instance store is physically attached,
  5139. 3:06:16lightning fast, but completely
  5140. 3:06:18temporary. Amazon EBS is network
  5141. 3:06:20attached, slightly slower, but permanent
  5142. 3:06:22and flexible. Here are your three
  5143. 3:06:25rapidfire takeaways. Number one,
  5144. 3:06:28stopping an EC2 instance permanently
  5145. 3:06:30deletes any data on an instance store
  5146. 3:06:32volume. Number two, Amazon EBS volumes
  5147. 3:06:36can be safely detached and reattached to
  5148. 3:06:38entirely different instances within the
  5149. 3:06:40same availability zone. And number
  5150. 3:06:43three, high-erforming caching
  5151. 3:06:45architectures rely on instance store for
  5152. 3:06:47raw unbottlenecked speed. And here is
  5153. 3:06:50your final trap to watch out for. Do not
  5154. 3:06:53confuse rebooting with stopping. If you
  5155. 3:06:56simply restart an EC2 instance from the
  5156. 3:06:58operating system, your instance store
  5157. 3:07:00data actually survives. It only wipes
  5158. 3:07:03when the instance is explicitly stopped
  5159. 3:07:05or terminated. So before you ever click
  5160. 3:07:08that stop button in the console, ask
  5161. 3:07:10yourself, do you know exactly what kind
  5162. 3:07:12of hard drive you are running?
  5163. 3:07:13>> Imagine migrating your company's legacy
  5164. 3:07:16application to the cloud. You spin up 50
  5165. 3:07:19EC2 instances behind a load balancer,
  5166. 3:07:22but your app relies on a massive shared
  5167. 3:07:24folder of files. You attach a standard
  5168. 3:07:27block storage drive to one server, and
  5169. 3:07:29suddenly the other 49 servers crash
  5170. 3:07:32because they cannot see the data. You
  5171. 3:07:34just broke a multi-million dollar
  5172. 3:07:36application. So, why did it break? Well,
  5173. 3:07:39because standard block storage is like a
  5174. 3:07:41personal hard drive. It is designed to
  5175. 3:07:43plug into one specific server at a time.
  5176. 3:07:46If you have dozens of servers that all
  5177. 3:07:48need to read and write to the exact same
  5178. 3:07:50files at the exact same millisecond,
  5179. 3:07:52personal hard drives will fail you. You
  5180. 3:07:55need a highly scalable shared network
  5181. 3:07:57file system. This is file storage. It is
  5182. 3:08:00a live shared directory that thousands
  5183. 3:08:02of computers can open simultaneously
  5184. 3:08:04over a network. Let me show you the
  5185. 3:08:06first major way AWS solves this. Amazon
  5186. 3:08:10Elastic File System or Amazon EFS. EFS
  5187. 3:08:13is a fully managed shared file system
  5188. 3:08:16built specifically for Linux. Think
  5189. 3:08:18about it like an infinite Google Drive
  5190. 3:08:20for your Linux servers. You don't have
  5191. 3:08:22to guess how big it needs to be. It
  5192. 3:08:24scales automatically as you drop files
  5193. 3:08:26in and shrinks when you delete them.
  5194. 3:08:28What happens if you don't use it? You
  5195. 3:08:29have to build and manage your own
  5196. 3:08:30massive file server from scratch. If
  5197. 3:08:32that physical server loses power, your
  5198. 3:08:35whole company stops. EFS handles all
  5199. 3:08:37that redundancy for you across multiple
  5200. 3:08:39availability zones. Think about that for
  5201. 3:08:42a second. You can have 10,000 EC2
  5202. 3:08:44instances spread across three different
  5203. 3:08:46data centers, all editing the exact same
  5204. 3:08:48file in real time without locking each
  5205. 3:08:50other out. And that is when it clicks.
  5206. 3:08:52Oh, now I get it. It's an infinitely
  5207. 3:08:55scaling shared drive. Now, here's where
  5208. 3:08:58people completely fail this in the real
  5209. 3:09:00world. You try to take that same EFS
  5210. 3:09:03drive and plug it into a Windows server.
  5211. 3:09:06It fails. EFS does not speak Windows. It
  5212. 3:09:09doesn't understand Microsoft
  5213. 3:09:10permissions. So what do you do if your
  5214. 3:09:12enterprise runs on Microsoft? That
  5215. 3:09:15brings us to Amazon FSX, specifically
  5216. 3:09:18Amazon FSX for Windows File Server. If
  5217. 3:09:20EFS is Google Drive for Linux, FSX is a
  5218. 3:09:23heavily guarded corporate filing cabinet
  5219. 3:09:25built natively for Microsoft. It speaks
  5220. 3:09:27the exact server message block language
  5221. 3:09:28Windows uses and it integrates perfectly
  5222. 3:09:31with your Windows Active Directory. But
  5223. 3:09:33here's the trade-off. FSX for Windows is
  5224. 3:09:35not magically infinite like EFS. You
  5225. 3:09:38have to provision the storage capacity
  5226. 3:09:39and the throughput speed up front. You
  5227. 3:09:41have to actually engineer it. If you
  5228. 3:09:43guess wrong, your Windows applications
  5229. 3:09:45choke on the network. Now imagine this
  5230. 3:09:47in your system. You aren't running basic
  5231. 3:09:49web servers. You are running a massive
  5232. 3:09:51machine learning model or a high
  5233. 3:09:53performance computing job. Even standard
  5234. 3:09:56FSX or EFS is way too slow. For this,
  5235. 3:09:59you use Amazon FSX for Luster. It is a
  5236. 3:10:03specialized file system wired directly
  5237. 3:10:05to an Amazon S3 object storage bucket to
  5238. 3:10:08process millions of files at
  5239. 3:10:10blisteringly fast speeds. Your
  5240. 3:10:12supercomputer pulls massive data from
  5241. 3:10:14S3, processes it at lightning speed on
  5242. 3:10:16FSX for Lustre, and dumps the results
  5243. 3:10:18back to S3. To summarize it simply, oh,
  5244. 3:10:22now I get it. It's a temporary high
  5245. 3:10:24octane engine for massive data
  5246. 3:10:26processing. So when do you actually make
  5247. 3:10:28this choice? If you are running Linux
  5248. 3:10:30web servers and want infinite hands-off
  5249. 3:10:33scaling across multiple zones, choose
  5250. 3:10:35the FS. If you are running legacy
  5251. 3:10:37Windows applications and need strict
  5252. 3:10:39Active Directory permissions, choose FSX
  5253. 3:10:41for Windows. If you are doing heavy
  5254. 3:10:44machine learning, video rendering, or
  5255. 3:10:46high performance computing, choose FSX
  5256. 3:10:48for Lustra. If you are taking the AWS
  5257. 3:10:51solutions architect exam, domain 3
  5258. 3:10:53heavily tests your ability to determine
  5259. 3:10:55high performing and scalable storage
  5260. 3:10:57solutions. Do not miss this trap. They
  5261. 3:11:00will give you a scenario about a high
  5262. 3:11:02performance computing workload needing a
  5263. 3:11:03shared file system. They will put Amazon
  5264. 3:11:06EFS as an answer to trick you. Do not
  5265. 3:11:08pick EFS for high performance computing.
  5266. 3:11:10The key word for HPC or massive machine
  5267. 3:11:13learning is always FSX for Lester. Let's
  5268. 3:11:16do a fast punchy recap. File storage
  5269. 3:11:19allows thousands of servers to access
  5270. 3:11:21the same data at once. Amazon EFS is for
  5271. 3:11:24Linux. Amazon FSX is for Windows or
  5272. 3:11:26extreme high performance. Here are your
  5273. 3:11:28three rapidfire takeaways. One, Amazon
  5274. 3:11:31EFS automatically scales storage
  5275. 3:11:33capacity up and down without manual
  5276. 3:11:35intervention. Two, Amazon FSX for
  5277. 3:11:38Windows File Server provides native
  5278. 3:11:40Microsoft Active Directory integration.
  5279. 3:11:42Three, Amazon FSX for Luster is built
  5280. 3:11:44specifically to integrate with S3 for
  5281. 3:11:46massive computational workloads. And
  5282. 3:11:49here is your final warning. Never use an
  5283. 3:11:53expensive shared file system when simple
  5284. 3:11:56Amazon S3 object storage would work.
  5285. 3:11:59Match this specific storage type to the
  5286. 3:12:01actual workload or you will completely
  5287. 3:12:04destroy your cloud budget.
  5288. 3:12:06>> All right, let's just dive right into
  5289. 3:12:08this. Welcome to today's explainer. I
  5290. 3:12:11want you to imagine for a second that
  5291. 3:12:12your startup just hit a truly massive
  5292. 3:12:14milestone. We are talking your first
  5293. 3:12:17million users. The engineering team is
  5294. 3:12:19celebrating. Everyone's popping
  5295. 3:12:21champagne, but your CFO, well, they are
  5296. 3:12:24staring at the AWS bill in pure horror.
  5297. 3:12:27Because right there on the screen is a
  5298. 3:12:29bill for $50,000.
  5299. 3:12:31And that's just for one month. You're
  5300. 3:12:33spending 50 grand a month just to store
  5301. 3:12:36old user profile pictures and outdated
  5302. 3:12:38application logs in Amazon S3. The crazy
  5303. 3:12:41part, that data is just sitting there.
  5304. 3:12:43It's completely untouched by anyone. but
  5305. 3:12:46it is actively draining your bank
  5306. 3:12:48account every single month like a leaky
  5307. 3:12:50faucet. So, how do you stop the
  5308. 3:12:53bleeding? The answer to that relies
  5309. 3:12:55entirely on mastering Amazon S3's
  5310. 3:12:57storage classes and storage taring.
  5311. 3:13:00Let's start from square one. Amazon S3
  5312. 3:13:02is an incredibly scalable object storage
  5313. 3:13:04service. It is literally designed to
  5314. 3:13:06hold an infinite amount of files. But
  5315. 3:13:08here's the thing you absolutely need to
  5316. 3:13:10remember. Holding those files costs real
  5317. 3:13:13money. If you just dump every single
  5318. 3:13:15image, every video, and every random
  5319. 3:13:17backup into S3 and then walk away, well,
  5320. 3:13:19your architecture is definitely not cost
  5321. 3:13:22optimized. To fix this massive bill, you
  5322. 3:13:24basically have a two-step process. Step
  5323. 3:13:27one, you have to manage your data life
  5324. 3:13:29cycles. And step two, you need to move
  5325. 3:13:31older files into different tiers. Let's
  5326. 3:13:34break this concept down into its
  5327. 3:13:36absolute simplest form. Storage classes
  5328. 3:13:38are really just different rental units
  5329. 3:13:40for your data. You pay completely
  5330. 3:13:42different monthly prices based on
  5331. 3:13:44exactly how often you have to open the
  5332. 3:13:46door to look at the files inside. So,
  5333. 3:13:48let's get into section one, the three
  5334. 3:13:50storage tiers. First up is S3 standard.
  5335. 3:13:54This is the default tier everyone starts
  5336. 3:13:56with. Think of it like the top drawer of
  5337. 3:13:58your office desk. The files are right
  5338. 3:13:59there. You can open that drawer a
  5339. 3:14:01thousand times a day instantly, and it
  5340. 3:14:03costs you absolutely nothing extra to
  5341. 3:14:04grab them. But because it is so
  5342. 3:14:07incredibly fast and convenient, renting
  5343. 3:14:09that premium desk drawer is the most
  5344. 3:14:11expensive storage option available to
  5345. 3:14:13you. Now, let's slow down for a second
  5346. 3:14:15and compare that top drawer to our
  5347. 3:14:17second option, S3 standard infrequent
  5348. 3:14:19access or just IIA. This is like moving
  5349. 3:14:22your files to a filing cabinet down in
  5350. 3:14:24the dark basement of your office
  5351. 3:14:25building. It is significantly cheaper to
  5352. 3:14:28store your data down there on a monthly
  5353. 3:14:29basis. But there is a catch. Every
  5354. 3:14:32single time you walk down to that
  5355. 3:14:33basement to pull a file out, AWS charges
  5356. 3:14:36you a retrieval fee. Which brings us to
  5357. 3:14:38a major major pitfall. What we call the
  5358. 3:14:41viral video trap. Think about that for a
  5359. 3:14:44second. If you decide to put a viral
  5360. 3:14:47marketing video into infrequent access,
  5361. 3:14:50sure you save a little bit of money on
  5362. 3:14:51your baseline storage bill. But if a
  5363. 3:14:54million users suddenly decide to click
  5364. 3:14:56on that video, those individual per file
  5365. 3:14:59retrieval fees will instantly bankrupt
  5366. 3:15:01your startup. And this is usually when
  5367. 3:15:04people have a massive light bulb moment.
  5368. 3:15:07They go, "Oh,
  5369. 3:15:09now I get it. The cheaper the storage
  5370. 3:15:11tier, the more expensive it is to
  5371. 3:15:14actually touch the data. That inverse
  5372. 3:15:16relationship right there, that is
  5373. 3:15:18absolutely key to understanding AWS
  5374. 3:15:20storage pricing. And that brings us to
  5375. 3:15:23the third option. Let's compare
  5376. 3:15:25infrequent access with cold tiering
  5377. 3:15:27using Amazon S3 Glacier. Glacier is
  5378. 3:15:30essentially an off-site deep storage
  5379. 3:15:31vault located completely across town. It
  5380. 3:15:34is insanely cheap. We're talking literal
  5381. 3:15:36pennies on the dollar here. But the
  5382. 3:15:38agonizing trade-off with Glacier is
  5383. 3:15:40speed. If you request a file from
  5384. 3:15:42Glacier, you can't get it right away.
  5385. 3:15:43You might have to wait minutes or even
  5386. 3:15:45hours for AWS to physically go get it
  5387. 3:15:47for you. Moving on to section two, the
  5388. 3:15:50life cycle management trap. Now, listen
  5389. 3:15:52closely because this is where people
  5390. 3:15:54completely mess up. In the real world,
  5391. 3:15:56people completely fail by trying to
  5392. 3:15:59manage all these storage tiers manually.
  5393. 3:16:01They ask their developers to guess which
  5394. 3:16:03files are going to be hot or cold. Or
  5395. 3:16:05they set these blind 30-day rules that
  5396. 3:16:08accidentally lock their own customers
  5397. 3:16:09out of old invoices. So, this begs the
  5398. 3:16:13ultimate question. What happens when
  5399. 3:16:15your access patterns are totally
  5400. 3:16:16unpredictable? The answer is S3
  5401. 3:16:20intelligent tiering. Intelligent taring
  5402. 3:16:22is the absolute magic bullet of Amazon
  5403. 3:16:24S3. It is an automated storage class
  5404. 3:16:27that constantly monitors your files for
  5405. 3:16:29you. Here's how it works. If a file
  5406. 3:16:31hasn't been opened in 30 days, the
  5407. 3:16:33system automatically moves it to the
  5408. 3:16:35cheaper infrequent access tier. If 90
  5409. 3:16:37days go by, it drops it straight into
  5410. 3:16:40cold storage. But the exact second a
  5411. 3:16:42user clicks that file, boom, it
  5412. 3:16:45instantly moves it back to the fast
  5413. 3:16:46standard tier. Now, I really want you to
  5414. 3:16:49imagine this running in your system.
  5415. 3:16:51Zero lines of code. You literally do not
  5416. 3:16:53have to write a single line of code to
  5417. 3:16:55optimize your storage here. You just
  5418. 3:16:56turn on intelligent taring. You pay a
  5419. 3:16:58microscopic monitoring fee per object
  5420. 3:17:01and AWS automatically shrinks your
  5421. 3:17:03storage bill every single month based
  5422. 3:17:05entirely on actual human behavior.
  5423. 3:17:08It's another one of those great
  5424. 3:17:10realizations, right? Oh, now I get it.
  5425. 3:17:14You are paying AWS a tiny fee to act as
  5426. 3:17:18your automated financial adviser. It's
  5427. 3:17:20just brilliant. So, with all these
  5428. 3:17:22options on the table, a totally logical
  5429. 3:17:25question arises. When do you actually
  5430. 3:17:28make this choice? Let's look at some
  5431. 3:17:29practical real world applications. Here
  5432. 3:17:32is your real world breakdown. You are
  5433. 3:17:34going to choose S3 standard for active
  5434. 3:17:36hot data, things like website images
  5435. 3:17:38that load every time a user visits. You
  5436. 3:17:40choose infrequent access for things like
  5437. 3:17:42your monthly system backups. You choose
  5438. 3:17:44S3 Glacier for long-term compliance
  5439. 3:17:46records, the stuff you legally must keep
  5440. 3:17:48for years, but will probably never ever
  5441. 3:17:50read. And finally, you choose
  5442. 3:17:52intelligent taring when you have massive
  5443. 3:17:54amounts of data and absolutely no idea
  5444. 3:17:56what your users will do with it. All
  5445. 3:17:57right, section three, AWS exam traps. If
  5446. 3:18:02you are currently studying for the AWS
  5447. 3:18:04solutions architect exam, pay attention.
  5448. 3:18:07AWS is going to heavily test your
  5449. 3:18:08knowledge of these specific cost
  5450. 3:18:10trade-offs. Do not miss this first trap.
  5451. 3:18:13They will give you a scenario asking for
  5452. 3:18:15the most cost-effective storage for data
  5453. 3:18:17with unknown or changing access
  5454. 3:18:19patterns. When you see those exact
  5455. 3:18:21words, the answer is always S3
  5456. 3:18:24intelligent hearing every time. Trap
  5457. 3:18:26number two involves the phrase
  5458. 3:18:28regulatory compliance. If the exam
  5459. 3:18:31question demands that data must be kept
  5460. 3:18:33for 5 years for regulatory compliance
  5461. 3:18:36and it will rarely be accessed, you need
  5462. 3:18:38to look immediately for cold tiering or
  5463. 3:18:41Amazon S3 Glacier. Okay, let's do a fast
  5464. 3:18:44punchy recap to really lock these
  5465. 3:18:46concepts into your memory. S3 standard,
  5466. 3:18:49that is your desk drawer. Infrequent
  5467. 3:18:51access, that's your basement filing
  5468. 3:18:53cabinet. S3 Glacier, that is your secure
  5469. 3:18:55off-site vault. And intelligent taring,
  5470. 3:18:58that's the automator that seamlessly
  5471. 3:19:00moves the data between all of them just
  5472. 3:19:02to save you money. So, here are your
  5473. 3:19:04three rapidfire takeaways from today's
  5474. 3:19:06explainer. One, you absolutely must
  5475. 3:19:09manage S3 object life cycles if you want
  5476. 3:19:12to build a truly cost optimized cloud
  5477. 3:19:14architecture. Two, cold storage offers
  5478. 3:19:17the lowest monthly cost by far, but it
  5479. 3:19:19heavily penalizes you with high
  5480. 3:19:20retrieval times and fees. And three, S3
  5481. 3:19:23intelligent tiering is the ultimate
  5482. 3:19:25hands-off solution for totally
  5483. 3:19:27unpredictable workloads. And I want to
  5484. 3:19:30leave you with one final slightly
  5485. 3:19:32provocative thought, the final trap. Do
  5486. 3:19:35not put tiny files into infrequent
  5487. 3:19:38access or intelligent tiering. AWS
  5488. 3:19:41actually charges a minimum storage
  5489. 3:19:42capacity for those specific tiers. This
  5490. 3:19:45means if you go and upload millions of
  5491. 3:19:47tiny 1 kilob text files, the capacity
  5492. 3:19:50overhead fees will completely wipe out
  5493. 3:19:52any savings you thought you had. You
  5494. 3:19:54must always match your storage strategy
  5495. 3:19:56to the actual file size. So, I want you
  5496. 3:19:59to go look at your S3 buckets today. Are
  5497. 3:20:01you paying premium prices for a desk
  5498. 3:20:03drawer when a cheap basement cabinet
  5499. 3:20:04would do the exact same job?
  5500. 3:20:06>> Imagine you just launched a global
  5501. 3:20:08streaming platform. Your servers are
  5502. 3:20:10sitting in Virginia. A user in Tokyo
  5503. 3:20:13clicks play on a mass of highdefinition
  5504. 3:20:15video. It spins. It buffers. It freezes.
  5505. 3:20:18They get frustrated and immediately
  5506. 3:20:19cancel their subscription. You didn't
  5507. 3:20:21fail at coding, you failed at physics.
  5508. 3:20:24Let's start from zero here. The internet
  5509. 3:20:26is a physical thing, right? It is a
  5510. 3:20:28massive web of underwater cables and
  5511. 3:20:30routers. If data has to literally cross
  5512. 3:20:32an ocean and bounce through 50 different
  5513. 3:20:34public routers to reach a user, it takes
  5514. 3:20:36time. It is slow, laggy, and totally
  5515. 3:20:39unpredictable. To beat internet physics,
  5516. 3:20:41we use a content delivery network or
  5517. 3:20:44CDN. In AWS, the absolute gold standard
  5518. 3:20:47for this is Amazon CloudFront. Look, if
  5519. 3:20:49you don't use a CDN, every single user
  5520. 3:20:52around the entire globe has to reach
  5521. 3:20:54across the world to fetch data directly
  5522. 3:20:56from your one primary server. The
  5523. 3:20:58latency is horrible and worse, your
  5524. 3:21:00primary server gets crushed under the
  5525. 3:21:02massive global weight. Let's break down
  5526. 3:21:04exactly how CloudFront solves this.
  5527. 3:21:06CloudFront uses a global network of edge
  5528. 3:21:09locations. These are hundreds of mini
  5529. 3:21:11data centers spread all over the world
  5530. 3:21:13sitting right in your users's backyards.
  5531. 3:21:15When that user in Tokyo requests a
  5532. 3:21:17video, CloudFront intercepts the
  5533. 3:21:18request. It says, "Don't go to Virginia.
  5534. 3:21:21I'll go get it for you." CloudFront
  5535. 3:21:23grabs a video from Virginia exactly
  5536. 3:21:24once, pulls it over a high-speed private
  5537. 3:21:26network, and caches a copy of it right
  5538. 3:21:28there in Tokyo. Think about it like a
  5539. 3:21:31massive library system. If a million
  5540. 3:21:33people want to read a specific book, the
  5541. 3:21:35librarian doesn't force everyone to
  5542. 3:21:37travel to the main headquarters to read
  5543. 3:21:38one single copy. They print a million
  5544. 3:21:40copies and put one in every local
  5545. 3:21:42neighborhood library. Think about that
  5546. 3:21:43for a second. See, your Virginia server
  5547. 3:21:46only had to send the file out exactly
  5548. 3:21:48one time. CloudFront handles the other
  5549. 3:21:50million requests locally from the edge.
  5550. 3:21:54Oh, now I get it. CloudFront doesn't
  5551. 3:21:57just make the video load instantly for
  5552. 3:21:58the user. It completely shields your
  5553. 3:22:00main origin server from crashing. But
  5554. 3:22:02listen up, because now here's where
  5555. 3:22:04people completely fail this in the real
  5556. 3:22:06world. Caching is incredibly dangerous
  5557. 3:22:09if you do not control it. Picture this.
  5558. 3:22:12You push a massive critical update to
  5559. 3:22:14your website's homepage, but your users
  5560. 3:22:17are complaining on Twitter that they are
  5561. 3:22:19still seeing the old version from
  5562. 3:22:21yesterday. Why? Well, because the old
  5563. 3:22:24version is still sitting in those edge
  5564. 3:22:26caches around the world. To fix this,
  5565. 3:22:29you have to carefully engineer your time
  5566. 3:22:31to live or TTL. This tells CloudFront
  5567. 3:22:34exactly how many seconds it should hold
  5568. 3:22:36onto a file before deleting it and
  5569. 3:22:38checking Virginia for a newer version.
  5570. 3:22:40If you mess up your TTL, you are
  5571. 3:22:42permanently showing your users broken,
  5572. 3:22:44outdated data. If it's an absolute
  5573. 3:22:46emergency, you have to run a cache
  5574. 3:22:49invalidation. This manually forces
  5575. 3:22:51CloudFront to wipe the edge locations
  5576. 3:22:53clean instantly. But a quick warning,
  5577. 3:22:56AWS charges you real money for running
  5578. 3:22:58too many invalidations. It hurts the
  5579. 3:23:00wallet, so you do not want to rely on
  5580. 3:23:02it. Now, imagine this in your system.
  5581. 3:23:05You don't understand caching, so you
  5582. 3:23:07accidentally put a dynamic shopping cart
  5583. 3:23:09page in a CloudFront cache. User A logs
  5584. 3:23:12in, the page caches, and then user B
  5585. 3:23:15logs in and sees user A's credit card
  5586. 3:23:17information. Yikes. Oh. Oh, now I get
  5587. 3:23:20it. You never c highly dynamic personal
  5588. 3:23:23data. You only cache static assets like
  5589. 3:23:25images, videos, and generic HTML pages.
  5590. 3:23:29So, when do you actually use this? Well,
  5591. 3:23:31if you have a purely internal corporate
  5592. 3:23:34app used only by employees sitting in
  5593. 3:23:36one single building in Ohio, do not use
  5594. 3:23:38CloudFront. You are wasting money. But
  5595. 3:23:41if you have a public-f facing website, a
  5596. 3:23:43streaming platform, or a massive global
  5597. 3:23:44user base, CloudFront is absolutely
  5598. 3:23:47mandatory. For anyone out there studying
  5599. 3:23:49for the AWS solutions architect exam,
  5600. 3:23:51pay attention. Domain 3 and four heavily
  5601. 3:23:53test your strategic need for edge
  5602. 3:23:55networking and CDNs. AWS will try to
  5603. 3:23:58trick you. They will give you a scenario
  5604. 3:24:00and ask you to choose between Amazon
  5605. 3:24:01CloudFront and AWS Global Accelerator.
  5606. 3:24:04Both of these use AWS edge locations to
  5607. 3:24:06make things faster. Do not mix them up.
  5608. 3:24:09If the question mentions caching static
  5609. 3:24:10content, images, videos, or lowering the
  5610. 3:24:13load on your web servers, the answer is
  5611. 3:24:15always Amazon CloudFront. However, if
  5612. 3:24:17the question asks for high performance
  5613. 3:24:18routing for non-HTTP traffic like a
  5614. 3:24:20multiplayer gaming UDP protocol or
  5615. 3:24:23explicitly states you need a fixed
  5616. 3:24:24static IP address, the answer is global
  5617. 3:24:26accelerator. All right, let's do a fast
  5618. 3:24:29punchy recap. Internet physics make
  5619. 3:24:31long-distance data slow. Cloudfront is a
  5620. 3:24:34CDN that caches your data locally at
  5621. 3:24:36edge locations. It provides massive
  5622. 3:24:39speed for users and massive protection
  5623. 3:24:41for your servers. Here are your three
  5624. 3:24:43rapidfire takeaways. One, CloudFront
  5625. 3:24:46dramatically reduces compute and data
  5626. 3:24:48transfer costs on your back-end
  5627. 3:24:49infrastructure. Two, time to live
  5628. 3:24:52settings dictate exactly how long data
  5629. 3:24:54stays at the edge before refreshing.
  5630. 3:24:57Three, use cache invalidations only when
  5631. 3:24:59you absolutely must clear out bad data
  5632. 3:25:01instantly. And here is your final trap.
  5633. 3:25:04Watch out for geographic restrictions.
  5634. 3:25:07CloudFront can actually block users from
  5635. 3:25:08specific countries from seeing your
  5636. 3:25:10content entirely. If an exam question
  5637. 3:25:12asks how to quickly block traffic from a
  5638. 3:25:14specific country to meet digital
  5639. 3:25:15compliance laws, CloudFront
  5640. 3:25:17georestriction is the absolute easiest
  5641. 3:25:19way to do it. So look at your
  5642. 3:25:20architecture. What are you cashing right
  5643. 3:25:22now that you shouldn't be? Picture this.
  5644. 3:25:24Your company just got featured on a
  5645. 3:25:26massive morning talk show. It's the big
  5646. 3:25:28break you've been waiting for, right?
  5647. 3:25:30But then a million people decide to
  5648. 3:25:32click the link on their phones at the
  5649. 3:25:33exact same second. So let's look at
  5650. 3:25:36section one, the cost of going viral.
  5651. 3:25:39Sure, your front-end web servers might
  5652. 3:25:41handle that initial connection
  5653. 3:25:42perfectly, but then boom, your back-end
  5654. 3:25:45database instantly spikes to 100% CPU.
  5655. 3:25:48It literally melts down under the
  5656. 3:25:50pressure. Your site goes completely
  5657. 3:25:51offline, and just like that, you've lost
  5658. 3:25:53millions of dollars in potential sales.
  5659. 3:25:55It is a total nightmare scenario. Why
  5660. 3:25:58did this happen? Well, it's because you
  5661. 3:26:00forced your system to do the exact same
  5662. 3:26:02hard work a million times in a row
  5663. 3:26:03instead of working smart. To survive a
  5664. 3:26:06massive traffic hit like that, you
  5665. 3:26:07absolutely must master caching. In this
  5666. 3:26:10explainer, we're going to quickly cover
  5667. 3:26:12the cost of going viral, how caching
  5668. 3:26:14acts as a performance cheat code, the
  5669. 3:26:16roles of CloudFront and Elasticash, a
  5670. 3:26:18massive architectural trap you need to
  5671. 3:26:20avoid, and finally, a rapidfire exam
  5672. 3:26:23recap. Caching really is the ultimate
  5673. 3:26:25performance cheat code, especially if
  5674. 3:26:27you are tackling domain 3 of the AWS
  5675. 3:26:30solutions architect exam. All right,
  5676. 3:26:33moving to section two, caching. the
  5677. 3:26:35performance cheat code. Let's build this
  5678. 3:26:37from the ground up, starting from
  5679. 3:26:39absolute zero. At its core, caching is
  5680. 3:26:42simply short-term memory. Think about
  5681. 3:26:44it. If I ask you what 2 plus 2 is, you
  5682. 3:26:46don't break out a calculator, right? You
  5683. 3:26:48already know the answer. You saved it in
  5684. 3:26:50your brain. You don't need to do the
  5685. 3:26:51math again. In cloud architecture, it's
  5686. 3:26:53the exact same concept. If a million
  5687. 3:26:56users ask for the exact same homepage or
  5688. 3:26:58the exact same database record, your
  5689. 3:27:00system absolutely shouldn't be
  5690. 3:27:02recalculating it a million times. That
  5691. 3:27:03is a massive waste of computing power.
  5692. 3:27:05It should just hand them the saved
  5693. 3:27:07answer instantly. So, let's dive into
  5694. 3:27:09the two heavy hitters in AWS caching
  5695. 3:27:11that make this possible. Section three,
  5696. 3:27:14CloudFront, our global shield. First up
  5697. 3:27:17is Amazon CloudFront. This is a content
  5698. 3:27:20delivery network or CDN. Basically, it's
  5699. 3:27:23an edge networking service. It takes
  5700. 3:27:25your static files, we're talking your
  5701. 3:27:27images, your videos, HTML pages, and it
  5702. 3:27:30places copies of them in hundreds of
  5703. 3:27:32edge locations all around the entire
  5704. 3:27:34world. Think about it like a global
  5705. 3:27:36newspaper. A publisher doesn't force
  5706. 3:27:38everyone in the world to travel all the
  5707. 3:27:39way to New York just to read the morning
  5708. 3:27:41paper, right? No way. They print
  5709. 3:27:43millions of copies and put them on local
  5710. 3:27:45street corners worldwide. Now, what
  5711. 3:27:47happens if you don't use this? Well, a
  5712. 3:27:49user in Tokyo has to pull a massive
  5713. 3:27:51video file all the way from your single
  5714. 3:27:52server in Virginia. The global network
  5715. 3:27:54latency is just horrible, and your
  5716. 3:27:56Virginia server gets completely crushed
  5717. 3:27:58under the weight of the entire world's
  5718. 3:27:59traffic. Think about that for a second.
  5719. 3:28:02It's a disaster. But with CloudFront,
  5720. 3:28:04CloudFront catches that request right
  5721. 3:28:06there in Tokyo. It hands the user the
  5722. 3:28:08video instantly, and your main server in
  5723. 3:28:09Virginia never even knew the user
  5724. 3:28:11existed. Oh, right now it clicks.
  5725. 3:28:14CloudFront is literally a shield that
  5726. 3:28:15protects your servers while making
  5727. 3:28:17things lightning fast for your global
  5728. 3:28:18users. Okay, section four, Elasticash,
  5729. 3:28:22the database lifesaver. But hey, what if
  5730. 3:28:24the problem isn't static files? What if
  5731. 3:28:26the issue is heavy, complex database
  5732. 3:28:29queries? Well, that brings us to Amazon
  5733. 3:28:31Elastic. Elasticash is a high-erforming
  5734. 3:28:34in-memory database cache that sits
  5735. 3:28:36directly in front of your primary
  5736. 3:28:38database. Think about it like a sticky
  5737. 3:28:40note on your computer monitor. Your main
  5738. 3:28:42database is like a massive heavy filing
  5739. 3:28:44cabinet down in the basement. It holds
  5740. 3:28:46absolutely everything, but man, it is
  5741. 3:28:48slow to search through. Elasticash is
  5742. 3:28:50that sticky note right in front of your
  5743. 3:28:51face. You just write the most popular
  5744. 3:28:53readint intensive data right on that
  5745. 3:28:55note. What happens if you don't use it?
  5746. 3:28:57Every single time a user logs in, your
  5747. 3:28:59primary database has to grind its gears
  5748. 3:29:01and search through millions of rows. It
  5749. 3:29:03becomes a massive bottleneck. Now,
  5750. 3:29:05imagine this in your system. Instead of
  5751. 3:29:07asking the database for say the top 10
  5752. 3:29:09leaderboard scores 10,000 times a
  5753. 3:29:11second, your app just asks Elasticash.
  5754. 3:29:13Elasticash serves that data straight out
  5755. 3:29:15of pure RAM in a fraction of a
  5756. 3:29:16millisecond. Ah, see Elasticash absorbs
  5757. 3:29:19all that heavy read traffic so your
  5758. 3:29:21actual main database can finally
  5759. 3:29:23breathe. Which brings us to section five
  5760. 3:29:26and this is absolutely crucial. The
  5761. 3:29:28architectural trap. Listen closely
  5762. 3:29:31because here is exactly where people
  5763. 3:29:32mess up. People constantly mix up where
  5764. 3:29:35these two services actually live in the
  5765. 3:29:37architecture and let me tell you this is
  5766. 3:29:39a massive engineering trap. CloudFront
  5767. 3:29:42lives at the absolute edge of the
  5768. 3:29:43network right next to the user.
  5769. 3:29:45Elasticash on the other hand lives deep
  5770. 3:29:48inside your private network right next
  5771. 3:29:50to your database. If you try to use
  5772. 3:29:52Elasticash to speed up image loading for
  5773. 3:29:54a user in Australia, it will fail
  5774. 3:29:56miserably because that user still has to
  5775. 3:29:58cross the entire ocean just to reach
  5776. 3:29:59your data center. The geography just
  5777. 3:30:02doesn't work. And on the flip side, if
  5778. 3:30:04you try to use CloudFront to cache
  5779. 3:30:06complex personalized database queries,
  5780. 3:30:08you're going to accidentally cache
  5781. 3:30:09personal data at the edge and end up
  5782. 3:30:11showing user A's private banking details
  5783. 3:30:13to user B. Absolutely disastrous. So,
  5784. 3:30:16how do you actually choose the right
  5785. 3:30:18exam answer? It's simple once you know
  5786. 3:30:20the trick. You choose CloudFront for
  5787. 3:30:22global static assets and edge caching.
  5788. 3:30:25You choose Elasticash for read intensive
  5789. 3:30:28higherformance database workloads. If
  5790. 3:30:30you are taking the AWS solutions
  5791. 3:30:32architect exam, domain 3 heavily tests
  5792. 3:30:35your ability to design these
  5793. 3:30:36high-erforming database and network
  5794. 3:30:38architectures. Do not miss this trap.
  5795. 3:30:41AWS loves to give you a scenario where a
  5796. 3:30:44relational database is overwhelmed by
  5797. 3:30:46heavy retra and they will totally put
  5798. 3:30:48Amazon CloudFront as a multiple choice
  5799. 3:30:50option just to trick you. Listen, never
  5800. 3:30:53pick CloudFront to fix a database
  5801. 3:30:55bottleneck. The answer for a readint
  5802. 3:30:57intensive database bottleneck is always
  5803. 3:30:59Amazon Elasticash or maybe a read
  5804. 3:31:01replica. But if the question explicitly
  5805. 3:31:04states that global users are
  5806. 3:31:06experiencing high latency when
  5807. 3:31:07downloading images or media, the answer
  5808. 3:31:09is always an edge networking service
  5809. 3:31:11like Amazon CloudFront. All right,
  5810. 3:31:13section six, Rapidfire exam recap. Let's
  5811. 3:31:16do a fast punchy summary of what we've
  5812. 3:31:18covered. Caching prevents your
  5813. 3:31:20architecture from doing the same work
  5814. 3:31:22twice. CloudFront caches files globally
  5815. 3:31:24at the edge while Elastic caches
  5816. 3:31:26database queries internally right in
  5817. 3:31:28memory. Here are your three rapidfire
  5818. 3:31:31takeaways. One, use edge accelerators
  5819. 3:31:34like CDNs for static web content. Two,
  5820. 3:31:37integrate caching services like
  5821. 3:31:39Elasticash to offload read intensive
  5822. 3:31:41database access patterns. And three,
  5823. 3:31:44true high-erforming architectures
  5824. 3:31:46completely decouple the heavy lifting by
  5825. 3:31:48using both of these services together.
  5826. 3:31:51And before we wrap up this explainer,
  5827. 3:31:52here's your final trap. Never cache data
  5828. 3:31:56forever. If your database updates, but
  5829. 3:31:58your cache doesn't, your users are going
  5830. 3:32:00to see old, stale data. Always, always
  5831. 3:32:03configure expiration logic to force your
  5832. 3:32:06cache to wipe itself clean and fetch the
  5833. 3:32:08fresh truth. Keep that rule in mind and
  5834. 3:32:10you'll be golden. Imagine your new
  5835. 3:32:13mobile app just went viral. A million
  5836. 3:32:15new users try to create accounts at the
  5837. 3:32:18exact same second. Your web servers
  5838. 3:32:21scale up perfectly, but your database
  5839. 3:32:23locks up completely. It is a
  5840. 3:32:25catastrophic bottleneck. The app
  5841. 3:32:27crashes, users leave angry one-star
  5842. 3:32:28reviews, and your big break is ruined.
  5843. 3:32:31Why did this happen? Because you chose
  5844. 3:32:33the absolute wrong database engine for
  5845. 3:32:35your workload. Let's start from zero.
  5846. 3:32:37Your database is the permanent memory of
  5847. 3:32:39your application. If it's too slow, your
  5848. 3:32:41entire architecture is slow. Designing
  5849. 3:32:43high performing and scalable
  5850. 3:32:44architectures requires you to choose the
  5851. 3:32:46exact right type of database based on
  5852. 3:32:47your data access patterns. If you get
  5853. 3:32:49this wrong, your system breaks under
  5854. 3:32:51pressure. Let me show you how to
  5855. 3:32:53simplify this. When selecting a database
  5856. 3:32:56type, you really have two main paths,
  5857. 3:32:58relational and non-reational. A
  5858. 3:33:01relational database is a massive,
  5859. 3:33:03strictly organized spreadsheet.
  5860. 3:33:05Everything must match. A non- relational
  5861. 3:33:08database is a giant, flexible pile of
  5862. 3:33:10sticky notes. Let's look at your three
  5863. 3:33:12biggest choices in AWS. First, Amazon
  5864. 3:33:16RDS, the relational database service.
  5865. 3:33:19Think about RDS like a highly strict old
  5866. 3:33:22school accountant. Every single piece of
  5867. 3:33:24data must fit perfectly into rows and
  5868. 3:33:26columns. It handles complex
  5869. 3:33:28relationships like linking a user to an
  5870. 3:33:30order and an order to a shipping
  5871. 3:33:32address. What happens if you don't use
  5872. 3:33:34it for complex data? You end up with
  5873. 3:33:35corrupted financial records and a broken
  5874. 3:33:37billing system. But here is the
  5875. 3:33:39trade-off. That strict accountant gets
  5876. 3:33:41easily overwhelmed if a million people
  5877. 3:33:43yell at them at the exact same time.
  5878. 3:33:45Traditional relational databases
  5879. 3:33:47struggle to scale infinitely. That
  5880. 3:33:49brings us to your second option, Amazon
  5881. 3:33:52Dynamo DB. DynamoB is AWS's flagship
  5882. 3:33:56non-reational NoSQL database. It is
  5883. 3:33:59completely serverless. Think about
  5884. 3:34:01Dynamob like a massive warehouse with a
  5885. 3:34:04million robotic workers. You give a
  5886. 3:34:06worker a unique ID key and they
  5887. 3:34:09instantly run and grab that exact item.
  5888. 3:34:11There are no complex ledgers, just a key
  5889. 3:34:14and a value. Think about that for a
  5890. 3:34:16second. When millions of players log
  5891. 3:34:18into a mobile game, they don't need to
  5892. 3:34:20run a complex financial report. They
  5893. 3:34:23just need to load their saved game
  5894. 3:34:24state. Dynamob hands it to them in
  5895. 3:34:27singledigit milliseconds, no matter how
  5896. 3:34:29many millions of people are asking at
  5897. 3:34:31once. Oh, now I get it. DynamoB
  5898. 3:34:34sacrifices complex relationships to give
  5899. 3:34:36you infinite unstoppable speed. Now,
  5900. 3:34:39here's where people completely fail this
  5901. 3:34:41in the real world. What if you
  5902. 3:34:44absolutely must have a strict relational
  5903. 3:34:46database, but you also need massive
  5904. 3:34:48cloudnative scale? You cannot
  5905. 3:34:51compromise. That is where you use Amazon
  5906. 3:34:53Aurora. Aurora is AWS's customuilt
  5907. 3:34:57enterprisegrade relational database. It
  5908. 3:34:59looks and acts exactly like standard
  5909. 3:35:02RDS, but the underlying hardware is
  5910. 3:35:04radically different. In a standard
  5911. 3:35:06database, the compute brain and the
  5912. 3:35:08storage hard drive are glued together.
  5913. 3:35:10If the brain dies, the drive is locked.
  5914. 3:35:13Aurora completely decouples them. It
  5915. 3:35:15automatically replicates your storage
  5916. 3:35:16across three different availability
  5917. 3:35:18zones while the compute brain sits
  5918. 3:35:20completely separate. Now, imagine this
  5919. 3:35:22in your system. Your primary database
  5920. 3:35:24server literally catches fire and dies.
  5921. 3:35:27Aurora doesn't panic. It [snorts]
  5922. 3:35:29instantly spins up a new compute brain,
  5923. 3:35:31attaches it to the surviving storage
  5924. 3:35:33network, and your application is back
  5925. 3:35:35online in seconds. Oh, now I get it.
  5926. 3:35:38Aurora gives you the strict rules of a
  5927. 3:35:39traditional database, but with the
  5928. 3:35:41survival skills of the cloud. So, when
  5929. 3:35:43do you actually make this choice? You
  5930. 3:35:46choose Amazon RDS when migrating legacy
  5931. 3:35:48applications that need a standard
  5932. 3:35:49homogeneous SQL database engine. You
  5933. 3:35:52choose Amazon DynamoB when you need a
  5934. 3:35:54serverless non-reational database to
  5935. 3:35:56handle unpredictable viral web traffic.
  5936. 3:35:59You choose Amazon Aurora when you need
  5937. 3:36:00an enterprisegrade relational database
  5938. 3:36:02with extreme fault tolerance. If you are
  5939. 3:36:05taking the AWS solutions architect exam,
  5940. 3:36:07domain 3 heavily tests your ability to
  5941. 3:36:10determine high performing database
  5942. 3:36:11solutions. Do not miss this trap. They
  5943. 3:36:14will try to trick you by offering
  5944. 3:36:15DynamoB for an application that requires
  5945. 3:36:17complex multi-table financial queries.
  5946. 3:36:20Never use DynamoB for complex relational
  5947. 3:36:22queries. Conversely, if the question
  5948. 3:36:24asks for the most cost-effective
  5949. 3:36:25database for a mobile app with massive
  5950. 3:36:27unpredictable reads and writes, do not
  5951. 3:36:29choose a static Amazon RDS instance. The
  5952. 3:36:32answer for unpredictable massive scale
  5953. 3:36:34is always Dynamo DB or a serverless
  5954. 3:36:36database option. Let's do a fast punchy
  5955. 3:36:38recap. RDS is your strict traditional
  5956. 3:36:41accountant. Dynamob is your infinitely
  5957. 3:36:43scaling robotic warehouse. Aurora is
  5958. 3:36:46your cloudnative cyborg relational
  5959. 3:36:48database. Here are your three rapidfire
  5960. 3:36:50takeaways. One, database selection is
  5961. 3:36:53entirely driven by whether your access
  5962. 3:36:55patterns are relational or non-
  5963. 3:36:56relational. Two, Dynamo DB provides
  5964. 3:36:59singledigit millisecond latency at any
  5965. 3:37:01scale. Three, Aurora decouples compute
  5966. 3:37:04and storage to survive massive hardware
  5967. 3:37:06failures. And here is your final trap.
  5968. 3:37:10Do not overengineer.
  5969. 3:37:12Aurora is incredible, but it is an
  5970. 3:37:14enterprise tool. If you are just
  5971. 3:37:16building a simple internal application
  5972. 3:37:18for 10 employees, a basic Amazon RDS
  5973. 3:37:20instance is all you need to keep your
  5974. 3:37:22architecture cost optimized. So before
  5975. 3:37:25you build your next big application, ask
  5976. 3:37:27yourself, does your data need a strict
  5977. 3:37:29accountant, a massive robotic warehouse,
  5978. 3:37:32or the survival skills of a cyborg?
  5979. 3:37:34Imagine it's Black Friday. Your
  5980. 3:37:36marketing team just dropped the absolute
  5981. 3:37:38biggest campaign of the entire year.
  5982. 3:37:40Traffic spikes by 10,000%. Your web
  5983. 3:37:43servers scale up beautifully, doing
  5984. 3:37:45exactly what they're supposed to do. But
  5985. 3:37:47suddenly, everything just freezes.
  5986. 3:37:49Customers can't check out. You're seeing
  5987. 3:37:51errors absolutely everywhere. So, why
  5988. 3:37:53did this happen? Well, your single
  5989. 3:37:54database just choked to death. Millions
  5990. 3:37:57of dollars literally gone in minutes.
  5991. 3:37:59Now, this is the exact nightmare that
  5992. 3:38:01every cloud architect is hired to
  5993. 3:38:03prevent. And if you're studying for the
  5994. 3:38:05AWS solutions architect associate exam,
  5995. 3:38:07mastering how to fix this is absolutely
  5996. 3:38:10non-negotiable. In this explainer, we'll
  5997. 3:38:12be showing you exactly how we solve this
  5998. 3:38:14in the real world. When we talk about
  5999. 3:38:16database architecture, we're really
  6000. 3:38:18solving two completely different
  6001. 3:38:20problems. Problem one, the database is
  6002. 3:38:23just way too busy. And problem two, the
  6003. 3:38:26database literally catches fire and
  6004. 3:38:28dies. To fix these, AWS gives us two
  6005. 3:38:31completely different tools. Read
  6006. 3:38:33replicas and multi-AZ deployments. Let's
  6007. 3:38:37break these two solutions down to their
  6008. 3:38:38absolute simplest forms. First up, read
  6009. 3:38:42replicas. A read replica is exactly what
  6010. 3:38:45it sounds like. It's a copy of your main
  6011. 3:38:47database that is strictly used for
  6012. 3:38:49reading data. So why does this even
  6013. 3:38:51exist? Well, because in almost every
  6014. 3:38:54modern application, data access patterns
  6015. 3:38:56are incredibly read inensive. Users are
  6016. 3:38:59constantly browsing products, looking at
  6017. 3:39:01profiles, refreshing their feeds.
  6018. 3:39:03Writing data, like actually placing an
  6019. 3:39:06order, happens way less often. Think
  6020. 3:39:08about it like a busy restaurant kitchen.
  6021. 3:39:10You have one head chef, right? That's
  6022. 3:39:12your primary database. They're cooking
  6023. 3:39:14the meals, doing all the heavy lifting,
  6024. 3:39:16making the actual changes. If every
  6025. 3:39:18single waiter keeps asking the head chef
  6026. 3:39:21for a menu update, the chef has to stop
  6027. 3:39:23cooking. The kitchen basically crashes.
  6028. 3:39:26So, what do you do? You hire sue chefs.
  6029. 3:39:28The sue chefs just hand out the menus.
  6030. 3:39:30The waiters ask the sue chefs, and the
  6031. 3:39:33head chef is left totally alone to
  6032. 3:39:34actually cook. Those sous chefs are your
  6033. 3:39:37read replicas. You point all your
  6034. 3:39:39reporting tools, analytics, and read
  6035. 3:39:41heavy traffic over to the replicas. This
  6036. 3:39:44offloads all that pressure, keeping your
  6037. 3:39:46primary database incredibly fast. But
  6038. 3:39:49here's the crucial trade-off. Read
  6039. 3:39:51replicas use asynchronous replication.
  6040. 3:39:54That means there's a tiny delay, usually
  6041. 3:39:56just milliseconds, before the replica
  6042. 3:39:58gets the absolute newest data from the
  6043. 3:40:00primary. Now, imagine this in your
  6044. 3:40:02actual system. If a user updates their
  6045. 3:40:05profile picture and immediately
  6046. 3:40:06refreshes the page, they might actually
  6047. 3:40:08see their old picture for a split second
  6048. 3:40:10if their read request hits a replica
  6049. 3:40:12that just hasn't caught up yet. But
  6050. 3:40:14here's exactly where people fail this.
  6051. 3:40:17They think read replicas are a disaster
  6052. 3:40:19recovery strategy. They are absolutely
  6053. 3:40:22not. If your main data center gets wiped
  6054. 3:40:25out by a power failure and you only have
  6055. 3:40:27read replicas, you're in massive
  6056. 3:40:29trouble. To fix that specific problem,
  6057. 3:40:31we need multi-AZ. Multi-AZ stands for
  6058. 3:40:34multiple availability zones. So what is
  6059. 3:40:36it? It's an exact identical standby copy
  6060. 3:40:39of your database sitting in a completely
  6061. 3:40:41different physical data center. Why does
  6062. 3:40:43it exist? For strict disaster recovery
  6063. 3:40:46and high availability. Think of Multi-AZ
  6064. 3:40:49like a stunt double in a movie. The
  6065. 3:40:51stunt double stands off camera wearing
  6066. 3:40:53the exact same outfit, copying every
  6067. 3:40:55single move the main actor makes. They
  6068. 3:40:58don't talk. They don't interact with the
  6069. 3:40:59crew. They just wait. If the main actor
  6070. 3:41:02twists their ankle, the director yells,
  6071. 3:41:04"Swap," and the stunt double steps in
  6072. 3:41:07instantly. The movie just keeps filming.
  6073. 3:41:09That's multi-AZ. It uses synchronous
  6074. 3:41:12replication. Every single time you write
  6075. 3:41:14data to your main database, AWS
  6076. 3:41:17simultaneously writes it to the standby
  6077. 3:41:19database before confirming success. They
  6078. 3:41:22are perfectly in sync. If your primary
  6079. 3:41:24database fails, AWS automatically
  6080. 3:41:27updates the DNS record to point to the
  6081. 3:41:29standby. The failover is completely
  6082. 3:41:31seamless. Your application barely even
  6083. 3:41:33notices. But here's the catch. You
  6084. 3:41:35cannot read from the standby database.
  6085. 3:41:37It's strictly a backup. It does
  6086. 3:41:38absolutely zero work until a disaster
  6087. 3:41:41happens. Oh, okay. Now I get it. Read
  6088. 3:41:44replicas are for performance. Multi-AZ
  6089. 3:41:47is for survival. Now, here's the part
  6090. 3:41:49that actually matters for your AWS exam
  6091. 3:41:51and well, your actual career. How do you
  6092. 3:41:54choose between the two? It always comes
  6093. 3:41:56down to the specific business
  6094. 3:41:58requirement. If the business says, "Hey,
  6095. 3:42:00our database is incredibly slow when the
  6096. 3:42:02accounting team runs their monthly
  6097. 3:42:03reports, you need a read replica to
  6098. 3:42:05handle that read intensive pattern." But
  6099. 3:42:07if the business says, "If this database
  6100. 3:42:09goes offline for more than 2 minutes, we
  6101. 3:42:11lose a million dollars." Then you need
  6102. 3:42:13multi-AZ to meet those strict recovery
  6103. 3:42:15time and recovery point metrics. Here is
  6104. 3:42:18the ultimate exam trap. Definitely watch
  6105. 3:42:20out for this. The question will describe
  6106. 3:42:22a database that needs to survive an
  6107. 3:42:24availability zone failure, but it will
  6108. 3:42:27also complain about slow read
  6109. 3:42:28performance. Do not fall for the trick.
  6110. 3:42:32You don't have to choose just one. You
  6111. 3:42:33can actually use both. You can have a
  6112. 3:42:35multi-AZ database for the high
  6113. 3:42:37availability and attach read replicas to
  6114. 3:42:39it for high performance. Let's lock this
  6115. 3:42:42in. Read replicas scale your read
  6116. 3:42:44performance asynchronously. Multi-AZ
  6117. 3:42:47ensures fault tolerance synchronously
  6118. 3:42:49across AWS availability zones.
  6119. 3:42:52Performance equals replicas. Resilience
  6120. 3:42:54equals multi-AZ. To put it simply into a
  6121. 3:42:57mental checklist for your exams. Use
  6122. 3:43:00read replicas strictly for read heavy
  6123. 3:43:02workloads and reporting. Use multi-AZ
  6124. 3:43:05strictly for automated disaster recovery
  6125. 3:43:07and high availability. Remember replicas
  6126. 3:43:09are asynchronous. MultiAZ is
  6127. 3:43:12synchronous. Final warning. If a
  6128. 3:43:14question asks you to fix a slow database
  6129. 3:43:16and you choose multi-AZ, you just failed
  6130. 3:43:19the question. Multi-AZ does not improve
  6131. 3:43:22performance. Master this difference and
  6132. 3:43:24you are one step closer to crushing
  6133. 3:43:25domain 3 of the AWS solutions architect
  6134. 3:43:28exam. But ask yourself this. If a
  6135. 3:43:31catastrophic hardware failure hit your
  6136. 3:43:32company's database right the second,
  6137. 3:43:34would your application survive or just
  6138. 3:43:36fail really fast? Keep building. Okay,
  6139. 3:43:39picture this. You just launched a brand
  6140. 3:43:41new feature. Out of nowhere, a massive
  6141. 3:43:43influencer tweets about it. Boom. You go
  6142. 3:43:45from a 100 users to a 100,000 in exactly
  6143. 3:43:48three minutes. Now, if you're running
  6144. 3:43:50traditional servers, they literally
  6145. 3:43:51melt. Your app crashes hard and you
  6146. 3:43:54totally lose your golden moment. It is a
  6147. 3:43:56complete nightmare. Or, you know, think
  6148. 3:43:58about the exact opposite scenario. You
  6149. 3:43:59provision 10,000 servers just in case
  6150. 3:44:01you go viral, but crickets. Nobody shows
  6151. 3:44:04up and then you get an AWS bill that
  6152. 3:44:06literally bankrupts your startup. Yeah,
  6153. 3:44:09that right there is the ultimate
  6154. 3:44:10nightmare of traditional cloud
  6155. 3:44:11architecture. You either guess too low
  6156. 3:44:13and crash or you guess too high and just
  6157. 3:44:16burn through cash. So today, let's look
  6158. 3:44:18at how modern architects completely
  6159. 3:44:19eliminate this problem. We're going to
  6160. 3:44:21run through the capacity guessing
  6161. 3:44:22nightmare, the serverless vending
  6162. 3:44:23machine model, infinite parallel
  6163. 3:44:25scaling, the tricky 15-minute trap, and
  6164. 3:44:27finally the memory CPU connection. Let's
  6165. 3:44:30dive right in. Starting off with section
  6166. 3:44:32one, the capacity guessing nightmare.
  6167. 3:44:34Look, let's just get one thing straight
  6168. 3:44:36right out of the gate. The term
  6169. 3:44:38serverless, it's kind of a lie. I mean,
  6170. 3:44:40there are absolutely still servers
  6171. 3:44:42involved. But here's the absolute magic
  6172. 3:44:44of it all. You don't manage them. You
  6173. 3:44:46don't have to patch them. And you
  6174. 3:44:47definitely don't have to guess your
  6175. 3:44:49capacity. AWS handles all of that heavy
  6176. 3:44:51lifting completely behind the scenes.
  6177. 3:44:53Really let that sink in for a second.
  6178. 3:44:55Viral traffic doesn't mean a crashed app
  6179. 3:44:58anymore, and overprovisioning doesn't
  6180. 3:45:00mean bankruptcy. All you have to do is
  6181. 3:45:02just bring your code. That's the whole
  6182. 3:45:04shebang. Moving right along to section
  6183. 3:45:07two, the serverless vending machine. To
  6184. 3:45:09really wrap our heads around how this
  6185. 3:45:11compute model works, I want you to think
  6186. 3:45:13of AWS Lambda exactly like a vending
  6187. 3:45:15machine. So a vending machine just sits
  6188. 3:45:18there in the hallway, right? It's doing
  6189. 3:45:20absolutely nothing and it's costing you
  6190. 3:45:220 in compute power. But then a user
  6191. 3:45:26drops in a coin. That coin drop is your
  6192. 3:45:28event trigger. And the very moment that
  6193. 3:45:30trigger happens, the machine instantly
  6194. 3:45:32wakes up. It executes its mechanical
  6195. 3:45:34code. It drops your snack and then it
  6196. 3:45:37goes right back to sleep. I really want
  6197. 3:45:39you to think about that for a second.
  6198. 3:45:41With Lambda, you are only paying for the
  6199. 3:45:43exact milliseconds your code is actively
  6200. 3:45:45running. Once you grasp that, it's a
  6201. 3:45:47total gamecher. Oh, now I get it. If
  6202. 3:45:50nobody clicks the button in your app,
  6203. 3:45:52you pay absolutely nothing. Zero. Just
  6204. 3:45:54try doing that with a traditional server
  6205. 3:45:56that has to be left running 24/7. All
  6206. 3:45:58right. Section three, infinite parallel
  6207. 3:46:01scaling. Now, here is where things get
  6208. 3:46:03super interesting. How do we actually
  6209. 3:46:05use this in real world high-erforming
  6210. 3:46:08systems? Well, you use Lambda to deeply
  6211. 3:46:11decouple your workloads by breaking
  6212. 3:46:13things apart. Every single component can
  6213. 3:46:15scale completely independently. Let's
  6214. 3:46:18look at an example. Imagine a user
  6215. 3:46:19uploads a huge profile picture to your
  6216. 3:46:21app. That upload itself is an event. It
  6217. 3:46:23triggers a Lambda function. The function
  6218. 3:46:25wakes up, resizes the image for mobile,
  6219. 3:46:27saves it, and then dies. Simple, right?
  6220. 3:46:29If one person uploads, one Lambda runs.
  6221. 3:46:32But what if 10,000 people upload photos
  6222. 3:46:34at the exact same second? Well, 10,000
  6223. 3:46:36separate Lambda functions instantly spin
  6224. 3:46:38up in parallel. They do the job and then
  6225. 3:46:40they all vanish. That brings us to
  6226. 3:46:42section four, the 15-minute trap. Listen
  6227. 3:46:46closely, because this is exactly where
  6228. 3:46:48people mess up. They start treating
  6229. 3:46:50Lambda like it's some sort of magic
  6230. 3:46:52bullet and they try to run literally
  6231. 3:46:54everything on it. Let me tell you right
  6232. 3:46:56now, you cannot do that. AWS Lambda has
  6233. 3:46:59a strict non-negotiable 15minute maximum
  6234. 3:47:02execution timeout. If your code takes,
  6235. 3:47:04say, 16 minutes to process some massive
  6236. 3:47:06database export, Lambda simply does not
  6237. 3:47:09care. At exactly 15 minutes, it
  6238. 3:47:11ruthlessly kills your process. Boom.
  6239. 3:47:13Done. Your system breaks right halfway
  6240. 3:47:16through. So, if you have massive,
  6241. 3:47:18longunning, continuous tasks, Lambda is
  6242. 3:47:21absolutely the wrong tool for the job.
  6243. 3:47:23Period. So, how do you actually decide
  6244. 3:47:25between the two? Well, it always comes
  6245. 3:47:27down to your traffic pattern. If you
  6246. 3:47:29have a constant, predictable, heavy
  6247. 3:47:31heartbeat of traffic, kind of like a
  6248. 3:47:33massive multiplayer game server, then
  6249. 3:47:35traditional EC2 instances are going to
  6250. 3:47:37be highly efficient. But if your traffic
  6251. 3:47:40is unpredictable, if it's spiky, or if
  6252. 3:47:42it's triggered by random user events,
  6253. 3:47:44Lambda is absolutely unmatched. Okay,
  6254. 3:47:47moving to our final segment, section
  6255. 3:47:49five, the memory CPU connection. Now,
  6256. 3:47:52heads up because this is the ultimate
  6257. 3:47:54exam trap. You need to watch out for
  6258. 3:47:56this. You are definitely going to be
  6259. 3:47:58tested on your ability to select the
  6260. 3:47:59appropriate resource size to meet your
  6261. 3:48:01specific business requirements. See,
  6262. 3:48:03with a traditional server, you go in and
  6263. 3:48:06you choose your CPU and your RAM
  6264. 3:48:08separately, right? But with Lambda, you
  6265. 3:48:10only configure the amount of memory. So,
  6266. 3:48:12people naturally get confused and they
  6267. 3:48:14ask us, "Hey, how do I make my Lambda
  6268. 3:48:16function process faster? Where is the
  6269. 3:48:18CPU dial?" Well, here is the secret.
  6270. 3:48:21There is no CPU dial. AWS automatically
  6271. 3:48:24allocates CPU power linearly
  6272. 3:48:26proportional to the amount of memory you
  6273. 3:48:28configure. It's really that simple. If
  6274. 3:48:31you double the memory, you automatically
  6275. 3:48:33double the CPU power under the hood. All
  6276. 3:48:35right, let's lock all this in. Lambda
  6277. 3:48:38runs your code without you ever having
  6278. 3:48:39to provision servers and it scales
  6279. 3:48:41automatically based purely on event
  6280. 3:48:43triggers. You want to deeply decouple
  6281. 3:48:45your workloads so they can scale
  6282. 3:48:46infinitely and independently. And
  6283. 3:48:48remember, you optimize your compute
  6284. 3:48:49performance strictly by adjusting the
  6285. 3:48:51memory allocation. So use Lambda for
  6286. 3:48:53unpredictable event-driven traffic.
  6287. 3:48:55Scale your performance by increasing
  6288. 3:48:57memory, not CPU. And whatever you do,
  6289. 3:48:59avoid Lambda for any process that takes
  6290. 3:49:01longer than 15 minutes. Final warning on
  6291. 3:49:03that one, guys. If a scenario asks you
  6292. 3:49:05for a compute solution for a continuous
  6293. 3:49:07hours long processing job, do not pick
  6294. 3:49:09Lambda. It will time out and it will
  6295. 3:49:11fail. Master serverless and you truly
  6296. 3:49:13unlock the power of the cloud. But
  6297. 3:49:15considering those 15-minute timeouts and
  6298. 3:49:17memory bound CPU limits, it leaves you
  6299. 3:49:19wondering, are traditional servers
  6300. 3:49:20really dead, or do they just have a
  6301. 3:49:22different job now? Welcome to this
  6302. 3:49:24explainer on ALB versus API Gateway.
  6303. 3:49:28Imagine this. Your brand new mobile app
  6304. 3:49:30finally gets featured on the App Store.
  6305. 3:49:32It's the exact moment you've been
  6306. 3:49:33waiting for. Thousands of enthusiastic
  6307. 3:49:36users hit your backend all at once. The
  6308. 3:49:38traffic is absolutely massive, just
  6309. 3:49:40pouring in way faster than you can even
  6310. 3:49:42track. But it's not just volume you're
  6311. 3:49:45dealing with here. You've got malicious
  6312. 3:49:47bots out there trying to scrape your
  6313. 3:49:48data. You've got impatient users
  6314. 3:49:50aggressively spamming the refresh button
  6315. 3:49:52over and over again. And within minutes,
  6316. 3:49:55your entire system crashes. And here's
  6317. 3:49:57the truly frustrating part. It failed
  6318. 3:49:59not because you didn't have enough
  6319. 3:50:01servers spun up. It failed because you
  6320. 3:50:03didn't control how traffic entered your
  6321. 3:50:05system in the first place. This brings
  6322. 3:50:07us to the ultimate traffic cop problem.
  6323. 3:50:10You have clients on one side, browsers,
  6324. 3:50:12mobile apps, maybe other services, and
  6325. 3:50:14your back-end compute on the other side.
  6326. 3:50:17You need something intelligent in the
  6327. 3:50:18middle to catch that incoming traffic,
  6328. 3:50:20inspect what it actually is, and
  6329. 3:50:22carefully route it. AWS gives us two
  6330. 3:50:25heavyweights to solve this exact
  6331. 3:50:27architectural challenge. The application
  6332. 3:50:28load balancer or AOB and Amazon API
  6333. 3:50:31gateway. Both of these powerful services
  6334. 3:50:33can route HTTP traffic. Both of them can
  6335. 3:50:36trigger your underlying compute
  6336. 3:50:37services. And honestly, this overlap
  6337. 3:50:39confuses almost everyone studying for
  6338. 3:50:41the AWS solutions architect exam. Now,
  6339. 3:50:43just a quick heads up as your guide
  6340. 3:50:45here. While the official exam guide
  6341. 3:50:46lists these load balancing and API
  6342. 3:50:48management tools under domain 3, high
  6343. 3:50:50performing architectures, the specific
  6344. 3:50:52feature comparisons I'm hearing today
  6345. 3:50:53come from real world AWS documentation
  6346. 3:50:55outside of that specific blueprint. So,
  6347. 3:50:57you'll want to verify the exact specs
  6348. 3:50:58independently. Let's break this down to
  6349. 3:51:00its absolute simplest form. Starting
  6350. 3:51:02with the application load balancer, an
  6351. 3:51:04ALB is exactly what it sounds like. It
  6352. 3:51:06simply balances the load across your
  6353. 3:51:08resources. It sits right at layer 7 of
  6354. 3:51:11the OSI model, looks at the incoming
  6355. 3:51:13HTTP or HTTPS request and routes it to
  6356. 3:51:16the right target. That is its core job.
  6357. 3:51:19Think of the ALB like a highly efficient
  6358. 3:51:21restaurant host. You walk through the
  6359. 3:51:23front door and the host looks at you,
  6360. 3:51:25asks, "Do you want the bar or a table?"
  6361. 3:51:27and then points you to the right place
  6362. 3:51:28based on your answer. That is really all
  6363. 3:51:30it does. It doesn't step into the
  6364. 3:51:32kitchen and cook your food. It doesn't
  6365. 3:51:34stop you from eating too fast or
  6366. 3:51:36ordering too much. It just gets you to
  6367. 3:51:38the right server, the right container,
  6368. 3:51:40or the right Lambda function based
  6369. 3:51:41purely on the URL path you requested.
  6370. 3:51:44What happens if you don't use it? Well,
  6371. 3:51:46one single server gets 99% of the
  6372. 3:51:48traffic and completely dies from the
  6373. 3:51:50overwhelming load, while the rest of
  6374. 3:51:52your expensive servers sit completely
  6375. 3:51:54idle. The trade-off for using one, ALB
  6376. 3:51:56is incredibly fast. It is extremely
  6377. 3:51:58cheap at massive scale, but it is just a
  6378. 3:52:01router. Now, let's look at Amazon API
  6379. 3:52:03Gateway. API Gateway is not just a
  6380. 3:52:05router. It is a full-blown front door, a
  6381. 3:52:08highly trained security guard, and a
  6382. 3:52:10sophisticated traffic manager, all
  6383. 3:52:12combined into a single managed service.
  6384. 3:52:14It can do what the ALB does in terms of
  6385. 3:52:16directing traffic, but it adds massive
  6386. 3:52:18crucial intelligence to the equation. It
  6387. 3:52:20can aggressively throttle requests so a
  6388. 3:52:22single rogue user doesn't spam your
  6389. 3:52:24backend into oblivion. It can
  6390. 3:52:26mathematically validate complex JSON
  6391. 3:52:28payloads before they ever have the
  6392. 3:52:29chance to reach your underlying servers.
  6393. 3:52:31It can even manage dedicated API keys
  6394. 3:52:33for your premium paying users. Think
  6395. 3:52:35about that for a second. With an ALB, a
  6396. 3:52:38badly formatted, potentially harmful
  6397. 3:52:40request hits your backend compute before
  6398. 3:52:43it finally gets rejected. With API
  6399. 3:52:45gateway, that bad request is killed
  6400. 3:52:47immediately at the door. Your backend
  6401. 3:52:49never even wakes up. You save compute,
  6402. 3:52:52you save money, and you maintain
  6403. 3:52:54absolute security. Oh, now I get it. So,
  6404. 3:52:58here is the mental model to remember.
  6405. 3:53:00ALB is the friendly host routing
  6406. 3:53:02traffic. API gateway is the bouncer
  6407. 3:53:06checking IDs, enforcing the house rules,
  6408. 3:53:08and stopping fights before they ever
  6409. 3:53:10spill into the main room. Now, pay
  6410. 3:53:13attention because here is where people
  6411. 3:53:15completely fail this concept. They see a
  6412. 3:53:17serverless architecture diagram using
  6413. 3:53:19AWS Lambda and they automatically assume
  6414. 3:53:21they must use API gateway as the
  6415. 3:53:23trigger. You don't. An application load
  6416. 3:53:26balancer can directly trigger a Lambda
  6417. 3:53:28function too. It's a massive
  6418. 3:53:29misconception that costs people points
  6419. 3:53:31on exams and money in real world
  6420. 3:53:33architecture. So when do you actually
  6421. 3:53:35use each? This is the million-doll real
  6422. 3:53:38world decision. If you are building an
  6423. 3:53:40internal micros service or a massive
  6424. 3:53:42scale web application where every single
  6425. 3:53:44millisecond counts and you just need to
  6426. 3:53:46spray high volume HTTP traffic across a
  6427. 3:53:48massive fleet of EC2 instances or
  6428. 3:53:50containers, you use an ALB. It handles
  6429. 3:53:52incredibly massive throughput and costs
  6430. 3:53:54a tiny fraction of what API gateway
  6431. 3:53:56charges. But if you are exposing a
  6432. 3:53:58public API to thirdparty developers, you
  6433. 3:54:01absolutely need API gateway. You need to
  6434. 3:54:03hand out API keys. You need to create
  6435. 3:54:05usage plans to charge customers based on
  6436. 3:54:07how many API calls they make. You need
  6437. 3:54:09strict enforcable per user throttling to
  6438. 3:54:12protect your platform. Now imagine this
  6439. 3:54:14disastrous scenario in your system. You
  6440. 3:54:16put a simple ALB in front of a heavily
  6441. 3:54:18used public API. A malicious user or
  6442. 3:54:21even just a badly coded client writes a
  6443. 3:54:23script that spams your endpoint 10,000
  6444. 3:54:26times a second. Your ALB happily,
  6445. 3:54:28blindly routes every single one of those
  6446. 3:54:3010,000 requests directly to your
  6447. 3:54:32backend. Your backend frantically scales
  6448. 3:54:34up, processes the absolute junk, and at
  6449. 3:54:36the end of the month, your AWS bill
  6450. 3:54:38absolutely explodes. It's a devastating
  6451. 3:54:40financial hit. If you had used API
  6452. 3:54:42Gateway instead, it would have
  6453. 3:54:44recognized the abuse and throttled them
  6454. 3:54:45instantly right at the door. Now, here's
  6455. 3:54:48the exact trap you will see on the exam.
  6456. 3:54:50The scenario will describe a company
  6457. 3:54:52migrating a standard web application.
  6458. 3:54:53They'll say they want to route HTTP
  6459. 3:54:55traffic to a fleet of back-end servers,
  6460. 3:54:58but hidden quietly in the second
  6461. 3:54:59paragraph, it will mention they need to
  6462. 3:55:01manage API keys or throttle requests by
  6463. 3:55:04user tier. If you just read route HTTP
  6464. 3:55:06traffic and hastily pick application
  6465. 3:55:08load balancer, you fail the question.
  6466. 3:55:10ALB does not support API keys. ALB does
  6467. 3:55:13not support per user throttling. The
  6468. 3:55:15moment you see the specific words API
  6469. 3:55:17keys, throttling, usage plans, or
  6470. 3:55:20payload validation, you immediately pick
  6471. 3:55:22Amazon API gateway. Oh, now I get it. It
  6472. 3:55:27ultimately comes down to this. The
  6473. 3:55:29choice isn't about where the traffic
  6474. 3:55:31goes. It's about how much control you
  6475. 3:55:33need over the traffic itself before it's
  6476. 3:55:35allowed inside. Let's lock this in one
  6477. 3:55:38final time. A OB routes traffic
  6478. 3:55:40efficiently at massive scale for cheap.
  6479. 3:55:43API gateway manages, secures, and
  6480. 3:55:45monetizes public-f facing APIs. Use ALB
  6481. 3:55:48for high throughput, internal routing,
  6482. 3:55:50or simple web apps where speed is the
  6483. 3:55:52only metric. Use API gateway for API
  6484. 3:55:55keys, throttling, and full API life
  6485. 3:55:57cycle management. Both can trigger
  6486. 3:55:59compute services, but API gateway always
  6487. 3:56:01protects your backend better. Which
  6488. 3:56:03leaves us with this final thought. Is
  6489. 3:56:05your backend currently paying the price
  6490. 3:56:07for a missing bouncer? Final warning. If
  6491. 3:56:10your architectural scenario demands
  6492. 3:56:11usage plans or API monetization, ALB is
  6493. 3:56:14a dangerous trap. Pick API gateway.
  6494. 3:56:17Master this crucial difference and you
  6495. 3:56:19completely control the traffic. Welcome
  6496. 3:56:21to this explainer. Today we're
  6497. 3:56:23completely demystifying AWS container
  6498. 3:56:26services. Imagine you spend 6 months
  6499. 3:56:28writing the perfect code. It runs
  6500. 3:56:30absolutely flawlessly on your laptop.
  6501. 3:56:32You deploy it to production and
  6502. 3:56:34instantly the entire system crashes.
  6503. 3:56:36Why? because the production server has a
  6504. 3:56:38slightly different software version than
  6505. 3:56:39your laptop. Millions of dollars lost
  6506. 3:56:41over a minor system mismatch. Section
  6507. 3:56:44one, the container revolution. Solving
  6508. 3:56:47the deployment nightmare. To solve this
  6509. 3:56:50exact nightmare, the tech industry
  6510. 3:56:51adopted containers. And if you're
  6511. 3:56:53studying for domain 3 of the AWS
  6512. 3:56:55solutions architect exam, you must
  6513. 3:56:57master how AWS handles them. Just a
  6514. 3:57:00quick heads up before we dive in. The
  6515. 3:57:01official exam guide explicitly tests
  6516. 3:57:03your ability to design high-erforming
  6517. 3:57:05architectures using container
  6518. 3:57:06orchestration and serverless
  6519. 3:57:08technologies, but the specific real
  6520. 3:57:10world operational differences I'm about
  6521. 3:57:12to share come from AWS engineering
  6522. 3:57:14documentation outside that highle
  6523. 3:57:16blueprint. So, you'll want to
  6524. 3:57:17independently verify the deeper specs.
  6525. 3:57:20Let's break this down from zero. A
  6526. 3:57:22container packages your code, its
  6527. 3:57:24dependencies, and its runtime into one
  6528. 3:57:25standardized box. It doesn't matter if
  6529. 3:57:27it runs on your laptop, a physical data
  6530. 3:57:29center, or the AWS cloud. It runs
  6531. 3:57:31exactly the same everywhere. Think of
  6532. 3:57:33physical shipping cargo. A 100 years
  6533. 3:57:35ago, loading a ship was a nightmare of
  6534. 3:57:38custom barrels, crates, and sacks.
  6535. 3:57:41Today, everything goes into a standard
  6536. 3:57:43steel shipping container. Cranes can
  6537. 3:57:45move them blindly. But here is the
  6538. 3:57:47problem in real systems. If you have
  6539. 3:57:49three containers, you can manually start
  6540. 3:57:51them. But what if your app goes viral
  6541. 3:57:53and you need 10,000 containers? What if
  6542. 3:57:55a server dies at 3:00 a.m. and takes
  6543. 3:57:57down 50 containers? Who restarts them?
  6544. 3:58:00Who routes network traffic to the
  6545. 3:58:02healthy ones? You need a massive
  6546. 3:58:04automated train operator. You need
  6547. 3:58:06container orchestration. Section two,
  6548. 3:58:08the orchestration brains. Amazon ECS
  6549. 3:58:11versus Amazon EKS. AWS gives us two
  6550. 3:58:15heavyweights for this. Amazon ECS and
  6551. 3:58:18Amazon EKS.
  6552. 3:58:20First, Amazon ECS, Elastic Container
  6553. 3:58:24Service. This is AWS's native container
  6554. 3:58:28orchestrator. It was built by AWS for
  6555. 3:58:30AWS. Why does it exist? Because
  6556. 3:58:33developers wanted a simple, deeply
  6557. 3:58:35integrated way to manage containers
  6558. 3:58:36without learning an entirely new
  6559. 3:58:38ecosystem. ECS integrates perfectly with
  6560. 3:58:41AWS load balancers, security groups, and
  6561. 3:58:44AM roles. It is incredibly
  6562. 3:58:46straightforward.
  6563. 3:58:47Then we have Amazon EKS, Elastic
  6564. 3:58:50Kubernetes Service. Kubernetes is the
  6565. 3:58:52open- source industry standard for
  6566. 3:58:54container orchestration. It is insanely
  6567. 3:58:56powerful, but also notoriously complex.
  6568. 3:58:59So why use EKS if it's harder? Universal
  6569. 3:59:02portability. If your company already
  6570. 3:59:04uses Kubernetes, you can move your
  6571. 3:59:06containers between AWS, arrival cloud,
  6572. 3:59:08or your own basement without rewriting a
  6573. 3:59:10single line of deployment logic. It is
  6574. 3:59:12like speaking a universal language.
  6575. 3:59:14Section three, the infrastructure
  6576. 3:59:17muscle. Why you still need hardware. But
  6577. 3:59:20here's where people fail this. They
  6578. 3:59:22think picking ECS or EKS solves
  6579. 3:59:24everything. It doesn't. ECS and EKS are
  6580. 3:59:27just the management layer. They are the
  6581. 3:59:28brains. They still need muscle. They
  6582. 3:59:30need physical hardware to actually run
  6583. 3:59:32the containers. Historically, that meant
  6584. 3:59:34you had to provision Amazon EC2 servers,
  6585. 3:59:37join them to your cluster, patch their
  6586. 3:59:38operating systems, and monitor their
  6587. 3:59:40capacity. If your EC2 servers ran out of
  6588. 3:59:42memory, your orchestrator couldn't
  6589. 3:59:44deploy new containers. You are stuck
  6590. 3:59:46managing servers again. Enter AWS
  6591. 3:59:49Fargate. Fargate completely changes the
  6592. 3:59:52game. It is a serverless compute engine
  6593. 3:59:55specifically for containers. Think about
  6594. 3:59:57that for a second. With Fargate, there
  6595. 3:59:59are no EC2 instances to provision, no
  6596. 4:00:02operating systems to patch, no server
  6597. 4:00:04capacity to guess. You literally just
  6598. 4:00:06tell AWS, "Here is my container image. I
  6599. 4:00:09need two gigs of RAM and one CPU. Run
  6600. 4:00:11it. AWS magically finds a compute space
  6601. 4:00:13in their massive data centers, runs the
  6602. 4:00:15container, and bills you strictly for
  6603. 4:00:17what you use. Oh, now I get it. ECS and
  6604. 4:00:21EKS are the managers telling the system
  6605. 4:00:24what needs to happen. EC2 and Fargate
  6606. 4:00:27are the underlying workforce actually
  6607. 4:00:29doing the heavy lifting. Section four,
  6608. 4:00:32making the architectural choice, the
  6609. 4:00:35two-part decision. So, how do you
  6610. 4:00:37choose? This is the ultimate
  6611. 4:00:38architectural decision. It's a two-part
  6612. 4:00:41choice. First, pick your manager. If you
  6613. 4:00:43want native AWS simplicity, pick ECS. If
  6614. 4:00:46you need open source portability or have
  6615. 4:00:48an existing Kubernetes footprint, pick
  6616. 4:00:50EKS. Second, pick your muscle. If you
  6617. 4:00:53need strict root level control over the
  6618. 4:00:55underlying hardware or you are running
  6619. 4:00:57massive predictable workloads where
  6620. 4:00:58reserved servers are cheaper, use EC2.
  6621. 4:01:01But if you want to eliminate server
  6622. 4:01:03maintenance and achieve the lowest
  6623. 4:01:04possible operational overhead, you pick
  6624. 4:01:07Fargate. Section five, avoiding the exam
  6625. 4:01:10trap. Read the requirements carefully.
  6626. 4:01:13Now, here is the exact trap you will see
  6627. 4:01:15on the exam and in the real world. The
  6628. 4:01:18scenario will describe a startup
  6629. 4:01:19deploying microservices using
  6630. 4:01:21containers. The prompt will explicitly
  6631. 4:01:23state that the engineering team is small
  6632. 4:01:25and needs to minimize operational
  6633. 4:01:27overhead or avoid managing underlying
  6634. 4:01:29infrastructure. One of the multiple
  6635. 4:01:31choice answers will be Amazon EKS with
  6636. 4:01:34EC2 worker nodes. Do not pick it. EKS is
  6637. 4:01:37complex and EC2 requires server
  6638. 4:01:39management. You failed the requirement.
  6639. 4:01:41The moment you see containers combined
  6640. 4:01:43with lowest operational overhead or no
  6641. 4:01:46server management, your brain needs to
  6642. 4:01:48instantly lock on to AWS Fargate. So,
  6643. 4:01:52here is the big light bulb moment.
  6644. 4:01:53Fargate isn't a competitor to ECS.
  6645. 4:01:56Fargate is the invisible server powering
  6646. 4:01:58ECS. Let's lock this in. Containers
  6647. 4:02:02standardize your deployments.
  6648. 4:02:03Orchestrators manage the chaos. ECS is
  6649. 4:02:06native and simple. EKS is open-source
  6650. 4:02:09and portable. Fargate is the serverless
  6651. 4:02:12engine that eliminates infrastructure
  6652. 4:02:14management. Pick ECS for fast, deep AWS
  6653. 4:02:17integration. Pick EKS for Kubernetes
  6654. 4:02:20migrations and cloud agnosticism. Pick
  6655. 4:02:23Fargate when you never want to patch a
  6656. 4:02:24server again. Final warning. If you
  6657. 4:02:27think Fargate replaces ECS or EKS, you
  6658. 4:02:30will miss the architecture question.
  6659. 4:02:32Fargate works with them. Master this
  6660. 4:02:34decoupling of brains and muscle and you
  6661. 4:02:36will dominate domain 3. But looking at
  6662. 4:02:38your own infrastructure today, are you
  6663. 4:02:40spending your time building great
  6664. 4:02:42products or are you still just managing
  6665. 4:02:43servers? Data streaming Kinesis basics.
  6666. 4:02:46All right, so imagine you just launched
  6667. 4:02:48a massive multiplayer mobile game,
  6668. 4:02:51right? And it goes completely viral.
  6669. 4:02:54Suddenly you've got a million players
  6670. 4:02:55online. Every single time someone moves,
  6671. 4:02:58shoots, or scores, your application
  6672. 4:03:00sends a critical data point straight to
  6673. 4:03:02your back end. We're talking millions of
  6674. 4:03:05events per second. Now, let's say you
  6675. 4:03:07route all of this incoming data directly
  6676. 4:03:10into your main database. Well, within
  6677. 4:03:12exactly 4 seconds, the database locks
  6678. 4:03:15up. It literally catches fire. The game
  6679. 4:03:18crashes, and just like that, your viral
  6680. 4:03:20moment is completely dead. So, why does
  6681. 4:03:22this happen? It's because databases are
  6682. 4:03:25fundamentally designed for storing and
  6683. 4:03:26intricately querying data. They are
  6684. 4:03:28incredibly fragile when they're hit with
  6685. 4:03:30a relentless high velocity tsunami of
  6686. 4:03:32raw inserts. They simply cannot handle
  6687. 4:03:34the sheer force of a million users
  6688. 4:03:36pushing data all at the exact same time.
  6689. 4:03:38Look, you didn't need a bigger database.
  6690. 4:03:41What you actually needed was a shock
  6691. 4:03:43absorber. And this is exactly where data
  6692. 4:03:45streaming comes into play. On the AWS
  6693. 4:03:48solutions architect exam, the absolute
  6694. 4:03:50king of streaming data ingestion is
  6695. 4:03:52Amazon Kinesis. Let's break this down to
  6696. 4:03:54its absolute simplest form. Think of
  6697. 4:03:57Kinesis like a massive, totally
  6698. 4:03:59indestructible conveyor belt. So your
  6699. 4:04:01mobile game, your IoT sensors, your web
  6700. 4:04:03servers, they're what we call the
  6701. 4:04:05producers, and they just throw data onto
  6702. 4:04:07this conveyor belt as fast as humanly
  6703. 4:04:09possible. Now, the belt itself doesn't
  6704. 4:04:11actually process the data. It just
  6705. 4:04:13catches it, holds it securely, and keeps
  6706. 4:04:15moving forward. Then on the completely
  6707. 4:04:17other end of the belt, you have your
  6708. 4:04:18consumers. These are your EC2 servers or
  6709. 4:04:21your Lambda functions, and they just
  6710. 4:04:22calmly pull data off the belt at their
  6711. 4:04:24own safe, perfectly manageable speed.
  6712. 4:04:27Think about that for a second. If your
  6713. 4:04:28game suddenly spikes to 10 million
  6714. 4:04:30users, sure, the conveyor belt gets
  6715. 4:04:32crowded, but your database doesn't crash
  6716. 4:04:34because your database is sitting safely
  6717. 4:04:36behind those consumers. This is the real
  6718. 4:04:38light bulb moment here. Kinesis
  6719. 4:04:40completely decouples the massive speed
  6720. 4:04:42of incoming data from the processing
  6721. 4:04:44speed of your backend. It acts as that
  6722. 4:04:46absolutely crucial buffer and it
  6723. 4:04:47prevents your entire system from
  6724. 4:04:49basically drowning in its own success.
  6725. 4:04:51Now to architect this correctly, you've
  6726. 4:04:53got to understand that Kinesis isn't
  6727. 4:04:55just one single service. It's actually a
  6728. 4:04:57family and you are going to be tested
  6729. 4:04:59heavily on the critical difference
  6730. 4:05:00between the two main members of this
  6731. 4:05:02family. Kinesis data streams and Kinesis
  6732. 4:05:05data fire hose. First up, let's look at
  6733. 4:05:08Kinesis data streams. This right here is
  6734. 4:05:10the ultimate real-time streaming
  6735. 4:05:12service. When you use data streams, your
  6736. 4:05:14data is available to be processed in
  6737. 4:05:15literally milliseconds. It is lightning
  6738. 4:05:18fast. But here is the big trade-off you
  6739. 4:05:20have to remember. It requires manual
  6740. 4:05:22management. You see, data streams is
  6741. 4:05:24built out of individual structural units
  6742. 4:05:26called shards. I want you to think of a
  6743. 4:05:28shard kind of like a lane on a highway.
  6744. 4:05:30One lane can handle exactly 1 megabyte
  6745. 4:05:33of data per second coming in and 2
  6746. 4:05:35megabytes per second going out. But, and
  6747. 4:05:38listen closely because this is exactly
  6748. 4:05:40where people mess up. If your traffic
  6749. 4:05:42spikes, one lane just isn't going to be
  6750. 4:05:44enough. You have to manually add more
  6751. 4:05:46lanes. You actually have to write custom
  6752. 4:05:48code to pull the data out of the stream.
  6753. 4:05:51It requires your active hands-on
  6754. 4:05:52involvement to keep that traffic flowing
  6755. 4:05:54smoothly. Now, imagine this running in
  6756. 4:05:57your live production system. If you
  6757. 4:05:59miscalculate and you don't provision
  6758. 4:06:00enough shards, that highway jams up
  6759. 4:06:03completely. AWS actually drops your
  6760. 4:06:05incoming data. you get this dreaded
  6761. 4:06:07provisioned throughput exceeded error
  6762. 4:06:09and boom, your vital data is lost before
  6763. 4:06:12it even hits the back end. So to avoid
  6764. 4:06:14that massive headache, AWS gives us a
  6765. 4:06:17second option and that's Kinesis data
  6766. 4:06:19fire hose. Fire hose completely
  6767. 4:06:21eliminates all of that management
  6768. 4:06:23overhead. There are zero shards. There
  6769. 4:06:25are no highways to manage. It just
  6770. 4:06:27scales perfectly, infinitely, and
  6771. 4:06:29entirely automatically. You literally
  6772. 4:06:31just point fire hose at an S3 bucket, an
  6773. 4:06:33Amazon Redshift data warehouse, or maybe
  6774. 4:06:35open search, and it automatically
  6775. 4:06:37delivers the data directly to those
  6776. 4:06:38targets. We're talking zero custom code
  6777. 4:06:41here. Zero maintenance. But guys, here
  6778. 4:06:44is exactly where people fail this. They
  6779. 4:06:47think Fire Hose is just some better
  6780. 4:06:49upgraded version of data streams. I
  6781. 4:06:51promise you it is not. Fire Hose is near
  6782. 4:06:54real time, not real time. It buffers the
  6783. 4:06:57data. It waits until it collects a
  6784. 4:06:59certain amount of data or until up to 60
  6785. 4:07:01seconds pass before it actually delivers
  6786. 4:07:04the entire batch over to the
  6787. 4:07:05destination. So, look at it this way.
  6788. 4:07:08Data streams, that's your extremely fast
  6789. 4:07:10sports car for instant processing. But
  6790. 4:07:13Fire Hose, Fire Hose is like a delivery
  6791. 4:07:15truck that sits right at the loading
  6792. 4:07:17dock and just patiently waits until it's
  6793. 4:07:19completely full before driving off to
  6794. 4:07:20the warehouse. Oh, now I get it, right?
  6795. 4:07:24And this brings us to the ultimate
  6796. 4:07:26architectural decision, which is exactly
  6797. 4:07:28how you're going to be tested. When do
  6798. 4:07:30you use each one? Well, it always comes
  6799. 4:07:33down to two specific words, latency and
  6800. 4:07:35destination. Let's say the business
  6801. 4:07:38stakeholder tells you, "Hey, we need to
  6802. 4:07:40detect credit card fraud in under 50
  6803. 4:07:42milliseconds. In that case, you
  6804. 4:07:44absolutely must use Kinesis data
  6805. 4:07:46streams. Fire hose is simply way too
  6806. 4:07:48slow for that kind of instant mission
  6807. 4:07:50critical alerting. But if the business
  6808. 4:07:53comes to you and says, "Look, we want to
  6809. 4:07:55collect millions of web logs and just
  6810. 4:07:57save them into an Amazon S3 data lake
  6811. 4:07:59with zero operational overhead." Well,
  6812. 4:08:01then you use Kinesis data fire hose.
  6813. 4:08:04Now, here is the exact exam trap you
  6814. 4:08:06really need to watch out for. The
  6815. 4:08:08question will describe this massive data
  6816. 4:08:10ingestion requirement, right? And the
  6817. 4:08:12scenario will explicitly complain that
  6818. 4:08:14the engineering team is just so tired of
  6819. 4:08:16managing infrastructure and writing
  6820. 4:08:17custom consumer applications. and then
  6821. 4:08:20one of the tricky multiple choice
  6822. 4:08:21answers will inevitably suggest Kinesis
  6823. 4:08:24data streams with autoscaling.
  6824. 4:08:26Do not pick it. Seriously, the exact
  6825. 4:08:29moment you see phrases like zero
  6826. 4:08:31administration, no custom code, and a
  6827. 4:08:34requirement for delivering data to an
  6828. 4:08:35AWS storage service like S3 or Redshift,
  6829. 4:08:38your brain needs to instantly lock onto
  6830. 4:08:40Kinesis data fire hose. All right, let's
  6831. 4:08:43lock this in so you don't forget it.
  6832. 4:08:45Kinesis acts as a shock absorber to
  6833. 4:08:47protect your databases from high
  6834. 4:08:48velocity data. Data streams gives you
  6835. 4:08:50that sweet millisecond latency, but it
  6836. 4:08:53requires you to actively manage shards
  6837. 4:08:54and write custom code. Data fire hose
  6838. 4:08:57gives you fully managed zero
  6839. 4:08:58administration data delivery. But
  6840. 4:09:00remember, it buffers the data. So use
  6841. 4:09:02data streams for real-time custom
  6842. 4:09:04analytics. Use Fire Hose to easily load
  6843. 4:09:06data into S3 or Redshift. And just keep
  6844. 4:09:09in mind if you ever need to transform
  6845. 4:09:11the data on the fly, both services have
  6846. 4:09:13the exact same ability to trigger AWS
  6847. 4:09:15Lambda. Final warning here. If you try
  6848. 4:09:17to use Fire Hose for millisecond
  6849. 4:09:19real-time alerts, your system will
  6850. 4:09:21absolutely fail. Master the precise
  6851. 4:09:24difference between streams and buffers
  6852. 4:09:26and you are going to absolutely dominate
  6853. 4:09:28domain 3. So the real question is the
  6854. 4:09:30next time your app goes viral, is your
  6855. 4:09:32data going to drown your database or
  6856. 4:09:34will you be completely ready to ride the
  6857. 4:09:36wave? Imagine this. You spin up a
  6858. 4:09:38massive cluster of high performance
  6859. 4:09:40servers for a brand new project.
  6860. 4:09:42Everything works perfectly. So you pack
  6861. 4:09:45up and you go home for the weekend. But
  6862. 4:09:48then Monday rolls around. You check your
  6863. 4:09:50AWS dashboard and your heart literally
  6864. 4:09:53drops. You just burned $50,000 on
  6865. 4:09:56servers that were just sitting there
  6866. 4:09:58entirely idle. Your startup is bankrupt.
  6867. 4:10:02Look, this is absolutely the most common
  6868. 4:10:04disaster in cloud computing. People
  6869. 4:10:07think the cloud is just inherently
  6870. 4:10:08cheaper, but it's not. It is only
  6871. 4:10:11cheaper if you know exactly how to buy
  6872. 4:10:13it. And to pass domain four of the AWS
  6873. 4:10:15solutions architect exam, which is all
  6874. 4:10:17about designing costs optimized
  6875. 4:10:19architectures, you have to master how to
  6876. 4:10:21purchase compute capacity without
  6877. 4:10:23wasting money. Just a quick heads up
  6878. 4:10:25before we dive into the details. The
  6879. 4:10:27official exam guide explicitly requires
  6880. 4:10:29you to know AWS purchasing options like
  6881. 4:10:32spot instances, reserved instances, and
  6882. 4:10:34savings plans. But the specific real
  6883. 4:10:36world discount percentages and billing
  6884. 4:10:37mechanics I'm going to share today come
  6885. 4:10:39from AWS pricing documentation outside
  6886. 4:10:41of that highle blueprint. So you'll
  6887. 4:10:43definitely want to independently verify
  6888. 4:10:45those exact numbers for your own real
  6889. 4:10:47world projects. All right, let's break
  6890. 4:10:49this down from zero. We are talking
  6891. 4:10:51about renting compute power,
  6892. 4:10:52specifically Amazon EC2. AWS gives you
  6893. 4:10:56three main ways to pay for this compute.
  6894. 4:10:58On demand, reserved instances and spot
  6895. 4:11:01instances. Let's start with on demand.
  6896. 4:11:04On demand is exactly what it sounds
  6897. 4:11:06like. You pay for exactly what you use,
  6898. 4:11:08literally by the second with absolutely
  6899. 4:11:10zero upfront commitment. Think of
  6900. 4:11:13ondemand like booking a luxury hotel
  6901. 4:11:15room at the very last minute. You walk
  6902. 4:11:17in, you pay the premium nightly rate,
  6903. 4:11:19and you can leave whenever you want. You
  6904. 4:11:21have total freedom. But what happens if
  6905. 4:11:23you stay in that same hotel for three
  6906. 4:11:25years? You go completely broke. On
  6907. 4:11:27demand is the most expensive pricing
  6908. 4:11:29model on AWS. you really only use on
  6909. 4:11:32demand for unpredictable workloads,
  6910. 4:11:34maybe brand new applications or
  6911. 4:11:35short-term testing where you absolutely
  6912. 4:11:36need that extreme flexibility. Next up,
  6913. 4:11:39we have reserved instances and savings
  6914. 4:11:42plans. Now, what if you know you need a
  6915. 4:11:44server running 24/7 for a production
  6916. 4:11:46database? Well, in that case, you commit
  6917. 4:11:49to AWS for a 1-year or a 3-year term.
  6918. 4:11:52And in exchange for that commitment, AWS
  6919. 4:11:54gives you a massive discount. We're
  6920. 4:11:56talking sometimes up to 72%.
  6921. 4:11:59Think of a reserved instance kind of
  6922. 4:12:01like signing a one-year lease on an
  6923. 4:12:02apartment. Sure, you lose the freedom to
  6924. 4:12:04just walk away tomorrow, but your daily
  6925. 4:12:06cost drops drastically. Think about that
  6926. 4:12:08for a second. Oh, now I get it. On
  6927. 4:12:12demand is for flexibility. Reserved is
  6928. 4:12:15for predictable baseline workloads. But
  6929. 4:12:18here's where people fail. This is the
  6930. 4:12:20big trap. They think they must choose
  6931. 4:12:22just one pricing model for their entire
  6932. 4:12:24system. You really don't. But before we
  6933. 4:12:27talk about combining them, we need to
  6934. 4:12:28introduce the wild card spot instances.
  6935. 4:12:32AWS has massive global data centers and
  6936. 4:12:35at any given moment, thousands of
  6937. 4:12:36servers are just sitting there
  6938. 4:12:38completely empty. AWS obviously wants to
  6939. 4:12:40make money on them, so they auction them
  6940. 4:12:42off as spot instances at up to a 90%
  6941. 4:12:45discount. But there is a catch, a
  6942. 4:12:48massive system breaking catch. If a
  6943. 4:12:51full-paying on-demand customer suddenly
  6944. 4:12:53needs that capacity, AWS will take your
  6945. 4:12:56spot server away from you. They give you
  6946. 4:12:58exactly a twominute warning and then
  6947. 4:13:00they ruthlessly terminate your instance.
  6948. 4:13:03Think of spot instances like flying on a
  6949. 4:13:05standby airline ticket. It is dirt
  6950. 4:13:07cheap, but if a full-paying business
  6951. 4:13:09traveler shows up at the gate, you get
  6952. 4:13:11kicked off the flight. Oh, now I get it.
  6953. 4:13:14You can only use spot instances for
  6954. 4:13:16workloads that can actually handle
  6955. 4:13:18sudden death. Now imagine applying this
  6956. 4:13:21to your own system. If you run your
  6957. 4:13:23primary e-commerce checkout database on
  6958. 4:13:25a spot instance and AWS reclaims it,
  6959. 4:13:28your entire company goes offline. Total
  6960. 4:13:30disaster. But what if you were running a
  6961. 4:13:32background task like say processing
  6962. 4:13:3510,000 uploaded images or rendering a
  6963. 4:13:37massive 3D video? Spot is a perfect fit
  6964. 4:13:40here. If a server dies, the job simply
  6965. 4:13:43pauses and another server picks it up
  6966. 4:13:44later and you just saved 90% on your
  6967. 4:13:47bill. This brings us right to the exact
  6968. 4:13:49trap you're going to see on the
  6969. 4:13:50solutions architect exam. They'll ask
  6970. 4:13:52you to design costoptimized compute
  6971. 4:13:54solutions. And the scenario will
  6972. 4:13:56describe a company running a flexible
  6973. 4:13:58fault tolerant batch processing job. And
  6974. 4:14:00they want the absolute lowest cost
  6975. 4:14:02possible. One of the multiplechoice
  6976. 4:14:04answers is going to say reserved
  6977. 4:14:06instances. That's a trap. Reserved
  6978. 4:14:09requires a one-year lock in for a job
  6979. 4:14:11that might only run for a few hours.
  6980. 4:14:13Another answer will say spot instances.
  6981. 4:14:16That right there is your golden ticket.
  6982. 4:14:19The moment you see the exact trigger
  6983. 4:14:21words, fault tolerant, flexible start
  6984. 4:14:23and end times, or can withstand
  6985. 4:14:24interruptions, your brain needs to
  6986. 4:14:26instantly lock on to spot instances.
  6987. 4:14:29Conversely, if the question describes a
  6988. 4:14:31missionritical legacy database that
  6989. 4:14:33cannot experience any downtime and will
  6990. 4:14:35run continuously for 3 years and you
  6991. 4:14:37pick spot, you failed. Spot equals
  6992. 4:14:39failure there. You strictly need
  6993. 4:14:41reserved instances for that. All right,
  6994. 4:14:43let's lock this final summary in. On
  6995. 4:14:45demand is expensive, but it gives you
  6996. 4:14:47ultimate flexibility. Reserved instances
  6997. 4:14:50give you massive discounts in exchange
  6998. 4:14:52for a long-term commitment. And spot
  6999. 4:14:54instances offer extreme discounts for
  7000. 4:14:56interruptible, fault tolerant workloads.
  7001. 4:14:59So use on demand for traffic spikes and
  7002. 4:15:01unpredictable testing. Use reserve for
  7003. 4:15:03your steady, predictable baseline. And
  7004. 4:15:06use spot for background batch processing
  7005. 4:15:08and big data. I'll leave you with this
  7006. 4:15:10final warning. Never ever put a
  7007. 4:15:13stateful, missionritical database on a
  7008. 4:15:15spot instance. Master these pricing
  7009. 4:15:17models and you don't just pass domain 4.
  7010. 4:15:20You literally save your company
  7011. 4:15:21millions. So ask yourself, which of your
  7012. 4:15:24current servers is secretly draining
  7013. 4:15:26your budget right now? Imagine paying a
  7014. 4:15:28full-time salary to a team of 100
  7015. 4:15:31workers, but every single day 90 of them
  7016. 4:15:34are literally sleeping at their desks. I
  7017. 4:15:36mean, in the real world, you get fired
  7018. 4:15:38for that. But in the cloud, this is
  7019. 4:15:40exactly what happens when you don't
  7020. 4:15:42optimize your compute architecture. You
  7021. 4:15:44just burn thousands of dollars on idle
  7022. 4:15:46servers and your company bleeds cash.
  7023. 4:15:48Now, if you're studying for domain 4 of
  7024. 4:15:49the AWS solutions architect exam, you
  7025. 4:15:52absolutely have to know how to design
  7026. 4:15:54cost optimized architectures. So, in
  7027. 4:15:56this explainer, let's dive into exactly
  7028. 4:15:58how we stop the bleeding in real world
  7029. 4:16:00systems. Compute cost optimization,
  7030. 4:16:02which is really just how much you pay
  7031. 4:16:04for the brain power of your servers,
  7032. 4:16:06comes down to one main thing. paying
  7033. 4:16:08only for the exact computing power you
  7034. 4:16:11actually use. Back in traditional data
  7035. 4:16:13centers, you had to buy servers for your
  7036. 4:16:15absolute peak traffic. If Black Friday
  7037. 4:16:17was your busiest day, well, you bought
  7038. 4:16:19servers for Black Friday and you just
  7039. 4:16:21left them plugged in for the other 364
  7040. 4:16:23days of the year. In AWS, if you do
  7041. 4:16:26that, you fail. To fix this, we rely on
  7042. 4:16:28three core strategies. Step one, right
  7043. 4:16:31sizing, step two, elasticity, and step
  7044. 4:16:34three, modernization. Let's break these
  7045. 4:16:37down to their simplest forms. Okay,
  7046. 4:16:39first up, right sizing. AWS gives you
  7047. 4:16:42over 600 EC2 instance types to choose
  7048. 4:16:44from. You've got compute optimized,
  7049. 4:16:46memory optimized, storage optimized.
  7050. 4:16:48Making the right choice here is
  7051. 4:16:50absolutely critical. Think of right
  7052. 4:16:52sizing kind of like renting a vehicle.
  7053. 4:16:54If you need to move a couch, you rent a
  7054. 4:16:56pickup truck. If you need to move 50
  7055. 4:16:57people, you rent a bus. If you rent a
  7056. 4:16:59massive tour bus just to move one single
  7057. 4:17:01couch, you're just wasting money. AWS
  7058. 4:17:04Elastic Compute Cloud or EC2 works the
  7059. 4:17:07exact same way. If your application
  7060. 4:17:09needs a massive amount of memory or RAM,
  7061. 4:17:11but barely even touches the processor,
  7062. 4:17:13you don't buy a giant general purpose
  7063. 4:17:15server. You select a specific memory
  7064. 4:17:18optimized instance family. You have to
  7065. 4:17:20match the exact server type to the exact
  7066. 4:17:22workload. So, what happens if you don't
  7067. 4:17:25do this? Well, you end up with 5% CPU
  7068. 4:17:27utilization on a massive instance and an
  7069. 4:17:29AWS bill that makes you literally want
  7070. 4:17:31to cry. Next, we have elasticity. This
  7071. 4:17:34is your ability to scale horizontally
  7072. 4:17:36and vertically based on traffic. Think
  7073. 4:17:39about that for a second. Vertical
  7074. 4:17:41scaling is upgrading to a bigger server.
  7075. 4:17:43Horizontal scaling is when traffic
  7076. 4:17:44spikes and your autoscaling group
  7077. 4:17:46automatically adds more servers to
  7078. 4:17:48handle the load. But here is the
  7079. 4:17:50critical rule. When traffic drops, you
  7080. 4:17:53absolutely must scale in. You have to
  7081. 4:17:56terminate those extra instances. If you
  7082. 4:17:58only ever scale out and you never scale
  7083. 4:18:00in, you aren't elastic. You are just
  7084. 4:18:02expensive. Now, AWS also gives us this
  7085. 4:18:06incredible feature called EC2
  7086. 4:18:08hibernation. Imagine you have a complex
  7087. 4:18:10server that takes, say, 10 minutes to
  7088. 4:18:12boot up. You don't want to shut it down
  7089. 4:18:13completely, but you also don't want to
  7090. 4:18:15pay for it while it sits idle overnight.
  7091. 4:18:17With hibernation, it's basically like
  7092. 4:18:18closing the laptop lid. AWS saves the
  7093. 4:18:21contents of your RAM directly to your
  7094. 4:18:22hard drive and stops the instance, so
  7095. 4:18:24you stop paying for the hourly compute.
  7096. 4:18:26And when you need it again, you wake it
  7097. 4:18:28up and it springs back to life
  7098. 4:18:29instantly. Oh, this leads us to a
  7099. 4:18:32massive realization. You know, you don't
  7100. 4:18:35just optimize by finding cheaper
  7101. 4:18:37servers. You optimize by turning them
  7102. 4:18:39off the split second they aren't needed.
  7103. 4:18:41Now, listen up because here's where
  7104. 4:18:43people totally fail this. They spend
  7105. 4:18:45weeks trying to negotiate better pricing
  7106. 4:18:48using AWS Cost Explorer. They go out and
  7107. 4:18:50buy three-year reserved instances or
  7108. 4:18:53savings plans for servers that are
  7109. 4:18:55massively oversized. Listen, do not buy
  7110. 4:18:58a discount on waste. If you do, you're
  7111. 4:19:00going to be locked into paying for
  7112. 4:19:02unused capacity for three whole years.
  7113. 4:19:05You have to eliminate the waste first
  7114. 4:19:07using right sizing and then you buy the
  7115. 4:19:09discount. Strategy three, modernization.
  7116. 4:19:12Eliminate guesswork through serverless
  7117. 4:19:14and containers. What if you could
  7118. 4:19:16eliminate that guesswork entirely? No
  7119. 4:19:18more picking instance sizes. No more
  7120. 4:19:20managing autoscaling groups. Imagine
  7121. 4:19:23this in your system. Instead of renting
  7122. 4:19:24the EC2 bus or the EC2 truck, what if
  7123. 4:19:27you just paid a delivery service exactly
  7124. 4:19:29per mile? Well, that is AWS Lambda and
  7125. 4:19:32AWS Fargate. If you have an
  7126. 4:19:34unpredictable, highly variable workload,
  7127. 4:19:36you rip it off EC2. You move the code to
  7128. 4:19:38Lambda. Now you're paying strictly per
  7129. 4:19:40millisecond. If no one uses your app,
  7130. 4:19:42you pay 0. Which means the ultimate
  7131. 4:19:44paradox of cloud computing is this. The
  7132. 4:19:47ultimate compute optimization is not
  7133. 4:19:49having any servers to manage it all. So
  7134. 4:19:51how do you actually decide? Well, if you
  7135. 4:19:53have a strict legacy application that
  7136. 4:19:55needs specific operating system tweaks,
  7137. 4:19:57you put it on EC2. You rightsize the
  7138. 4:19:59instance family and you use aggressive
  7139. 4:20:01autoscaling. If you're building a modern
  7140. 4:20:03containerized microser and you want to
  7141. 4:20:05completely avoid server infrastructure
  7142. 4:20:07management, you go with AWS Fargate. And
  7143. 4:20:10if you have short, unpredictable,
  7144. 4:20:11event-driven tasks, you use AWS Lambda.
  7145. 4:20:14All right, here is the exact trap you
  7146. 4:20:17are going to see on the domain 4 exam.
  7147. 4:20:19The question will describe a cost
  7148. 4:20:20optimization scenario. It goes like
  7149. 4:20:22this. A company has an old legacy
  7150. 4:20:25monolithic application running on EC2.
  7151. 4:20:28The CPU is totally maxed out, but the
  7152. 4:20:30memory is barely touched and the prompt
  7153. 4:20:32will clearly state that the code cannot
  7154. 4:20:34be rewritten or modernized. What do you
  7155. 4:20:36do? One answer is going to suggest
  7156. 4:20:38migrating the app to AWS Lambda to save
  7157. 4:20:41costs. Do not fall for it. You cannot
  7158. 4:20:43magically drop a legacy monolith into
  7159. 4:20:45Lambda. Another answer will suggest
  7160. 4:20:47purchasing a savings plan immediately.
  7161. 4:20:50That is a trap. You are locking in a bad
  7162. 4:20:52architecture. Here is the solution. The
  7163. 4:20:55exact moment you see a mismatch CPU and
  7164. 4:20:57memory bottleneck on an unchangeable
  7165. 4:20:59app, your brain needs to instantly look
  7166. 4:21:01for the answer that suggests changing
  7167. 4:21:03the EC2 instance family to a compute
  7168. 4:21:05optimized size. Remember the golden
  7169. 4:21:07rule, right size first, commit later.
  7170. 4:21:10Let's lock this all in. Right sizing
  7171. 4:21:13matches the exact instance family to
  7172. 4:21:15your application's actual behavior.
  7173. 4:21:17Elasticity uses things like autoscaling
  7174. 4:21:19and hibernation to kill idle compute.
  7175. 4:21:21And serverless tools like Lambda and
  7176. 4:21:23Fargate, well, they eliminate
  7177. 4:21:25infrastructure management entirely and
  7178. 4:21:27charge you strictly for what you use. So
  7179. 4:21:30monitor your metrics to eliminate waste
  7180. 4:21:32before you even think about applying
  7181. 4:21:33discounts. Use autoscaling to
  7182. 4:21:36aggressively shut down unused capacity
  7183. 4:21:38and shift those unpredictable workloads
  7184. 4:21:40directly over to serverless. I'll leave
  7185. 4:21:43you with this final warning. If you
  7186. 4:21:45provision compute based on a guess
  7187. 4:21:47instead of actual data, you are
  7188. 4:21:49literally wasting money. So take a hard
  7189. 4:21:52look at your own architecture today. Ask
  7190. 4:21:55yourself what legacy applications are
  7191. 4:21:57silently draining your budget right now
  7192. 4:21:59and which of these three strategies will
  7193. 4:22:01you use to finally stop the bleeding?
  7194. 4:22:04Imagine you're running a healthcare app.
  7195. 4:22:06By law, you have to keep patient X-rays
  7196. 4:22:08for 7 years. So, you upload millions of
  7197. 4:22:10high-res images to Amazon S3. Everything
  7198. 4:22:13is running perfectly. But then 5 years
  7199. 4:22:16later, you look at your AWS bill and
  7200. 4:22:19your jaw just drops. You are paying
  7201. 4:22:21exactly $50,000 a month just to store
  7202. 4:22:25gigabytes of images that literally no
  7203. 4:22:27one has looked at since 2019. You are
  7204. 4:22:29burning cash on dead data. This is the
  7205. 4:22:33ultimate storage trap. We dump data into
  7206. 4:22:35the cloud and we just forget about it.
  7207. 4:22:37Listen, if you don't aggressively manage
  7208. 4:22:39where that data lives over time, your
  7209. 4:22:41AWS bill is going to spiral completely
  7210. 4:22:44out of control. So, in this explainer,
  7211. 4:22:46let me show you exactly how we stop the
  7212. 4:22:48bleeding using Amazon S3 life cycle
  7213. 4:22:50rules. When you first put a file in S3,
  7214. 4:22:53it goes into the S3 standard storage
  7215. 4:22:55class. It is incredibly fast and it is
  7216. 4:22:58highly available, but it is also the
  7217. 4:23:00most expensive place to put your data.
  7218. 4:23:03Think of S3 Standard like the front rack
  7219. 4:23:05of your closet. When you buy a brand new
  7220. 4:23:07winter coat, you hang it right in the
  7221. 4:23:09front, right? You wear it every single
  7222. 4:23:11day. But what happens when summer hits?
  7223. 4:23:13You don't throw the winter coat away.
  7224. 4:23:14You still need it, but you move it to a
  7225. 4:23:16box in the attic to save that premium
  7226. 4:23:18space. Well, AWS allows you to do the
  7227. 4:23:21exact same thing with your data using
  7228. 4:23:23storage tiers. First up, we have S3,
  7229. 4:23:26Standard Infrequent Access, or just S3IA
  7230. 4:23:29for short. This is the back of your
  7231. 4:23:31closet. S3A costs about half the price
  7232. 4:23:34of S3 standard. It's meant for data you
  7233. 4:23:36rarely use, like last month's database
  7234. 4:23:38backups. But here is the massive
  7235. 4:23:41trade-off. AWS charges you a data
  7236. 4:23:44retrieval fee every single time you open
  7237. 4:23:47a file in IIA. Think about that for a
  7238. 4:23:49second. If you move heavily accessed
  7239. 4:23:52website images into infrequent access
  7240. 4:23:54just to save on storage space, those
  7241. 4:23:56retrieval fees will absolutely explode.
  7242. 4:23:59Your bill will actually go up. When you
  7243. 4:24:01look at it this way, the core strategy
  7244. 4:24:03really clicks into place. Oh, now I get
  7245. 4:24:06it. I am trading storage costs for
  7246. 4:24:09access costs. Next, we have Amazon S3
  7247. 4:24:13Glacier. Glacier is the attic. It offers
  7248. 4:24:16a massive 90% discount on storage costs
  7249. 4:24:19compared to standard. It is dirt cheap.
  7250. 4:24:22Why? Because it is strictly for
  7251. 4:24:24long-term archiving. If you want to file
  7252. 4:24:26back from Glacier, you do not get it
  7253. 4:24:28instantly. You actually have to request
  7254. 4:24:30it. And AWS might take minutes or even
  7255. 4:24:33hours to retrieve it for you. No. Here's
  7256. 4:24:35where people completely fail this. They
  7257. 4:24:38try to move files between these tiers
  7258. 4:24:40manually. If you have 5 pabytes of user
  7259. 4:24:43uploads, you cannot hire an intern to
  7260. 4:24:45click move to Glacier every time a file
  7261. 4:24:47gets old. You need a robot to do it for
  7262. 4:24:50you. And that is exactly what a life
  7263. 4:24:52cycle rule is. A life cycle rule is just
  7264. 4:24:56a simple automated schedule that acts as
  7265. 4:24:58your dedicated storage robot. You just
  7266. 4:25:00tell AWS, hey, keep user uploads in
  7267. 4:25:03standard for 30 days. Then automatically
  7268. 4:25:07transition them to infrequent access.
  7269. 4:25:09After one year, transition them to
  7270. 4:25:11Glacier and after seven years,
  7271. 4:25:13permanently delete them. Once you set
  7272. 4:25:14that rule, you just walk away. AWS
  7273. 4:25:17executes it perfectly forever and your
  7274. 4:25:20storage costs instantly plummet. Now,
  7275. 4:25:23here is the part that actually matters
  7276. 4:25:24for your AWS exam and your real world
  7277. 4:25:26architecture. What if you have
  7278. 4:25:28absolutely no idea what your access
  7279. 4:25:30patterns are? I mean, what if a file is
  7280. 4:25:33dead for a whole year and then a random
  7281. 4:25:34user goes viral and suddenly that file
  7282. 4:25:36is downloaded a million times in one
  7283. 4:25:38day? If that file was sitting in
  7284. 4:25:40infrequent access, those retrieval fees
  7285. 4:25:42would bankrupt you. If it was in
  7286. 4:25:44Glacier, the app would literally crash
  7287. 4:25:45waiting for the file to thaw. So, how do
  7288. 4:25:49we solve unpredictable traffic? We use
  7289. 4:25:52S3 intelligent tiering. Intelligent
  7290. 4:25:54taring uses machine learning to monitor
  7291. 4:25:56your files. If nobody touches a file for
  7292. 4:25:5830 days, AWS automatically moves it to
  7293. 4:26:01the cheaper tier. And the absolute best
  7294. 4:26:03part, zero retrieval fees. But the split
  7295. 4:26:06second a user requests that file, AWS
  7296. 4:26:08instantly bumps it back to the standard
  7297. 4:26:10tier so you don't get penalized. So here
  7298. 4:26:12is your golden rule of thumb to
  7299. 4:26:14remember. Oh, now I get it. Life cycle
  7300. 4:26:17rules are for predictable aging.
  7301. 4:26:19Intelligent taring is for unpredictable
  7302. 4:26:21chaos. Here is the exact trap you're
  7303. 4:26:24going to see on the exam. The scenario
  7304. 4:26:26will describe a company storing massive
  7305. 4:26:28amounts of data. The prompt will
  7306. 4:26:30explicitly state that the engineering
  7307. 4:26:31team has unknown or unpredictable access
  7308. 4:26:34patterns, but they still want to
  7309. 4:26:36optimize costs. One of the multiple
  7310. 4:26:38choice answers will suggest creating a
  7311. 4:26:40life cycle rule to move data to
  7312. 4:26:42infrequent access after 30 days. Do not
  7313. 4:26:45fall for it. You cannot write a static
  7314. 4:26:47rule for unpredictable data. The moment
  7315. 4:26:49you see the words unpredictable access,
  7316. 4:26:52changing access patterns, or unknown
  7317. 4:26:54traffic, your brain needs to immediately
  7318. 4:26:56lock on to S3 intelligent tearing. All
  7319. 4:26:59right, let's lock this in. S3 standard
  7320. 4:27:02is for hot daily data. Infrequent access
  7321. 4:27:05cuts storage cost in half, but penalizes
  7322. 4:27:07you with retrieval fees. Glacier is for
  7323. 4:27:10deep archiving, where retrieval time
  7324. 4:27:12doesn't matter. Life cycle rules
  7325. 4:27:14automate the movement of data between
  7326. 4:27:16these tiers as it ages. You have to
  7327. 4:27:18match your storage tier to your actual
  7328. 4:27:20access frequency. So use standard life
  7329. 4:27:22cycle rules when your data ages
  7330. 4:27:24predictably. Use intelligent tiering
  7331. 4:27:26when your data access patterns are a
  7332. 4:27:28complete mystery. And here is my final
  7333. 4:27:30warning. If you put heavily access data
  7334. 4:27:32into infrequent access, your AWS bill
  7335. 4:27:34will punish you. Stop paying for
  7336. 4:27:36sleeping data. Automate your tears and
  7337. 4:27:38keep building. Which kind of makes you
  7338. 4:27:40wonder if you checked your own AWS
  7339. 4:27:41environment right now, how much dead
  7340. 4:27:43data is secretly draining your budget
  7341. 4:27:45today. Welcome back to the explainer.
  7342. 4:27:47Today we're diving straight into
  7343. 4:27:48elasticity and the art of financial
  7344. 4:27:51survival in AWS.
  7345. 4:27:53Imagine you throw a massive launch party
  7346. 4:27:55for your app. You go ahead and rent a
  7347. 4:27:57100 servers just to handle all that
  7348. 4:28:00incoming traffic. And guess what? The
  7349. 4:28:03launch is a huge hit. But the next
  7350. 4:28:06morning, the users are gone. and 99
  7351. 4:28:09servers are still running, charging you
  7352. 4:28:11by the hour while you just stare at a
  7353. 4:28:13zero traffic dashboard. Here's our road
  7354. 4:28:16map for today. We're going to cover the
  7355. 4:28:18idle server trap, mastering cloud
  7356. 4:28:20elasticity, the scalein failure, the EC2
  7357. 4:28:23hibernation strategy, avoiding the exam
  7358. 4:28:26trap, and finally locking in your
  7359. 4:28:28knowledge. Section one, the idle server
  7360. 4:28:31trap. Listen, if you kept all those
  7361. 4:28:33servers running, you would be bankrupt
  7362. 4:28:35by noon. In cloud computing, if you
  7363. 4:28:38don't master autoscaling for cost
  7364. 4:28:39control, you will literally burn
  7365. 4:28:41thousands of dollars on idle servers
  7366. 4:28:43because the cloud isn't just about
  7367. 4:28:45paying for what you use. It is about
  7368. 4:28:46automatically turning off what you stop
  7369. 4:28:48using. Section two, mastering cloud
  7370. 4:28:51elasticity.
  7371. 4:28:53AWS gives us two main scaling methods
  7372. 4:28:55for elastic workloads, vertical and
  7373. 4:28:58horizontal. Think of it like this.
  7374. 4:29:00Vertical scaling is like upgrading your
  7375. 4:29:02car's engine. You're just making one
  7376. 4:29:04single server bigger. Horizontal scaling
  7377. 4:29:07on the other hand is like adding a fleet
  7378. 4:29:08of identical cars to carry more
  7379. 4:29:10passengers. And AWS autoscaling that is
  7380. 4:29:13purely horizontal. It acts kind of like
  7381. 4:29:16an automated thermostat for your compute
  7382. 4:29:18power. When your app gets hot and
  7383. 4:29:20traffic spikes, the thermostat kicks in
  7384. 4:29:22and automatically spins up new servers.
  7385. 4:29:24This is what we call scaling out. Then
  7386. 4:29:27when the traffic cools down at night,
  7387. 4:29:29the thermostat shuts those extra servers
  7388. 4:29:31off. And this is called scaling in.
  7389. 4:29:33Think about that for a second. If you
  7390. 4:29:35only add servers when things get busy,
  7391. 4:29:37but you never actually delete them when
  7392. 4:29:39things slow down, you aren't elastic.
  7393. 4:29:42You are just expensive.
  7394. 4:29:44All right, now I get it. Autoscaling
  7395. 4:29:47isn't just a performance tool. It is
  7396. 4:29:49absolutely a financial survival tool.
  7397. 4:29:52Section three, the scale-in failure.
  7398. 4:29:55Now, here is where people completely
  7399. 4:29:57fail this. They set up an autoscaling
  7400. 4:30:00group. They configure the scale out
  7401. 4:30:01alarm and then they just walk away. Two
  7402. 4:30:04weeks later, their AWS bill totally
  7403. 4:30:06explodes. Why? Because they forgot to
  7404. 4:30:09configure the scalein policy. Your cloud
  7405. 4:30:12must be allowed to shrink. Section four,
  7406. 4:30:15EC2 hibernation strategy. Now, here's a
  7407. 4:30:17part that really matters. What if your
  7408. 4:30:19application is a massive legacy system?
  7409. 4:30:22What if it takes 10 minutes just to boot
  7410. 4:30:24up, load the caches, and get ready?
  7411. 4:30:26Well, if a server takes 10 minutes to
  7412. 4:30:28start, horizontal autoscaling is just
  7413. 4:30:30too slow. But you still don't want to
  7414. 4:30:32pay for it while it sits idle overnight.
  7415. 4:30:34Luckily, AWS gives us a brilliant
  7416. 4:30:37scaling strategy for this called EC2
  7417. 4:30:39hibernation. With hibernation, it's
  7418. 4:30:41literally like closing your laptop lid.
  7419. 4:30:44AWS saves the exact contents of your RAM
  7420. 4:30:46directly to your hard drive and stops
  7421. 4:30:48the instance. Because of this, you
  7422. 4:30:50immediately stop paying the hourly
  7423. 4:30:51compute charge, and when traffic
  7424. 4:30:53returns, you wake it up and it springs
  7425. 4:30:55back to life instantly, exactly where it
  7426. 4:30:57left off. That makes perfect sense,
  7427. 4:30:59right? You don't just optimize by
  7428. 4:31:00completely destroying servers. You
  7429. 4:31:02optimize by pausing them the split
  7430. 4:31:04second they aren't needed. Section five,
  7431. 4:31:07avoiding the exam trap. This brings us
  7432. 4:31:10to the exact trap you're going to see on
  7433. 4:31:12the AWS solutions architect exam. The
  7434. 4:31:16scenario will ask you to design a cost
  7435. 4:31:18optimized compute solution for an
  7436. 4:31:20elastic workload. It'll describe a
  7437. 4:31:22company with unpredictable traffic that
  7438. 4:31:24jumps randomly during the day and then
  7439. 4:31:26drops to near zero at night. One of the
  7440. 4:31:29multiple choice answers is going to
  7441. 4:31:30suggest you use an AWS purchasing option
  7442. 4:31:32like a reserved instance or a savings
  7443. 4:31:35plan. This is a trap. You do not buy a
  7444. 4:31:38permanent discount on servers you don't
  7445. 4:31:40even need at night. You are just locking
  7446. 4:31:41in waste and you definitely do not buy a
  7447. 4:31:43discount on waste. Now, another answer
  7448. 4:31:46will say configure an autoscaling group
  7449. 4:31:48to dynamically scale in and out. That
  7450. 4:31:51right there is your golden ticket. The
  7451. 4:31:54moment you see elastic workloads
  7452. 4:31:55combined with cost optimization, your
  7453. 4:31:57brain needs to instantly lock onto
  7454. 4:31:59horizontal autoscaling and scalein
  7455. 4:32:01policies. Section six, lock in your
  7456. 4:32:04knowledge. Let's lock this in.
  7457. 4:32:05Autoscaling matches your exact compute
  7458. 4:32:07capacity to your exact traffic demand.
  7459. 4:32:10Scaling out saves your performance while
  7460. 4:32:12scaling in saves your wallet. And
  7461. 4:32:14hibernation pauses those slow booting
  7462. 4:32:17instances so you don't pay for idle
  7463. 4:32:18time. Remember these rules. First,
  7464. 4:32:21always configure scale-in policies to
  7465. 4:32:23terminate idle servers. Second, use EC2
  7466. 4:32:27hibernation for slow booting legacy apps
  7467. 4:32:29instead of paying for idle time. And
  7468. 4:32:31third, never buy long-term server
  7469. 4:32:33commitments for highly unpredictable
  7470. 4:32:35spiky workloads. Final warning here. If
  7471. 4:32:38you provision your cloud compute based
  7472. 4:32:40on a guess instead of using dynamic
  7473. 4:32:42autoscaling, you are basically throwing
  7474. 4:32:44money into a fire. Master elasticity and
  7475. 4:32:47keep building. But ask yourself this, if
  7476. 4:32:50you checked your own AWS dashboard right
  7477. 4:32:52now, how many idle servers are silently
  7478. 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.