+++
title = "Optimization"
weight = 40
pre = "3. "
+++
Congratulation's, since you're here, you've managed to migrate an e-commerce application into AWS and can now look for ways to optimize the architecture to make it even more secure, highly-performant, resilient and so that is uses AWS infrastructure efficiently!
Below you will find ideas about what you can do taking into account 5 AWS Well-Architected Pillars - Operational Excellence, Security, Reliability, Performance Efficiency and Cost Optimization.
You can also learn more about **AWS Well Architected** by watching the video below.
### Operational Excellence
- Configure a CloudWatch dashboard to monitor your resources in a single view, even across AWS regions.
- Configure a persistent CloudTrail trail to be able to monitor, audit and alert on what is happening in your AWS accounts
### Security
- Switch to HTTPS with AWS Certificate Manager managed SSL/TLS certificates to encrypt customer data in transit (certificates are already provisioned in this workshop!)
- Encrypt EBS volumes to protect customer data at rest
- Enable AWS Web Application Firewall (AWS WAF) to protect your web application from known attacks (you can do it on Application Load Balancer or event better on the Amazon CloudFront distribution)
- Use Amazon GuardDuty to protect your AWS account and workloads with intelligent threat detection and continuous monitoring
### Reliability
- Configure an Application Load Balancer to distribute Webserver traffic across multiple Availability Zones
- Configure Amazon EC2 Auto Scaling Group to enable auto-healing in case Webserver instances go down and to handle changing customer load
- Use Amazon CloudFront - a fast Content Distribution Network that securely delivers data to customers globally with low latency and high transfer speeds, integrating seamlessly with AWS Shield for DDoS mitigation.
### Performance Efficiency
- Deploy Amazon Elastic File System to handle changes of files on Webservers
- Use Amazon CloudFront with AWS S3 as custom origin to distribute static content for lower latency for your customers and lower cost
### Cost optimization
- Use Amazon EC2 Spot instances - select machine type using EC2 Spot Advisor, some instances allow for **90% savings** with <5% interruption frequency
- Use the most cost-optimized machine types
### Reference architecture
Diagram below depicts a reference architecture of the solution, with all components listed above deployed.

For more details see the Reference Architecture for Wordpress on AWS!