Skip to Content

WordPress and fast launches: MyWordPress.com

A scalable WordPress site with Aurora and EFS for shared images, why EBS doesn't work across instances, how to launch apps quickly with golden AMIs, user data and snapshots, and the typical 3-tier web architecture.

The app

MyWordPress.com hosts a fully scalable WordPress website.

  • Users upload pictures, and every page must show them correctly.
  • User data and blog content live in a MySQL database.

The database: Aurora

The first version uses RDS for MySQL with Multi-AZ. Moving to Aurora MySQL gives:

  • Multi-AZ storage (six copies across three AZs) and fast failover;
  • up to 15 Aurora Replicas behind a reader endpoint for reads;
  • less operations work, and Aurora Global Database if the site goes worldwide.

Storing images: EBS or EFS

Storing WordPress images: with Amazon EBS, the EC2 instance in AZ A and the one in AZ B each have their own EBS volume, so an image uploaded through one instance is missing on the other; with Amazon EFS, both instances reach one shared file system through an ENI mount target in their own AZ, so every instance sees every image Storing WordPress images: with Amazon EBS, the EC2 instance in AZ A and the one in AZ B each have their own EBS volume, so an image uploaded through one instance is missing on the other; with Amazon EFS, both instances reach one shared file system through an ENI mount target in their own AZ, so every instance sees every image

Many instances need one shared file system.
  • One instance + EBS: works fine. The image is saved on the instance's volume and served from it.
  • Several instances + EBS: an EBS volume belongs to one instance in one AZ. An image uploaded through instance A is saved on A's volume; a user served by instance B can't see it.
  • Several instances + EFS: EFS is a network file system that many instances in many AZs mount at the same time, each through an ENI (mount target) in its AZ. Every instance sees every upload.

In short: EBS for a single-instance application, EFS for a distributed one. (S3, with a WordPress plugin, is another common choice for media.)

Instantiating applications quickly

Launching a full stack (EC2, EBS, RDS) can take a long time: install software, load initial or recovery data, configure everything, start the app. The cloud allows preparing in advance:

  • EC2 instances:
    • Golden AMI: install the app, the OS updates and dependencies once, make an AMI, and launch every instance from it.
    • Bootstrap with user data: for dynamic configuration at boot (fetch a config file, register the instance).
    • Hybrid: a golden AMI plus user data. Elastic Beanstalk works this way.
  • RDS databases: restore from a snapshot: the schemas and data are already there.
  • EBS volumes: restore from a snapshot: the disk is already formatted and has the data.

The typical 3-tier architecture

A typical three-tier web app in a VPC: users reach an Application Load Balancer in the public subnet; it sends traffic to EC2 instances in an Auto Scaling group in the private subnet; the instances store sessions and cached data in ElastiCache and read and write data in RDS, both in a data subnet A typical three-tier web app in a VPC: users reach an Application Load Balancer in the public subnet; it sends traffic to EC2 instances in an Auto Scaling group in the private subnet; the instances store sessions and cached data in ElastiCache and read and write data in RDS, both in a data subnet

Public, private and data subnets.
  • Public subnet: the load balancer (and NAT gateways).
  • Private subnet: the application instances in an Auto Scaling group across AZs.
  • Data subnet: ElastiCache for sessions and cached data, RDS for reads and writes.

Developers who'd rather not wire all this up themselves can let Elastic Beanstalk build it from their code.

Real-world examples

  • A news site on WordPress runs four instances in two AZs, with Aurora MySQL for posts and EFS for wp-content/uploads, behind an ALB and CloudFront.
  • An HR company bakes a golden AMI every Monday with the week's patches; new instances in its ASG start serving in under a minute instead of ten.

Exam tips

  • "Several EC2 instances must share files (uploads, content)" → EFS (Linux) or FSx for Windows File Server (Windows).
  • "MySQL, Multi-AZ, read scaling, less management" → Aurora MySQL.
  • "Instances take too long to boot because of software installs" → golden AMI; use user data only for the dynamic part.
  • "Database ready with data at launch" → restore from an RDS snapshot.

Common traps

  • "Attach the same EBS volume to all web servers." EBS Multi-Attach is only for io1/io2, in one AZ, and needs a cluster-aware file system. Use EFS for shared web content.
  • "User data makes launches fast." Long installs in user data make launches slow; bake them into the AMI.

Check yourself

AWS documentation

On this page

Open notes

Spotted a mistake?

These notes are open source. Suggest a fix, or star the repo if they helped you.

Suggest an edit

For AI agents: llms.txt · llms-full.txt