Open Sourcing Our AWS Cloudformation Stack Designed For Magento 2.x

SourceFuse
5 min readSep 6, 2018

--

240,000 stores run on Magento and pretty much every one of them has identified overall site speed as a paramount priority. Serious e-commerce businesses understand that a scalable infrastructure can throttle and expand to seamlessly handle peak shopping times and traffic spikes. A critical feature when aiming to increase session time, reduce drop offs, abolish abandoned carts, and most importantly convert visitors.

Making sure your site runs like a cheetah hunting an antelope through the Serengeti, means making sure your Magento 2.x install is properly configured for production. Properly configured means a few things. One, that your technical components are correctly in place — are your errors logging and static files in place? And two, is your infrastructure hardware adequate? Magento 2’s modular architecture and database intensive backend will require more from your hosting environment than a regular website.

Amazon, a (soon to be) one-trillion dollar company. Who’s 2-main strengths are; e-commerce and infrastructure.

Go ahead, name a better e-commerce infrastructure partner, we’ll wait.

AWS (Amazon Web Services) is our hosting provider of choice. For reasons of cost, scalability, security and reliability. You don’t however get all these non-functional attributes out of the box, you need to architect your hardware infrastructure accordingly.

A decade of experience building, migrating, and optimizing e-commerce stores for clients all over the globe has taught us a few things we’d like to now pass along in regards to cloud stacks designed to scale and sell.

Today we are sharing our collective knowledge and sort of open sourcing our AWS Cloudformation Stack for rolling out a highly scalable and fault tolerant Magento 2.x instinance.

Production infrastructure on Amazon AWS Consists of:

  • ECS Application Servers
  • RDS Database Servers Two Servers with Failover
  • EC2 Bastion
  • ECS Admin server for admin specific tasks
  • AWS Elasticache Two Nodes with Failover
  • Cloudfront
  • SES
  • SNS
  • ALB
  • NAT Gateway
  • EFS
  • AWS WAF
  • AWS Shield

The Benefits Of Our AWS Cloudformation Stack:

Our stack, any stack, is just collection of resources that manages as a single unit. So what makes our stack different and better than other more varied or Frankensteined stacks?

Always Available, Guaranteed.

We designed our infrastructure stack to be completely fault tolerant (short of a nation-wide natural disaster), robust and highly available. With two availability zones each containing one server. We set out to assure our clients that their web application will still be serving in even the worst case scenario, of an Availability Zone (aka data centre) blackout. This design philosophy is also applied to our database servers as well. Utilizing a failover architecture guarantees consistent uptime and quick restoration shall they need it. And of course, the same concept is applied to elasticache with multi node replication.

Online Shopping Performance

Magento alone cannot handle the traffic demands of today’s successful online shops. The multiple data calls repeatedly being sent to the servers from hoards of simultaneous visitors drastically slows down load times and brings most shops to a stand still. Herefore, Redis has become a very popular and powerful caching system to use alongside Magento. Redis is an open-source, in-memory data structure store. Basically, this allows the multiple native caching functionality of Magento to be expanded on while upholding custom store labels for more direct delivery. While having static content — like images and javascript — be served by Cloudfront. Which ensures delivery from the nearest edge location, to the visitors.

With the release of 2.2.5 Magento is seeming to be a more CPU intensive application as compared to its preceding releases. Further analysis of various EC2 instances helped us identify a perfect instance size of C5.xlarge leveraged alongside great hardware with consistent CPU performance provides optimal performance to power an application with 4 vpcu and 8GB of RAM.

The Ingredients For A Security Sunday

The entire infrastructure is all round protected by AWS’s Web Application Firewall. And the application stack is continuously being monitored by AWS Lambda. Because of this, in the event of a HTTP layer attack the source IP is blocked which prevents it from causing any damage. While the AWS standard Shield protection acts as the cherry on top of our “Security Sunday” helping to block a DDOS attack.

Scale During Sales

No more downtime due to high traffic on a sale day, during Cyber Monday, or ever! Our stack automatically scales your application to handle unexpected workloads or you can schedule it in advance, before the sale starts. Once traffic drops, or the sale is over, the number of application servers is reduced the supplemental servers are turned off and the true beauty is, you only pay for what you used.

Cost, All This Jazz Must Be Expensive

All this serious hardware doesn’t come cheap. However… We at SourceFuse have come up with an innovative approach using AWS Spot instances to drastically slash infrastructure bills. If cost is throttling performance your ideas, strategy, and execution are not getting a fair shot at success. It doesn’t take creative accounting to find monetary movement to facilitate web performance, it really just takes the right architect and infrastructure partner. Levering the experience and insight of an AWS Partner allows you to craft a performance infrastructure for your unique elasticity. Growing during peak times or shopping seasons, and scaling down during inventory lulls.

SourceFuse is an AWS Advanced consulting Partner

We have built e-commerce extensions, sites, stores, and apps for every product niche in every corner of the globe. But we utilize our own blended team to deliver cost-effective scalability, monitoring, and optimization techniques. So, there is no hesitation about open sourcing our Magento infrastructure stack, because that’s not our secret sauce. Our roots are planted in open source software, leveraging the compute and application power of these tools for our clients needs and benefits.

--

--

SourceFuse

A digital product company and the leading AWS partner in the Southeast. Custom code and infrastructure development, migration, and optimizations.