CARVIEW |

Architecting an Highly Available and Scalable WordPress Site in AWS
This document describes an architecture for hosting a highly scalable and available WordPress site on AWS. The key aspects are: 1. It uses multiple AWS services like ELB, RDS, S3, CloudFront to provide a multi-tier architecture with load balancing, database, storage and content delivery capabilities. 2. The WordPress instances are deployed across multiple availability zones in an auto-scaled manner behind an ELB to ensure high availability and ability to scale dynamically based on traffic. 3. The database layer uses a MySQL master-slave configuration with read replicas to provide read scaling and high availability of data.














































More Related Content
What's hot
Viewers also liked
Similar to Architecting an Highly Available and Scalable WordPress Site in AWS
Recently uploaded
In this document
Introduction to architecting a highly available and scalable WordPress site using AWS.
Highlights the prevalence of WordPress and the need for scalable solutions in AWS.
Key architectural requirements for a WordPress site on AWS: scalability, high availability, performance, and cost-effectiveness.
Benefits of using AWS for WordPress scaling, including flexibility, robust services, and cost savings through auto-scaling.
Overview of essential AWS services like Route 53, ELB, RDS, and S3 for supporting WordPress architecture.
Description of a highly scalable WordPress architecture featuring multi-tiered design and automated operations.
A detailed look at the different architectural tiers within the WordPress setup.
Explanation of how Amazon Elastic Load Balancing optimally distributes traffic to WordPress instances.
Insights into scalability and elasticity allowing WordPress EC2 instances to handle varying traffic loads.
High Availability strategies in WordPress architecture across multiple layers, ensuring reliability.
Structure of the database layer, highlighting the use of RDS for high availability and performance.
Performance optimization strategies using caching plugins and separation of read/write operations.
Implementation of Amazon CloudFront as the CDN for efficient delivery of static assets.
Approach to file and plugin deployment in the WordPress management architecture.
Monitoring setup using Amazon CloudWatch for system performance and alerts.
Data backup strategies utilizing S3 and periodic RDS backups for recovery.
Security measures taken to protect WordPress instances, including hardening and IAM policies.
Key benefits of using this architecture: scalability, performance, monitoring, and fault tolerance.
Disadvantages of the architecture, highlighting complexity and cost for smaller sites.
Important reminders regarding settings and best practices for deploying scalable WordPress on AWS.
Announcement of cloud architecture consulting services for setting up scalable WordPress solutions.
Contact details for further inquiries and engagement related to AWS and WordPress management.
Architecting an Highly Available and Scalable WordPress Site in AWS
- 1. Architecting an HighlyAvailable and Scalable WordPress Site in AWS Harish11g.aws@gmail.com https://harish11g.blogspot.com
- 2. Why this presentation? • WordPress is used by over 14.7% of Alexa Internet's "top 1 million" websites • As of August 2011 WordPress powers 22% of all new websites • As of December 2011, version 3.0 had been downloaded over 65 million times • Provide some architectural insights to build Highly Scalable and Available WordPress sites in AWS • Help startups and companies who are new to AWS- WordPress with some blueprints
- 3. WordPress Architecture Requirementsin AWS • Ability to Serve millions of Pages per day • Ability to scale out/down dynamically depending upon traffic • Ability to perform well even with scaling demands • Should be Highly available without Single Points of Failure • Automated Operations – Backup and Monitoring • Cost effective
- 4. Why AWS isbetter for WordPress Scaling? • AWS provides flexibility to Scale up and Scale out • AWS provides Building block services which is inherently robust and fault tolerant • AWS provides full range of options from CDN , OS flavors , Storage Pool , Database , Load Balancers , Monitoring etc • Pay as you go – Save cost by leveraging Auto Scaled WordPress EC2 instances • We can start small and grow big in AWS
- 5. AWS Building Blocksused in this WordPress Architecture
- 6. Some AWS buildingblocks Amazon Amazon Route53 for managing and answering DNS queries Route 53 Amazon Elastic Load Balancer for load balancing HTTP/S requests to WordPress Instances RDS MySQL Database Server for storing the WordPress content Simple Storage Service (S3) for storing the WordPress S3 application assets , snapshots and log files Amazon Amazon CloudFront CDN for delivering the application static CloudFront assets from nearest edge locations Amazon Amazon CloudWatch for monitoring and sending SNS alerts CloudWatch
- 7. Highly Scalable Architecturefor WordPress application
- 8. Admin Amazon AZ : Amazon Amazon CloudFront Availability Zones Route 53 AWS Region 1 Static Data SSH/SFTP Elastic Load S3 Balancer Amazon CloudWatch Az-1 Az-2 Alarms Auto Scaled WordPress EC2 WordPress instances Management Server Amazon SNS Notifications Az-1 Az-2 Az-1 Az-2 Standby RDS Master Read Replica Backups and Log files File Storage Pool Database Layer Database Layer
- 9. Brief about theArchitecture • Multi- Tiered Architecture • Load balancing tier • Separate WordPress Management and Instance nodes • Auto Scaled WordPress EC2 instance nodes • MySQL M-S database with additional Read Slaves • S3 + CDN for content delivery • Monitoring , Backups , Sys alerts
- 10. Architectural Tiers Explanation Now let us see the tiers in detail !!
- 11.
- 12. Admin Amazon AZ : Amazon Amazon CloudFront Availability Zones Route 53 AWS Region 1 Static Data SSH/SFTP Elastic Load S3 Balancer Amazon CloudWatch Az-1 Az-2 Alarms Auto Scaled WordPress EC2 WordPress instances Management Server Amazon SNS Notifications Az-1 Az-2 Az-1 Az-2 Standby RDS Master Read Replica Backups and Log files File Storage Pool Database Layer Database Layer
- 13. Load Balancing withAmazon ELB • Amazon Elastic Load Balancing will Load balance the http requests to WordPress EC2 instances • ELB will direct the requests to WordPress EC2 across Multiple Availability Zones ( for HA) • Health check , LB algorithms and SSL termination will be done by the Load Balancer • Amazon Elastic Load Balancing can keep expanding its capacity automatically depending upon the traffic
- 14. Load Balancing withAmazon ELB • Amazon ELB works with Route 53 and Auto Scaling seamlessly • Amazon ELB is priced @“ Pay for use” model • Amazon ELB is a managed service , so • NO Maintenance headaches • NO SW/HW upgrades • NO Capacity planning • NO manual intervention for expansion
- 15. How scalable isthis architecture ?
- 16. Admin Amazon AZ : Amazon Amazon CloudFront Availability Zones Route 53 AWS Region 1 Static Data SSH/SFTP Elastic Load S3 Balancer Amazon CloudWatch Az-1 Az-2 Alarms Auto Scaled WordPress EC2 WordPress instances Management Server Amazon SNS Notifications Az-1 Az-2 Az-1 Az-2 Standby RDS Master Read Replica Backups and Log files File Storage Pool Database Layer Database Layer
- 17. Scalability and Elasticity •Scalability and Elasticity is built in most of the layers in this architecture • WordPress EC2 instances can be scaled out and down depending upon the traffic • We can expand the number of WordPress EC2 instances from 1 to 100+ automatically during load peaks • We can reduce the number of WordPress EC2 instances from 100+ to 1 automatically during valleys • Can serve millions of pages with ease • Pay only for the EC2 instance hours used
- 18. Scalability and Elasticity •Read Scalability is built in the Database layer with RDS Read Replicas • New RDS Read Replicas can be added / removed with ease • Tips: • During Campaigns alone we can run more RDS Read Replicas • Not more than max 5 RDS Read replicas are recommended • Keep Read Replica’s and RDS Master same EC2 size for better performance
- 19. Scalability and Elasticity •Clustered + Distributed File System of the Storage pool layer can be manually scaled in case needed • Minimum 2 EC2 Large instances should be used for Storage Pool Layer ( for HA and better IO) • Design the Storage Pool Layer with HA (very critical) • AWS building blocks like S3 , CloudFront , CloudWatch , SNS used in this architecture are inherently designed for scalability
- 20. How High Availabilityand Fault tolerance is built in this Architecture ?
- 21. High Availability • HA@ WordPress Layer • Multiple WordPress EC2 instances avoid single point of failure • WordPress EC2 instances are launched across multiple – AZ’s inside a region for High Availability • HA @ DB Layer • RDS MySQL Master and Standby are launched in 2 different availability zones for High Availability • RDS Read Replicas are created in Multiple –AZ’s
- 22. High Availability • HA@ Storage Pool Layer • Two EC2 instances used for Storage Pool Layer • Storage Pool is setup in replicated mode for High Availability • AWS building blocks like S3 , Cloud Front , CloudWatch , ELB , SNS ,EBS used in this architecture are inherently designed for Fault tolerance and HA
- 23. How the DatabaseTier is Architected ?
- 24. Admin Amazon AZ : Amazon Amazon CloudFront Availability Zones Route 53 AWS Region 1 Static Data SSH/SFTP Elastic Load S3 Balancer Amazon CloudWatch Az-1 Az-2 Alarms Auto Scaled WordPress EC2 WordPress instances Management Server Amazon SNS Notifications Az-1 Az-2 Az-1 Az-2 Standby RDS Master Read Replica Backups and Log files File Storage Pool Database Layer Database Layer
- 25. Database layer • RDSMaster and Standby provide High availability • RDS Read Replicas provide Read performance • HyperDB plugin is configured to use multiple endpoints like RDS master and RDS read replicas in this architecture • DB security groups will allow DB access only to WordPress EC2 instances • Periodic Dumps , Snapshots and Point in time recovery is possible in this architecture
- 26. What performance aspectsare taken care in this Architecture ?
- 27. Performance • APC (or)Xcache plugin can be used for PHP opscode caching • W3TotalCache+CloudFront (or) BatCache+Memcached can be used for Page caching • Multiple RDS Read Replicas for Read performance • RDS Master and Read Replicas are separated to get independent write and read performance • Amazon ELB + Auto Scaling improves the overall Site performance when the load increases
- 28.
- 29. Admin Amazon AZ : Amazon Amazon CloudFront Availability Zones Route 53 AWS Region 1 Static Data SSH/SFTP Elastic Load S3 Balancer Amazon CloudWatch Az-1 Az-2 Alarms Auto Scaled WordPress EC2 WordPress instances Management Server Amazon SNS Notifications Az-1 Az-2 Az-1 Az-2 Standby RDS Master Read Replica Backups and Log files File Storage Pool Database Layer Database Layer
- 30. Content Delivery • AmazonCloudFront will be the Content Delivery Network (CDN) • W3TotalCache plugin will be configured to use Amazon CloudFront for enhanced performance and reduced latency • Static assets , templates , themes , images etc will delivered from the nearest edge locations of the CDN
- 31. Deployment • Distributed FileStorage Pool is configured between WordPress Management and Content instances • WordPress Management and Content instances share the common storage pool for files and plugins • Deployment of files and plugins will happen through the WordPress management node • Files and plugins will be immediately available for use in the auto scaled WordPress EC2 instances
- 32.
- 33. Admin Amazon AZ : Amazon Amazon CloudFront Availability Zones Route 53 AWS Region 1 Static Data SSH/SFTP Elastic Load S3 Balancer Amazon CloudWatch Az-1 Az-2 Alarms Auto Scaled WordPress EC2 WordPress instances Management Server Amazon SNS Notifications Az-1 Az-2 Az-1 Az-2 Standby RDS Master Read Replica Backups and Log files File Storage Pool Database Layer Database Layer
- 34. Monitoring • Amazon CloudWatchwill monitor the CPU and Network utilization of the entire setup • Amazon CloudWatch alarms configured with Amazon SNS provides Email/SMS alerts to System Administrators
- 35.
- 36. Admin Amazon AZ : Amazon Amazon CloudFront Availability Zones Route 53 AWS Region 1 Static Data SSH/SFTP Elastic Load S3 Balancer Amazon CloudWatch Az-1 Az-2 Alarms Auto Scaled WordPress EC2 WordPress instances Management Server Amazon SNS Notifications Az-1 Az-2 Az-1 Az-2 Standby RDS Master Read Replica Backups and Log files File Storage Pool Database Layer Database Layer
- 37. Backup • Custom opsscripts will backup the necessary files from Storage pool to S3 periodically • S3 can be configured to remove old backups automatically • RDS MySQL is configured to take periodic data dumps and DB snapshots • RDS layer can be recovered point in time from the backups
- 38. Security • Suitably hardenedOS for WordPress Mgmt and WordPress instances • Firewall (or) AWS security groups configured between all the layers in the architecture • SFTP/FTP access only to the WordPress management node • AWS IAM policies to manage user account access • Install WordPress Security plugins
- 39. Advantages • Highly Availableand Scalable architecture • Can elastically scale out to serve millions of hits in a day • Can grow with load demands in future • Usage of inherently fault tolerant AWS building blocks adds Stability • High performance using CDN and suitable cache plugins • Monitoring , Backup and Recovery is built in • Pay for use
- 40. Disadvantages • Complex tosetup and maintain • Will not be ideal for smaller sites that do not need scale • Will not be cost efficient for sites that have less traffic
- 41. Key Points toRemember • Log files generated in WordPress EC2 instances have to rotated • Use Amazon EBS for Storage Pool and WordPress EC2 instances • Start with EC2 m1.Large Instances for the storage pool and WordPress instances • More Memory – Better Performance for DB • Start with RDS Large for Master • Keep RDS Master and RDS Read Replica’s in same size to improve read performance
- 42. Key Points toRemember • RDS MySQL supports only Innodb engine • Separate the WordPress Management and WordPress Content instances for scalability • Do not Scale out/down rapidly in a hour, it will cost more in AWS • Combine AWS On-Demand and Reserved Instance pricing to get more savings per month
- 43. Key Points toRemember • Amazon Availability Zones(AZ’s) are distinct physical locations with Independent power , cooling ,network and security having Low latency network connectivity between them inside the same region • Leverage them in WordPress , Storage Pool and DB layers for HA as mentioned in the architecture
- 44. How do Isetup Scalable WordPress architecture on AWS?
- 45. Leave it tothe experts , we will handle this Cloud Architecture Consulting Cloud Application Development Cloud Migration & Implementation Cloud Adoption Strategy “Let's get the job done”
- 46.