‫Okay, so now let's talk about
‫Elastic Beanstalk.
‫So far in this course
‫when we've been deploying an application
‫we've had the same architecture.
‫So we have a load balancer
‫that is taking all the requests from our users,
‫and then we have an auto scanning group
‫with multiple availability zones.
‫And in each AZ there will be some EC2 instances
‫being deployed there.
‫And then in the backend we have maybe some data subnets.
‫So we have an RDS database to take the reads and the writes
‫maybe we'll have some read applications and so on.
‫And then if we communication layer,
‫we the cache layer we need to look at Elastic Cache.
‫So if there are so many applications for us to deploy
‫and they follow the same architecture
‫it may be a pain to recreate it every single time.
‫So as a developer it's complicated to manage infrastructure,
‫to deploy code.
‫We don't want to be configuring all the databases
‫the load balance, et cetera, et cetera.
‫And of course, we want everything to be scaling.
‫So as we can see, most of the web applications
‫will have the same architecture with a load balancer
‫and a auto scanning group.
‫And as a developer
‫all I want to do is for my code to run, okay?
‫I don't want to worry about everything else.
‫So also, if I develop in different programming languages
‫and have different applications and environments
‫I possibly want a single way of deploying my application.
‫And this is where Beanstalk comes into play.
‫So Beanstalk gives a developer-centric view
‫of deploying on application on AWS.
‫The idea is that from one single interface
‫it's going to reuse all the components
‫we've had seen before, such as EC2, ASG, ELB, RDS.
‫But it's going to be a managed service
‫that will deploy all these things for you.
‫So it will handle the capacity provisioning.
‫It will handle the configuration, the load balancer
‫the scaling, the application health monitoring,
‫the instance configuration, and so on.
‫And the only responsibility for you as a developer
‫is going to be the code itself, okay?
‫You still have full control
‫over the configuration of each component,
‫but at least become bundled as one single interface
‫in Beanstalk.
‫And the idea is that Beanstalk
‫also has a really cool way of updating applications.
‫So the Beanstalk service is free on its own
‫but you're going to pay for the underlying instances
‫that are going to be leveraged by Beanstalk or your ASG
‫or your ELB, this kind of things.
‫So components of Beanstalk consist of an application
‫which is a collection of Beanstalk components
‫such as environments, versions, and configurations.
‫A version of the application itself
‫is an iteration of your application code.
‫So you can have version one, version two
‫version three, et cetera, et cetera.
‫Then an environment which is a collection
‫of your resources running the specific application version.
‫So you can only have one application version at a time.
‫In an environment where we can see, we will see,
‫we can actually update an application version
‫within an environment from version one to version two.
‫We have tiers.
‫So we can have two different tiers in Beanstalk.
‫We have the web server environment here
‫and the worker environment here.
‫We'll see this very quickly.
‫And we can also create multiple environments in Beanstalk
‫such as dev, test and prod.
‫And whatever environment you have in mind, really.
‫So the process is to create an application.
‫Then we upload a version
‫then we are going to launch an environment
‫and then we're going to manage an environment life cycle.
‫And if you wanted to iterate on that
‫we could update the version by uploading a new version
‫and then deploy that new version again
‫in our environment to update our application stack.
‫So Beanstalk supports many program languages
‫such as Go Java SE, Java with Tomcat,
‫.NET Core on Linux, .NET Core on Windows Server,
‫Node.js, PHP, Python, Ruby, Packer Builder,
‫Single Docker Container, Multi Docker Container,
‫Preconfigured Docker.
‫And if your program language is not here
‫you can create your own custom platform, which is advanced.
‫So the idea is that on Beanstalk
‫you should be able to deploy pretty much anything.
‫Now to finish,
‫what do I mean by server tier and worker tier?
‫While the web tier is looking like this
‫this is the traditional architecture
‫that we know where we have a load answer.
‫And then it's sending traffic
‫to an autoscaling group that has multiple EC2 instances
‫that are going to be your web servers.
‫This is the architecture number one with Beanstalk.
‫And the architecture number two with Beanstalk
‫is going to be around a worker environment.
‫So this time there is no clients accessing directly
‫your EC2 instances.
‫We're going to use an SQS Queue, which is a message queue
‫and the message will be sent into the SQS Queue.
‫And the EC2 instances are gonna be workers
‫because they're going to pull messages
‫from the SQS Queue to process them.
‫And in this case the worker environment
‫is going to scale based on the number of SQS messages.
‫So the more messages, the more EC2 instances.
‫And then the cool thing
‫is that you can put the web environment
‫and the work environment together
‫by having the web environment push some messages
‫into the SQS Queue of the worker environment.
‫Finally, there are two deployment modes
‫you need to know for Beanstalk.
‫The first one is a single instance,
‫which is great for development purposes.
‫In this case, you'll have one EC2 instance
‫which will have an Elastic IP,
‫potentially you can also launch an RDS database and so on.
‫But it's all based on one instance with Elastic IP.
‫It's great for development purposes,
‫but then if you wanted to scale a real
‫Elastic Beanstalk mode
‫then you will go for high availability with low balancer
‫which is great for production environments,
‫in which case you can have a load balancer
‫distributing the loads across multiple EC2 instances
‫that are managed for an autoscaling group
‫and multiple availability zones.
‫And finally you may have an RDS database
‫that's also multi AZ with a Master and a Standby.
‫Alright, that's it.
‫I hope you liked it and I will see you in the next lecture.