官术网_书友最值得收藏!

Concepts and terminologies

Here's a look at some of the common concepts and terminologies that you will often come across while working with Elastic Beanstalk:

  • Applications: An application in Elastic Beanstalk is basically a collection of Beanstalk's internal components, and includes environments, versions, events, and various other things. Think of an Elastic Beanstalk application as a high-level container which contains different aspects of your application.
  • Application versions: Application versions are nothing more than different versions of an application's code. Each version of your application's code is stored in an S3 Bucket that is auto-created and managed by Beanstalk itself. You can create multiple versions of your application code and use this for deployment to one or more environments for testing and comparison.
  • Environments: An Elastic Beanstalk environment is yet another logical container that hosts one application version at a time on a specified set of instances, load balancers, auto scaling groups, and so on. Typically, you would have an environment for development, one for acceptance testing, and another one for production hosting, however, there are no hard and fast rules on this.

An environment comes in two flavors, and you can choose between the two during your initial environment setup phase. The first is called a web server environment, and is basically created for applications that support HTTP requests, such as web applications and so on. The second is called a worker environment, where the application pulls tasks from an Amazon SQS Queue. Here's a look at each of these flavors in a bit more detail:

  • Web server environment: As mentioned earlier, this particular environment is well suited to hosting and managing web frontend applications, such as websites, mobile applications, and so on. As part of this environment, Beanstalk provisions an internet-facing Elastic Load Balancer, an autoscaling group with some minimalistic configuration settings, and a small number of EC2 instances that contain your application code along with a pre-installed agent called Host Manager. The Host Manager agent is a key component in the entire setup process, as it is responsible for deploying and monitoring the application as well as periodically patching the instance and rotating the logs.

Here's a representational diagram depicting a simple application being scaled using a web server environment. Note the RDS instance in the diagram as well. You can also choose to set up an RDS instance for your application using Elastic Beanstalk, or add it to the application stack manually later:

An additional point worth mentioning here is that every environment has a unique CNAME, for example mywordpress. The CNAME maps to a URL which is in the form of mywordpress.us-east-1.elasticbeanstalk.com. This URL is aliased in Amazon's DNS service Route53 to an Elastic Load Balancing URL, something like abcdef-123456.us-east-1.elb.amazonaws.com, by using a CNAME record.

  • Worker environment: The worker environment works in a very different way to the web server environment. In this case, Elastic Beanstalk starts up an SQS Queue in your environment and installs a small daemon into each of the worker instances. The daemon is responsible for regularly polling the queue for newer messages, and if a message is present, the daemon pulls it into the worker instance for consumption, as depicted in the following diagram:

Ideally, you can use a combination of web and worker environments to host your applications, so that there is a clear decoupling of your web frontend resources and your backend processing worker instances. Keep in mind that there are a lot more design considerations that you also ought to think about while setting up your environments, such as how the scalability is going to be handled and storage options for data depending on the type of data, for example S3 for logs and RDS for application-centric data, security, fault tolerance, and much more.

With this section completed, let's move on to the fun part and see how to get started with using Elastic Beanstalk!

主站蜘蛛池模板: 南郑县| 南昌市| 泉州市| 香港 | 电白县| 慈溪市| 景泰县| 连平县| 深圳市| 仁怀市| 沙坪坝区| 阳高县| 仁布县| 深圳市| 博客| 乐平市| 酒泉市| 五常市| 临澧县| 海阳市| 类乌齐县| 曲周县| 楚雄市| 湘乡市| 句容市| 赫章县| 通河县| 广东省| 张掖市| 营口市| 肃南| 建瓯市| 湖州市| 贺州市| 古交市| 西藏| 景宁| 博野县| 昌黎县| 禹州市| 平江县|