By Alex Husar
Magento is a leading CMS for eCommerce projects with over 250,000 merchants worldwide relying on the platform to run their online stores.
To give you an idea of how popular it is, more than 20% of the companies from the “Top 1,000 Retailers list” are among Magento users.
However, advanced functionality, scalability, variability of features, and a multi-server environment come at a price. And the price, in this case, is the resource-intensiveness.
The truth is that if you have ever had an intention to run your Magento store on a shared hosting at $5/month, forget about it.
If you want your store to operate seamlessly and smoothly, to support a large number of visitors and orders per day, you need a more advanced hosting solution such as dedicated VPS or cloud hosting.
As such, Amazon Web Services (AWS) provides a synergy of hardware and software configuration, as well as data caching, and is considered to be one of the most optimal solutions for Magento stores.
Now it’s high time to find out what strategies can be applied to set up a Magento store on the AWS cloud. Each of the strategies is tailored to different kinds of online stores as per the number of their orders and visitors. Moreover, you can choose and apply an optimal strategy from “mildest” to “the most severe” in accordance with your set skills.
Practical advice from AWS experts to help you weather the storm
With extensive insights, advice, and best practices from cloud leaders, our brand new white paper is the ultimate guide to optimizing your business with AWS.
This strategy is as simple as they come. It can be put into action by even the most out-of-their-depth Magneto user without the need for development skills. You can easily run an eCommerce store on AWS in a few minutes by downloading and installing a scalable Magento 2 stack from the AWS Marketplace. The stacks you can find there were made by third-party developers who have configured an EC2 instance on AWS, saved their settings, and made them accessible for ordinary users.
These ready-to-run solutions can save you time and money, making them extremely useful for those who run a small-sized online store and have no technical skills. If you’re an owner of a large-scale online store, this solution isn’t the best choice for you (in this case, you’d better go with the third strategy).
Here’s how to download a scalable Magento stack:
With this strategy, store owners launch an EC2 Instance on AWS and work with it as if it were a regular VPC or dedicated server. What is an EC2 Instance? It’s a virtual server on AWS that’s able to run web applications. To put it another way, an Elastic Compute Cloud is an offering from AWS that allows users to rent virtual servers to deploy their websites.
This method is not quite so straightforward as the one above; implementation of an EC2 instance requires not only technical skills but code knowledge and the ability to use some software.
This strategy works well for small and middle-sized online stores as well as for test and production websites.
Here’s how to utilize an EC2 instance:
Now, when an EC2 instance is launched, we can get to the installation of all pre-requisite tools that are needed to run a Magento store. What are these tools?
Installing software on an EC2 Instance is no different from installing on regular dedicated or VPS hosting. You can find step-by-step instructions here.
Take a look at our database of pre-screened AWS professionals and take the first step toward landing the best administrators, developers, and consultants in the market.Browse AWS professionals
And last but not the least, this strategy is a great solution for large-scale Magento websites with high traffic volume and visitor numbers.
It’s the trickiest way to set up Magento on AWS but the one that gives you the most options. To implement this method, you’ll need either good DevOps knowledge or a developer who knows the ropes.
Here are the components you’ll need:
AWS Elastic Load Balancer is a service for distributing incoming application traffic among different EC2 Instances. The ELB is a big deal when it comes to providing a higher degree of fault tolerance.
The same instances we mentioned earlier. Check out AWS’s guide to EC2 instances if you want to find out more.
Amazon’s Relational Database Service is a distributed relational database service used to make it easier to operate, set up, and scale a relational database in the cloud.
ElastiCache is a fully managed cache service and data store provided by AWS. ElastiCache retrieves information from the in-memory cache, helping to improve the performance of applications by removing the need to rely on slower disk-based databases.
Now we know the what, let’s move on to the how.
Step #1: Set up Load Balancer, EC2, and Auto Scaling group
The owners of large-scale online stores have to deal with a great amount of inbound traffic, which can become even greater during seasonal peaks or sales.
Because of this fluctuation in traffic, some large-scale stores will need to create multiple EC2 instances with Amazon EC2 AutoScaling. This service enables developers to increase or decrease the number of web servers in a group as and when the needs of their website change.
When you have more than one instance, it’s essential to get a load balancer that can distribute request traffic among instances. When a new server is added to the auto-scaling group, the load balancer begins to send requests to it.
You’ll then need to create an Auto Scaling group that contains a batch of EC2 instances for automatic management and scaling. The group’s size will depend on how many instances you set aside to cope with your desired capacity. You can adjust the size both manually or with automatic scaling.
Creating a group allows you to utilize other AWS scaling features, like scaling policies or health check replacements which replaces unhealthy instances with the new ones. If you want to know how to create an Auto Scaling group using a launch configuration, you can read here.
You’ll need to install a PHP environment and a webserver to do this.
Step #2: Set up RDS
The next step within the strategy is to create an RDS DB instance to store the data used by your website or app.
The easiest way to do this is to use the AWS Management Console, which allows you to create a DB instance that uses MySQL, MariaDB, or other databases. After the DB instance is created, you need to connect to a database on a DB instance using standard MySQL utilities. Here you can find detailed instructions on the process.
Remember, your RDS instance has to be set up in the same Availability Zone as your EC2 instance.
Step #3: Set up Elasticache
You also need to set up Elasticache (Redis) to store sessions data and cache. This provides you an optimized end-to-end software and hardware stack for fast performance, enhanced scalability, and high availability. Find how to set up Redis here.
Of course, you can take care of all the settings manually but you can also use tools that allow you to describe your environment in the form of a config. This makes it easy to make changes and saves time if you need to recreate the environment.
To do this, you can use AWS OpsWorks, which lets you create configurations and define the connections with the EC2 Instances.
OpsWorks is built for DevOps users and system administrators in search of an authoritative and end-to-end configuration management solution to help them control and customize environments.
TerraForm—a third-party utility that can work with AWS API and manage a stack—is a good alternative to OpsWorks.
Ready to get started? As you can see, there are a number of ways to set up Magento on AWS. Which one is right for your store depends on the size of your store and how much traffic you pull in (as well as your cloud knowledge and development skills).
Since Magento is designed to provide performance and scalability, AWS is a great option when it comes to hosting Magento online stores.
AWS is super scalable, making it an efficient solution to managing the seasonal traffic swings that occur with many eCommerce stores. It’s also secure, providing significant protection for stores and their shoppers, with millions invested in the defense of AWS data centers.
If you’re considering using cloud services to power for your Magento website, AWS is the perfect solution.
Setting up Magento on AWS is not always the easiest task, so if you don’t think you can tackle it alone, be sure to hit up a professional for support.
Einblicke in den AWS-Markt