1 00:00:00,150 --> 00:00:02,060 ‫So now let's talk about Beanstalk. 2 00:00:02,060 --> 00:00:05,780 ‫So when we have deployed a web application in AWS, 3 00:00:05,780 --> 00:00:08,500 ‫we typically follow a architecture 4 00:00:08,500 --> 00:00:10,670 ‫called a three-tier architecture. 5 00:00:10,670 --> 00:00:13,760 ‫So our users talk to a load balancer 6 00:00:13,760 --> 00:00:16,080 ‫that could be in multiple availability zones. 7 00:00:16,080 --> 00:00:17,710 ‫Then the load balancer will forward traffic 8 00:00:17,710 --> 00:00:21,480 ‫to multiple EC2 instances managed by an auto scaling group. 9 00:00:21,480 --> 00:00:24,740 ‫And then these EC2 instances need to store data somewhere, 10 00:00:24,740 --> 00:00:27,040 ‫so they will use a database such as Amazon RDS 11 00:00:27,040 --> 00:00:29,950 ‫for relational database to read and write data. 12 00:00:29,950 --> 00:00:32,710 ‫And if they need to have an in-memory database 13 00:00:32,710 --> 00:00:34,140 ‫or an in-memory cache, 14 00:00:34,140 --> 00:00:35,842 ‫then they can also use elastic cache 15 00:00:35,842 --> 00:00:39,880 ‫to store and retrieve the session data or the cached data. 16 00:00:39,880 --> 00:00:41,680 ‫Now this architecture is something 17 00:00:41,680 --> 00:00:44,040 ‫we can easily reproduce manually. 18 00:00:44,040 --> 00:00:47,600 ‫We can also reproduce it on AWS through CloudFormation, 19 00:00:47,600 --> 00:00:48,970 ‫but there is a better way. 20 00:00:48,970 --> 00:00:51,130 ‫So when you're a developer on AWS, 21 00:00:51,130 --> 00:00:53,550 ‫you don't want to be managing infrastructure. 22 00:00:53,550 --> 00:00:55,840 ‫You just want to be deploying code, okay? 23 00:00:55,840 --> 00:00:57,560 ‫You don't wanna be able to configure 24 00:00:57,560 --> 00:00:59,800 ‫all databases, load balancers, et cetera. 25 00:00:59,800 --> 00:01:02,540 ‫And you wanna make sure that whatever you're doing scales. 26 00:01:02,540 --> 00:01:03,500 ‫And as we saw, 27 00:01:03,500 --> 00:01:05,490 ‫most web applications will have the same 28 00:01:05,490 --> 00:01:07,070 ‫or a similar architecture 29 00:01:07,070 --> 00:01:09,740 ‫with a load bouncer and an auto scaling group. 30 00:01:09,740 --> 00:01:11,770 ‫So as a developer on AWS, 31 00:01:11,770 --> 00:01:14,750 ‫all that you want to do is to run your code. 32 00:01:14,750 --> 00:01:16,620 ‫Possibly, you want to run your code 33 00:01:16,620 --> 00:01:19,760 ‫for different applications and environments the same way. 34 00:01:19,760 --> 00:01:22,480 ‫So there comes Elastic Beanstalk. 35 00:01:22,480 --> 00:01:24,890 ‫So Elastic Beanstalk is a developer centric view 36 00:01:24,890 --> 00:01:27,200 ‫of deploying an application on AWS. 37 00:01:27,200 --> 00:01:28,760 ‫So behind Beanstalk, 38 00:01:28,760 --> 00:01:31,020 ‫we have the same components we've seen before. 39 00:01:31,020 --> 00:01:33,790 ‫So your EC2 instances, your auto-scaling group, 40 00:01:33,790 --> 00:01:36,770 ‫your elastic load balancer, your RDS database, et cetera. 41 00:01:36,770 --> 00:01:39,170 ‫But in Beanstalk, it's a developer centric view, 42 00:01:39,170 --> 00:01:41,320 ‫so it's one view that's easy to make sense of 43 00:01:41,320 --> 00:01:42,670 ‫with everything in it. 44 00:01:42,670 --> 00:01:44,590 ‫And we still have control over the configuration 45 00:01:44,590 --> 00:01:48,700 ‫over all the components, but it is all within Beanstalk. 46 00:01:48,700 --> 00:01:52,010 ‫So Beanstalk from a cloud perspective 47 00:01:52,010 --> 00:01:54,423 ‫is a Platform as a Service or PaaS, 48 00:01:55,370 --> 00:01:57,520 ‫because we just worry about the code. 49 00:01:57,520 --> 00:01:58,770 ‫So to summarize, 50 00:01:58,770 --> 00:02:02,940 ‫we saw Infrastructure as a Service, so IaaS. 51 00:02:02,940 --> 00:02:06,620 ‫We saw Platform as a Service for Beanstalk, PaaS. 52 00:02:06,620 --> 00:02:09,340 ‫And then we're gonna see Software as a Service 53 00:02:09,340 --> 00:02:11,380 ‫for other services on AWS. 54 00:02:11,380 --> 00:02:12,900 ‫So using Beanstalk is free, 55 00:02:12,900 --> 00:02:16,230 ‫but you're going to pay for the underlying instances. 56 00:02:16,230 --> 00:02:18,760 ‫So let's take Beanstalk as a managed service. 57 00:02:18,760 --> 00:02:21,480 ‫That means that all the EC2 instance configuration 58 00:02:21,480 --> 00:02:24,910 ‫and operating system will be handled by Beanstalk itself. 59 00:02:24,910 --> 00:02:27,050 ‫The deployment strategy can be configured, 60 00:02:27,050 --> 00:02:28,680 ‫but again the deployment itself 61 00:02:28,680 --> 00:02:31,130 ‫is going to be performed by Elastic Beanstalk. 62 00:02:31,130 --> 00:02:34,030 ‫All the capacity provisioning through an auto scaling group 63 00:02:34,030 --> 00:02:36,700 ‫and load balancing are done by Beanstalk. 64 00:02:36,700 --> 00:02:39,820 ‫And the application health-monitoring and responsiveness 65 00:02:39,820 --> 00:02:42,620 ‫is also included in the Beanstalk dashboard. 66 00:02:42,620 --> 00:02:44,940 ‫So what is your responsibility as a developer? 67 00:02:44,940 --> 00:02:46,770 ‫Well, just the application code, 68 00:02:46,770 --> 00:02:48,080 ‫and that makes Elastic Beanstalk 69 00:02:48,080 --> 00:02:50,680 ‫a very developer friendly service. 70 00:02:50,680 --> 00:02:53,120 ‫There are three architecture models with Elastic Beanstalk. 71 00:02:53,120 --> 00:02:55,510 ‫The first one is single instance deployment, 72 00:02:55,510 --> 00:02:57,680 ‫which is good for development environment. 73 00:02:57,680 --> 00:02:58,810 ‫But if you wanna scale up, 74 00:02:58,810 --> 00:03:00,730 ‫you have a load balancer and an ASG 75 00:03:00,730 --> 00:03:01,940 ‫which is going to be great 76 00:03:01,940 --> 00:03:04,690 ‫for production or pre-production web applications. 77 00:03:04,690 --> 00:03:08,310 ‫And finally if you want to have none-web apps in production, 78 00:03:08,310 --> 00:03:09,423 ‫for example, workers, 79 00:03:10,430 --> 00:03:13,820 ‫you have an option to only have an auto scaling group 80 00:03:13,820 --> 00:03:14,653 ‫as a standalone. 81 00:03:15,610 --> 00:03:18,370 ‫Beanstalk can be used to support many platforms, 82 00:03:18,370 --> 00:03:23,370 ‫for example Go, Java, as well as .NET, Node.js, PHP, Python, 83 00:03:24,040 --> 00:03:27,310 ‫Ruby, Packer, Docker, Multi-Docker, 84 00:03:27,310 --> 00:03:28,550 ‫and pre-configured Docker. 85 00:03:28,550 --> 00:03:30,210 ‫And finally, if it's not supported, 86 00:03:30,210 --> 00:03:31,780 ‫you can write your own platform. 87 00:03:31,780 --> 00:03:33,120 ‫You don't need to remember this for the exam. 88 00:03:33,120 --> 00:03:33,953 ‫But as you can see, 89 00:03:33,953 --> 00:03:37,190 ‫Beanstalk supports a lot of ways to deploy your application, 90 00:03:37,190 --> 00:03:40,150 ‫including Docker and many programming languages. 91 00:03:40,150 --> 00:03:42,290 ‫Finally, a question that may come up in the exam 92 00:03:42,290 --> 00:03:43,870 ‫is around health monitoring. 93 00:03:43,870 --> 00:03:46,990 ‫So Beanstalk does have a full monitoring suite available 94 00:03:46,990 --> 00:03:48,690 ‫within the service itself. 95 00:03:48,690 --> 00:03:50,540 ‫And so there's going to be health agents 96 00:03:50,540 --> 00:03:52,113 ‫on each EC2 instance within Beanstalk 97 00:03:52,113 --> 00:03:54,390 ‫that is going to push metrics to CloudWatch. 98 00:03:54,390 --> 00:03:56,940 ‫And then within Beanstalk, you can view these metrics, 99 00:03:56,940 --> 00:03:58,410 ‫do some monitoring, and so on. 100 00:03:58,410 --> 00:04:00,520 ‫But it also check for application health, 101 00:04:00,520 --> 00:04:01,680 ‫and will publish health events. 102 00:04:01,680 --> 00:04:03,250 ‫So these are just a bunch of screenshots 103 00:04:03,250 --> 00:04:06,300 ‫that I've gotten to really show you that Beanstalk 104 00:04:06,300 --> 00:04:08,430 ‫is a way to do health monitoring for your applications. 105 00:04:08,430 --> 00:04:11,040 ‫So now I really want to give you an idea 106 00:04:11,040 --> 00:04:12,670 ‫of how elastic Beanstalk works. 107 00:04:12,670 --> 00:04:13,900 ‫So I will see you in the next lecture 108 00:04:13,900 --> 00:04:16,150 ‫for the hands-on to give you a concrete demo.