397

What is the difference between EC2 and Beanstalk? I want to know regarding SaaS, PaaS and IaaS.

To deploy a web application in Wordpress I need a scalable hosting service. If there anything better than my purpose, please let me know as well.

FYI - I want to host and deploy multiple Wordpress and Drupal sites.

I do not want to give more time for the server and focus on development. But the cloud hosting needs to be auto scalable.

desertnaut
  • 57,590
  • 26
  • 140
  • 166
Ahmad Ismail
  • 11,636
  • 6
  • 52
  • 87
  • 96
    I don't see how this is an opinion based question. There are definite differences between EC2 and ELB. They must have been designed to fill different niches or else why would AWS have them both? I think there is a place on this site for comparing and contrasting the two technologies. This shouldnt have been closed. – Jeff Apr 13 '15 at 17:16
  • 34
    "What's the difference between EC2 and Elastic Beanstalk" is definitely not an option-based question or answer. – Jason Swett Aug 25 '15 at 16:47
  • 40
    The bots running stack exchange need upgrades. This is not a coke-or-pepsi opinion question. – lonstar Jan 11 '16 at 22:29
  • 10
    @Ahmmad Ismail I guess a better title could have helped, like "Difference between EC2 and EB" rather than "EC2 vs EB". Anyway, asking for differences between two solutions is clearly not "opinion biased". – Balmipour May 13 '16 at 09:28
  • 9
    @Balmipour Excellent suggestion. And clearly _not_ opinion based. – sargas Oct 29 '16 at 03:06
  • 1
    Anyone wanna put this up for review? The opinion status is silly – Skyler May 07 '18 at 19:13
  • 4
    This is definitely not an opinion-based Q&A. It looks like the moderators haven't even read the question/answers before closing it as opinion-based. – Rodrigo May 26 '18 at 21:04

3 Answers3

428

First off, EC2 and Elastic Compute Cloud are the same thing.

Next, AWS encompasses the range of Web Services that includes EC2 and Elastic Beanstalk. It also includes many others such as S3, RDS, DynamoDB, and all the others.

EC2

EC2 is Amazon's service that allows you to create a server (AWS calls these instances) in the AWS cloud. You pay by the hour and only what you use. You can do whatever you want with this instance as well as launch n number of instances.

Elastic Beanstalk

Elastic Beanstalk is one layer of abstraction away from the EC2 layer. Elastic Beanstalk will setup an "environment" for you that can contain a number of EC2 instances, an optional database, as well as a few other AWS components such as a Elastic Load Balancer, Auto-Scaling Group, Security Group. Then Elastic Beanstalk will manage these items for you whenever you want to update your software running in AWS. Elastic Beanstalk doesn't add any cost on top of these resources that it creates for you. If you have 10 hours of EC2 usage, then all you pay is 10 compute hours.

Running Wordpress

For running Wordpress, it is whatever you are most comfortable with. You could run it straight on a single EC2 instance, you could use a solution from the AWS Marketplace, or you could use Elastic Beanstalk.

What to pick?

In the case that you want to reduce system operations and just focus on the website, then Elastic Beanstalk would be the best choice for that. Elastic Beanstalk supports a PHP stack (as well as others). You can keep your site in version control and easily deploy to your environment whenever you make changes. It will also setup an Autoscaling group which can spawn up more EC2 instances if traffic is growing.

Here's the first result off of Google when searching for "elastic beanstalk wordpress": https://www.otreva.com/blog/deploying-wordpress-amazon-web-services-aws-ec2-rds-via-elasticbeanstalk/

Nam G VU
  • 33,193
  • 69
  • 233
  • 372
