344
votes

Can someone please explain 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.

2
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
"What's the difference between EC2 and Elastic Beanstalk" is definitely not an option-based question or answer.Jason Swett
The bots running stack exchange need upgrades. This is not a coke-or-pepsi opinion question.lonstar
I think it's an excellent question.ardochhigh
@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

2 Answers

373
votes

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/

4
votes

It’s the difference between Infrastructure as a Service (EC2) and Platform as a Service (Elastic Beanstalk).

With PaaS, you typically only manage an application and its data. With IaaS, you also manage the runtime environment for the application and the Operating System on which that environment runs.

With IaaS, you’re also much more involved in low-level decisions around network configuration, load balancing, and other ‘infrastructure’ components. In PaaS, these are abstracted away from you. For example, with PaaS, the decision to include load balancing is typically a checkbox (and not even that in some cases where it’s the default). With IaaS, you would have to configure and spin up these components yourself, connect them together, and manage them, by elasticsearch course

At the risk of grossly simplifying things, if you have a few developers and no sysadmins then you’d typically prefer PaaS. If you also have sysadmins then you might prefer IaaS as it gives you more choices, more granularity of control, and is likely to be cheaper.

In the diagram below, you manage the layers in teal while the service provider (AWS in this case) manages the layers in orange.