Skip to content

A Magento shop: from shared hosting to AWS

A Magento shop moved from shared hosting to AWS with no downtime. Pages load about 3× faster. The goal was scalability and resilience to failure, not saving money.

In short, without the jargon

  • I moved an online shop from shared hosting to AWS. Customers did not notice the move: the shop stayed open the whole time.
  • Shop pages now open about 3 times faster.
  • The shop is ready for campaign traffic, with backups and a plan for when something fails.
  • Hosting now costs more than before, on purpose: the money buys room to grow and a fast recovery after a failure.
Industry
E-commerce
Stack
EC2, RDS MySQL, OpenSearch, CDN, Varnish, Redis, Magento
faster page loads
3×
of downtime during the migration
not a minute
magento-shop.diffChange: 6 lines added, 2 removed

infrastructure

  • Before: shared hosting, application and database in one place
  • After: AWS: application separated from the database and search
  • After: RDS MySQL instead of a database next to the application
  • After: Varnish (full-page cache) and Redis
  • After: OpenSearch for product search
  • After: CDN for images and static files

result

  • Before: page load time: 1×
  • After: page load time: about 3× faster
  • switch-over without a minute of downtime

Note: the hosting bill went up: the setup was built for scalability and disaster recovery (DR).

Before

The Magento shop ran on shared hosting: application and database in one place, no way to add capacity for a campaign, and no plan for a failure.

Hosting
shared
Separate services next to the application
0
Page load time
1× (baseline)

What I did

  • Migration from shared hosting to AWS with no downtime.
  • EC2 with PHP-FPM and Nginx, the database in RDS MySQL.
  • Varnish as a full-page cache, and Redis.
  • OpenSearch for search in the shop.
  • A CDN for static files.
  • Infrastructure ready for campaign traffic peaks and resilient to failure (DR).
  • Backups and monitoring.
  • Automated deploys.

After

The shop runs on AWS, with separate services for the database, cache, search and static files. The switch-over went through without a minute of downtime. The hosting bill is higher than before because the goal was scalability and disaster recovery (DR).

Hosting
AWS
Separate services next to the application
5
Page load time
about 3× faster
Downtime at switch-over
not a minute
Hosting bill
higher than before the migration

Got a similar problem? Describe it in two sentences.