Josh Davis
  • 6,651
  • 2
  • 25
  • 25
  • buddy i just modified my question according to your solution, can you please look at the changes and enlighten me further. – Ahmad Ismail Sep 21 '14 at 06:29
  • 8
    Just to be clear, you mean you want to spend more time on development rather than configuring servers and everything like that? – Josh Davis Sep 21 '14 at 06:31
  • yes, want to deploy multiple wordpress sites on cloud for scalability. Do not want to spend more time on server. – Ahmad Ismail Sep 21 '14 at 06:32
  • I would like to note that in the meantime there is also [Amazon EC2 Container Service](https://aws.amazon.com/ecs/). But unfortunately I can't tell the difference to Beanstalk. – Udo G Mar 07 '16 at 08:16
  • 13
    It's a common pattern these days for companies to build Docker images of their applications and deploy those to a container management tool (Kubernetes, Mesos, Docker Swarm) running on a pool of EC2 instances. EC2 Container Service is Amazon's managed replacement for running your own Mesos cluster. It's a good solution if you're running multiple applications, and simplifies management and billing. If you're running a single application, unless you just like the Dockerized model, Beanstalk is a better option. – Dathan Oct 02 '16 at 18:16
  • 7
    @JoshDavis To clarify your point at "Elastic Beanstalk doesn't add any cost on top of these resources that it creates for you", I would like to quote this "In fact, you aren't charged for Beanstalk itself--you are charged for the AWS resources you're using, such as S3, SNS, and EC2." from https://serverfault.com/a/401465/41015 – Nam G VU Apr 27 '17 at 09:10
  • 15
    Its a sad when the Amazon themselves cant explain their own products clearly. But it's true, they can't. – Epirocks Sep 15 '17 at 12:36
  • @NamGVU Thanks for clarifying. Although I think both sentences are clear but if your clarification helps someone, then that's great. – Josh Davis Nov 06 '17 at 20:30
  • if you are making a test and want it to keep totally free even if many users suddenly use your web, would just ec2.t2 be better? – Mr-Programs Jan 25 '19 at 03:07
  • If beanstalk is better and creates EC2 instances, then why EC2 option remains for juniors to struggle with it. Why can't they shut down EC2 options and just let users deal with beanstalk that creates EC2 on the background? – Ephra May 06 '20 at 09:54
  • 4
    @Ephra dude, they leave EC2 because not everybody wants a preconfigured server, some enterprises prefer configure the servers themselves, due to security, automation reasons etc. – Sergio Gutiérrez Oct 21 '20 at 08:25
  • 1
    @Ephra also, EC2 instances are VMs. A VM can be used for anything and is the most flexible system. They can be used as build agents, site hosts, peach tree servers, docker hosts, game servers, and anything else a vm (or computer/server) is used for. All the other offerings are layers of abstractions above this. EBS uses EC2 under the hood and you can even log onto the used ec2 instnaces. ECS will spin up EC2 instances to run the containers on. Time is money and if the abstractions works for you then that is money saved. If you are fighting the abstraction(s) then you can do it yourself. – xtreampb Mar 02 '21 at 16:32
3

EC2

This service allows you to provision cloud instances. You can connect to the instance to run your workloads and is generally ideal for development work. Eg. You want to run a high end simulation which requires a powerful Gpu.

Elastic Beanstalk

This is a whole environment, meaning you can have multiple instances. It is ideal for hosting web applications. Beanstalk comes with autoscalers which can automatically scale according to the demand. Basically it gives all the advantages of cloud like scalability, security and reliability to your app.
The primary difference between the two services is that Beanstalk will manage the instance for you. Eg. If you provision a g34x large, and you need a bigger instance cause your workload suddenly increased, beanstalk will scale accordingly. But with EC2 you have to manually modify the configuration. Similarly it can also scale down if there is less network traffic. These settings are configurable.
vaibhavsahu
  • 612
  • 2
  • 7
  • 19
Harsha Reddy
  • 391
  • 5
  • 8
2

For a High level overview, EC2 Is an IaaS compute service; meaning the compute resources are generally managed by the cloud engineer that provisioned them

While Elastic Beanstalk is PaaS where you don't have to border too much about resource management. You just specify what you want and aws handles the task, by automation. For example provisioning a LAMP stack

  • 1
    EC2 is **not** infrastructure as code. It is "compute infrastructure on demand" which can be provisioned by IaC (like Terraform) but which can also be created manually (like through the AWS web interface) – Stephen Ostermiller Nov 18 '21 at 09:55
  • 1
    Oh it should be my keyboard changing my words. I meant iaas infrastructure as a service – Osemenkhian Godstime Nov 19 '21 at 13:01