Please use the menu below to navigate the article sections:
Which type of Amazon Server should you use for your next project? This is a question that often comes up. Amazon Web Services (AWS) provides several options for running compute services. You can run virtual servers in an Infrastructure as a Service (IaaS) model on Amazon EC2 and Amazon LightSail. You can run serverless compute functions on AWS Lambda and you can run Docker containers on Amazon ECS.
In this post, I want to discuss the virtual server options AWS provide. These are Amazon EC2 and Amazon LightSail. These services come at very different price points and have very different features sets. Each has its place for specific use cases and in this article, you’ll learn what to use and when.
Amazon Elastic Compute Cloud (EC2)
This is one of the oldest AWS services in existence and the premium option for Amazon Servers. With EC2 you can run a virtual server in the cloud on infrastructure that is managed by AWS for you. You can launch virtual servers, known as “instances”, using the Linux, Windows and MacOS operating systems.
When you launch an Amazon EC2 instance you must choose the operating system and instance type you want to use. The instance type determines the hardware profile of the server. There are many instance types to choose from with hardware ranging from 1 vCPU and 0.5 GB of RAM to 128 vCPUs and 1952 GB of RAM.
Amazon EC2 instances run in an Amazon Virtual Private Cloud (VPC). This is a virtual space that is dedicated to you in which you can create your own subnets and define your own IPv4 and IPv6 address blocks. The instances use either ephemeral “instance stores” for storage or Amazon Elastic Block Store (EBS) volumes. EBS volumes can range widely in performance characteristics up to extremely high-performance levels with 64,000 IOPS per volume.
This is definitely the premium Amazon Server option and it comes at a cost. However, with this cost comes a lot of features and flexibility:
- You are able to connect EC2 instances to many other services
- You have complete control over the security of your instances through Security Groups and Network ACLs
- You can keep your instances private with no public accessibility
- You are able to create multiple VPCs and subnet configurations to suit any requirements
- You can launch instances in different Availability Zones (essentially data centers) and AWS Regions – for high availability
If you need to automatically scale your workload and load balance connections, AWS have you covered there too. With EC2 you can leverage Amazon EC2 Auto Scaling which automatically launches and terminates instances for you based on how much load is being generated on your application. You can then place an Amazon Elastic Load Balancer in front of your instances to load balance incoming connection requests automatically between servers.
The diagram below depicts a highly available and fault-tolerant deployment of Amazon EC2 instances:
You can also backup your EC2 instances using snapshots and automated lifecycle management using the AWS Data Lifecycle Manager (DLM). You can even copy your EBS volumes between Availability Zones and AWS Regions if you need to move instances across different locations. Encryption can be enabled to secure your data at rest (it’s also encrypted in transit between EC2 instances and volumes). You also get advanced performance monitoring with Amazon CloudWatch and auditing with AWS CloudTrail.
For most production workloads Amazon EC2 is going to be the best choice for workloads that need to run on a Windows, Linux, or MacOS virtual server. You get huge amounts of features for building performant, secure, and highly available applications on AWS. Compared to on-premises costs EC2 can be very affordable and you pay only for what you use.
If you need an Amazon Server that’s easy to set up, easy to manage, and doesn’t require significant performance, Amazon LightSail could be the service for you! LightSail is essentially comparable to a virtual private server (VPS) solution that many hosting providers offer. It provides a simplified user interface with far fewer options compared to Amazon Ec2.
The graphic below describes some of the typical use cases for Amazon LightSail:
With Amazon LightSail you don’t have the flexibility, control, or power of Amazon EC2. This is not necessarily a weakness though, this is by design. LightSail is designed for users who do not have significant technical skills or who simply require a low cost, low-moderate performance virtual private server that they can run a workload on quickly and easily.
You can connect your LightSail servers to an Amazon VPC as well, which means you can connect to many other AWS services just as you can with EC2. This is achieved through something called VPC peering that allows you to connect to Amazon VPCs and 90+ AWS services.
There is also an option to enable a very simple load balancing solution. It does not offer the power and features of the Amazon Elastic Load Balancer family but can serve simple requirements. LightSail also offers a managed database solution for running MySQL and PostgreSQL databases that are fully configured for you.
LightSail is a cheap and easy solution to get your application or website up and running in a virtual private server environment. Though you miss out on many of the features and performance options of EC2 – it’s a great starting point. The good news is you can also migrate across to Amazon EC2 if your website takes off and you need more power.
If you’re currently investigating options for running servers on Amazon you can easily get started with an AWS Free Tier account. With the free tier, you get enough free compute capacity to run some test workloads on Amazon EC2 and learn about the features and capabilities it offers. You can also cost-effectively run test applications on LightSail with monthly costs starting at just a few dollars a month per VPS instance.