1 00:00:00,250 --> 00:00:01,510 Okay, so now let's talk about 2 00:00:01,510 --> 00:00:02,860 Elastic Beanstalk. 3 00:00:02,860 --> 00:00:04,120 So, so far in this course, 4 00:00:04,120 --> 00:00:06,480 when we've been deploying an application, 5 00:00:06,480 --> 00:00:08,490 we've had the same architecture. 6 00:00:08,490 --> 00:00:09,900 So we have a load balancer 7 00:00:09,900 --> 00:00:12,020 that is taking all the requests from our users, 8 00:00:12,020 --> 00:00:13,550 and then we have an auto scaling group 9 00:00:13,550 --> 00:00:15,900 with multiple availability zones. 10 00:00:15,900 --> 00:00:16,970 And in each AZ, 11 00:00:16,970 --> 00:00:19,510 there will be some EC2 instances being deployed there. 12 00:00:19,510 --> 00:00:22,790 And then in the backend, we have maybe some DATA subnets, 13 00:00:22,790 --> 00:00:24,430 so we have an RDS database. 14 00:00:24,430 --> 00:00:25,790 We take the reads and the writes. 15 00:00:25,790 --> 00:00:27,610 Maybe we'll have some root up you guys and so on. 16 00:00:27,610 --> 00:00:30,330 And then if we need a caching layer, we, the caching layer, 17 00:00:30,330 --> 00:00:32,140 we need to look at elastic cache. Okay. 18 00:00:32,140 --> 00:00:33,280 So they've, 19 00:00:33,280 --> 00:00:35,600 there are so many applications for us to deploy and they 20 00:00:35,600 --> 00:00:36,960 follow the same architecture. 21 00:00:36,960 --> 00:00:39,900 It may be a pain to recreate it every single time. 22 00:00:39,900 --> 00:00:41,170 So as a developer, 23 00:00:41,170 --> 00:00:43,130 it's complicated to manage infrastructure, 24 00:00:43,130 --> 00:00:44,620 to deploy code it don't, 25 00:00:44,620 --> 00:00:46,290 we don't want to be configuring all the databases, 26 00:00:46,290 --> 00:00:47,890 the load balancers, et cetera, et cetera. 27 00:00:47,890 --> 00:00:50,140 And of course we want everything to be scaling. 28 00:00:50,140 --> 00:00:51,760 So as we can see, 29 00:00:51,760 --> 00:00:54,000 most of the web applications will have the same architecture 30 00:00:54,000 --> 00:00:56,220 with a load balancer and an auto scaling group. 31 00:00:56,220 --> 00:00:57,440 And as a developer, 32 00:00:57,440 --> 00:00:59,700 all I want to do is for my code to run, okay? 33 00:00:59,700 --> 00:01:02,140 I don't want to worry about everything else. 34 00:01:02,140 --> 00:01:05,720 So, also if I develop in different programming languages and 35 00:01:05,720 --> 00:01:07,420 have different applications and environments, 36 00:01:07,420 --> 00:01:10,890 I possibly want a single way of deploying my application. 37 00:01:10,890 --> 00:01:13,490 And this is where Beanstalk comes into play. 38 00:01:13,490 --> 00:01:16,380 So Beanstalk is a developer centric view of 39 00:01:16,380 --> 00:01:18,900 deploying on application on AWS. 40 00:01:18,900 --> 00:01:22,090 The idea is that from one single interface is going to reuse 41 00:01:22,090 --> 00:01:23,680 all the components we've had seen before, 42 00:01:23,680 --> 00:01:27,100 such as EC2, ASG, ELB, RDS, 43 00:01:27,100 --> 00:01:29,470 but it's going to be a managed service that will deploy all 44 00:01:29,470 --> 00:01:30,400 these things for you. 45 00:01:30,400 --> 00:01:32,500 So it will handle the capacity provisioning. 46 00:01:32,500 --> 00:01:34,090 It will handle the configuration, load balancer, 47 00:01:34,090 --> 00:01:36,370 the scaling, the application, health monitoring, 48 00:01:36,370 --> 00:01:38,240 the instance configuration and so on. 49 00:01:38,240 --> 00:01:41,260 And the only responsibility for you as a developer is going 50 00:01:41,260 --> 00:01:43,190 to be the code itself. Okay. 51 00:01:43,190 --> 00:01:45,170 You still have full control over the configuration of each 52 00:01:45,170 --> 00:01:46,950 component, but at least it comes 53 00:01:46,950 --> 00:01:50,550 bundled as one single interface in Beanstalk and the idea 54 00:01:50,550 --> 00:01:52,770 is that Beanstalk also as a really cool way of updating 55 00:01:52,770 --> 00:01:56,100 applications. So the Beanstalk service is free on its own, 56 00:01:56,100 --> 00:01:58,520 but you're going to pay for the underlying instances that 57 00:01:58,520 --> 00:01:59,930 are going to be leveraged by 58 00:01:59,930 --> 00:02:03,330 Beanstalk or your ASG or your ELB, these kind of things. 59 00:02:03,330 --> 00:02:06,910 So components of Beanstalk consist of an application, 60 00:02:06,910 --> 00:02:08,610 which is a collection of Beanstalk components, 61 00:02:08,610 --> 00:02:11,710 which has environments, versions and configurations. 62 00:02:11,710 --> 00:02:14,590 A version of the application itself is an iteration of your 63 00:02:14,590 --> 00:02:16,710 application code. So you can have version one, version two, 64 00:02:16,710 --> 00:02:18,560 version three, et cetera, et cetera. 65 00:02:18,560 --> 00:02:21,360 Then an environment, it's just a collection of your 66 00:02:21,360 --> 00:02:24,370 resources running the specific application version. 67 00:02:24,370 --> 00:02:26,600 So you can only have one application version at a time in an 68 00:02:26,600 --> 00:02:29,200 environment where we can see, we will see, 69 00:02:29,200 --> 00:02:32,520 we can actually update an application version within an 70 00:02:32,520 --> 00:02:35,220 environment from version one to version two, we have tiers. 71 00:02:35,220 --> 00:02:36,870 So we can have two different tiers in Beanstalk. 72 00:02:36,870 --> 00:02:39,740 We have the web server environment tier and the worker 73 00:02:39,740 --> 00:02:41,900 environment tier, we'll see those very quickly. 74 00:02:41,900 --> 00:02:45,570 And we can also create multiple environments in Beanstalk, 75 00:02:45,570 --> 00:02:49,720 such as dev, test and prod and whatever environment you 76 00:02:49,720 --> 00:02:50,553 have in mind really. 77 00:02:50,553 --> 00:02:52,600 So the process is to create an application. 78 00:02:52,600 --> 00:02:54,300 Then we upload a version. 79 00:02:54,300 --> 00:02:56,590 Then we are going to launch an environment, 80 00:02:56,590 --> 00:02:58,760 and then we're going to manage the environment life cycle. 81 00:02:58,760 --> 00:03:00,270 And if you wanted to iterate on that, 82 00:03:00,270 --> 00:03:02,880 we could update the version by uploading a new version and 83 00:03:02,880 --> 00:03:04,380 then deploy that new version again 84 00:03:04,380 --> 00:03:07,610 in our environment to update our application stack. 85 00:03:07,610 --> 00:03:10,120 So Beanstalk supports many programming languages such as Go, 86 00:03:10,120 --> 00:03:13,077 Java SE, Java with Tomcat, .NET Core on Linux, 87 00:03:13,077 --> 00:03:15,410 .NET Core on Windows Server, Node.js, PHP, 88 00:03:15,410 --> 00:03:18,300 Python, Ruby, Packer Builder, Single Docker Container, 89 00:03:18,300 --> 00:03:20,670 Multi Docker Container, Preconfigured Docker. 90 00:03:20,670 --> 00:03:23,200 And if your programming language is not here, 91 00:03:23,200 --> 00:03:25,770 you can create your own custom platform, which is advanced. 92 00:03:25,770 --> 00:03:27,300 So the idea is that on Beanstalk, 93 00:03:27,300 --> 00:03:29,790 you should be able to deploy pretty much anything. 94 00:03:29,790 --> 00:03:30,623 Now to finish, 95 00:03:30,623 --> 00:03:33,610 what do I mean by server tier and worker tier, 96 00:03:33,610 --> 00:03:36,000 well the web tier is looking like this, 97 00:03:36,000 --> 00:03:38,000 this is the traditional architecture that we know. 98 00:03:38,000 --> 00:03:39,530 Well, we have a load balancer, 99 00:03:39,530 --> 00:03:42,790 and then it's sending traffic to an auto scaling group that 100 00:03:42,790 --> 00:03:44,240 has multiple EC2 instances that 101 00:03:44,240 --> 00:03:45,470 are going to be your web servers. 102 00:03:45,470 --> 00:03:48,120 This is the architecture number one with Beanstalk. 103 00:03:48,120 --> 00:03:50,050 And the architecture number two with Beanstalk is going 104 00:03:50,050 --> 00:03:52,180 to be around a worker environment. 105 00:03:52,180 --> 00:03:55,220 So this time there's no clients accessing directly your 106 00:03:55,220 --> 00:03:57,910 EC2 instances, we're going to use an SQS queue, 107 00:03:57,910 --> 00:03:59,480 which is a message queue, 108 00:03:59,480 --> 00:04:02,270 and the message will be sent into the SQS queue. 109 00:04:02,270 --> 00:04:04,640 And the EC2 instances are going to be workers because 110 00:04:04,640 --> 00:04:07,970 they're going to pull messages from the SQS queue to process 111 00:04:07,970 --> 00:04:08,803 them. 112 00:04:08,803 --> 00:04:10,160 And in this case, the, 113 00:04:10,160 --> 00:04:13,760 or the worker environment is going to scale based on the 114 00:04:13,760 --> 00:04:16,350 number of SQS messages. So the more messages, 115 00:04:16,350 --> 00:04:17,940 the more EC2 instances. 116 00:04:17,940 --> 00:04:20,180 And then the cool thing is that you can put the web 117 00:04:20,180 --> 00:04:22,720 environment and the work environment together by having the 118 00:04:22,720 --> 00:04:23,553 web environment 119 00:04:23,553 --> 00:04:26,610 push some messages into the SQS queue of the worker 120 00:04:26,610 --> 00:04:27,590 environment. 121 00:04:27,590 --> 00:04:29,150 So that's it for an overview of Beanstalk. 122 00:04:29,150 --> 00:04:31,623 I will see you in the next lecture for some hands-on.