Elastic Compute Cloud (EC2)
Amazon Web Services (AWS) offers a variety of cloud computing services. Elastic Compute Cloud (EC2) is one of the most important elements in AWS because many services are derived from it. EC2 is similar to running virtual machines on the cloud. To get started on using AWS, you should first learn about EC2 instance types.
Instance types
EC2 instance types offers a combination of CPU, memory, storage and networking capacity.
For demo purpose, screen captures will be included for general purpose instances. For the selection of other instance types, please refer to AWS official documentation. You can also create a free AWS account to try them out.
#1) General purpose instances
Compute-optimized instances are balanced in terms of CPU, memory and networking configurations.
Examples:
T series instances commonly used for web applications and micro-services
M series instances suitable for application, gaming and simulation related workloads
Note that M series instances support higher network throughput compared to T series instances, as shown on the below screen capture.
Also, m5.metal type is available, which refers to a bare metal instance type. Bare metal instance means the system runs on the underlying hardware and has direct access to the hardware components – in order words, just like a typical physical server. This type of instance is useful for hosting applications which require direct access to the underlying hardware due to software design or licensing requirement.
Mac1 for development work related to Apple devices
#2) Compute-optimized instances
Compute-optimized instances are useful in scenarios where applications benefit from high compute processing power.
Examples:
C series instances typically for compute-intensive workloads such as video encoding, modeling and batch processing jobs
#3) Memory-optimized instances
Memory-optimized instances are suitable for database workload processing, which is typically memory intensive.
Examples:
R, X and Z series instances for MySQL and memcached services
#4) Storage-optimized instances
Resources running on storage-optimized instances benefit from higher storage I/O performance.
Examples:
D, H and I series instances for centralized log processing such as rsyslog service. They are also suitable for hosting distributed storage systems like GlusterFS, where multiple hosts access files on shared storage resources.
Other Tips
Tips #1: Selection of Instance Types
Check developer / software vendor suggestions in terms of the suggested instance types for hosting the required applications. You can find more information on AWS Marketplace and application documentations.
Tips #2: Selection of Amazon Machine Image (AMI)
You should select Amazon Machine Image (AMI) prior to choosing instance types. Note that AMIs can be originated from AWS official images, your images, AWS marketplace (typically crafted by software vendors), as well as Community versions. Their availability vary based on AWS region setting. As an example, macOS images are available on N. Virginia (us-east-1) but cannot be found on other regions such as Hong Kong (ap-east-1).
Tips #3: Processor Architecture of Instance Types
There are two mainstream processor architectures which you need to choose from when you select an instance type, namely 64-bit (x86) and Arm. You can only choose an instance type of a processor architecture that is compatible with your selected Operating System (OS). For instance, Ubuntu Server supports both x86 and Arm architecture. You must first decide on the architecture type when choosing an Ubuntu Server AMI. Afterwards, only compatible EC2 instance types can be selected on the web console.
Conclusion
EC2 instances are virtual machines on the cloud. You can provision EC2 instances for running a variety of applications, ranging from NGINX and Apache web servers to MySQL and MariaDB databases. You may even create instances that are suitable for running Windows Server and macOS operating systems. When provisioning an EC2 instance, you can select an instance type of your preference after choosing an AMI. One caveat is that an images is only compatible to an instance type of the same processor architecture (x86 or Arm).
AWS EC2 service provides flexibility in choosing the amount of processing power based on your application requirements. The rule of thumb is to refer to system requirement documentations when selecting an EC2 instance type so that you will not under-provision resources, and vice versa. Rest assured, you can change your instance types after provisioning resources in case you discover a better option or if there is a change in requirement. Your machine image is not bound to an instance type – just create a new instance, select your existing AMI and choose a new instance type!
Looking Forward
EC2 does not only provide the capacity to provision virtual machines as there are a lot of add-on services which can help you scale your infrastructure automatically. As EC2 provides on-demand instance provisioning service, you can make use of Elastic Load Balancing to ensure that no single instance has to carry all the workload on its own. In addition, you can easily satisfy availability requirements by running applications in instances which split across availability zones in a region. Stay tuned if you are interested in learning other types of services which are closely related to EC2.