Different Architectures to create an e-commerce website with AWS and WordPress

Creating a website now-a-days is a piece of cake. I’ve seen people struggle a lot with hosting and designing a website and that is why I thought of writing a small gist of what to do in order to create an E-Commerce website.

1. A domain name (www.example.com) : You can get this from some famous domain name registrar organizations like GoDaddy, Google Domains, Route 53 (AWS), etc.

2. Basic understanding of AWS services like EC2, Route53, ELB, etc

3. Basic understanding of WordPress.

Architectural Diagram -1

Let me walk you through the above.

  1. First we’ll point our hostname (www.example.com) to AWS resource (ELB in this case) using Alias record. This Alias record will also point to our DNS (www.example.com)
  2. If we’ve registered our domain with some other domain registrar, we’ll have to pass the NS records in the name servers of the domain registrar.
  3. The user will query the Amazon Route 53 via a domain URL (www.example.com) and Route 53 will return the AWS hostname of the ELB.
  4. This ELB is in front of an EC2 instance which is launched using a WordPress AMI.
  5. The EC2 instance will now redirect the user to WordPress homepage where you’ve customized your website. Fairly easy!

Pros:

  1. Easy to setup
  2. Better security since only ELB will interact with EC2 instance.
  3. Auto Scaling

If you’re expecting much less traffic on your website, instead of above you can follow the below approach as well.

Architectural Diagram -2

Let me walk you through the above.

  1. We’ll attach an Elastic IP with our EC2 instance and will map this IP to the Route 53 A record. This A record will also point to our DNS (www.example.com)
  2. If we’ve registered our domain with some other domain registrar, we’ll have to pass the NS records in the name servers of the domain registrar.
  3. The user will query the Amazon Route 53 via a domain URL (www.example.com) and Route 53 will return the elastic IP attached to the EC2 instance.
  4. The EC2 instance will now redirect the user to WordPress homepage where you’ve customized your website.

Pros:

  1. Easy to setup
  2. Can have the WordPress website up and running in minutes.

Cons:

  1. We should avoid using Elastic IP because they often reflect poor architectural decisions. Instead, use a random public IP and register a DNS name to it

Hope you’ll like this post!

Feel free to drop a comment or review.