An e-commerce website can be hard to maintain, since it should have a large product catalog and a global customer base. That catalog should be searchable, and product pages should contain images, PDF files, customer reviews, etc.
Customers want to find the products they are looking for quickly, and they expect the pages to load fast. The website must provide high availability since worldwide customers want to be able to make purchases at any time, at any place. These requirements are hard to achieve, and it becomes harder as the catalog and customer base grow. Even though it is not an easy task, you can build a scalable website, with a searchable catalog which provides low latency using the tools provided by AWS.
In this part of the post, we will focus on the web front-end.
For the front-end architecture, the following Amazon products will be used:
- Route 53: a DNS service to handle the requests.
- CloudFront: a global content delivery network service with edge locations around the world, that accelerates web assets. It can cache any content and provide low latency from locations close to the user.
- Elastic beanstalk: where the application is deployed. It automatically handles capacity provisioning, load balancing, auto scaling and health monitoring.
- Simple Storage Service (S3): provides a highly durable storage infrastructure for all static catalog content (images, manuals, videos, log files, clickstream information, etc).
- DynamoDB: a high performance and fully-managed NoSQL database, with very low latency. Easy to set up, operate and scale. It is used as the product database as well as a session store to provide persistent session data, such as the shopping cart. It is easy to add new product categories and attributes to the catalog since DynamoDB has no schema.
- ElastiCache: used to provide a session storage for volatile data and as an additional caching layer for the products, in order to reduce queries to DynamoDB.
- CloudSearch: it is where product catalog data is loaded. It provides a fast and highly scalable search service.
When the customer performs a checkout action, he is redirected to an SSL-encrypted checkout service (an application on another instance of Elastic Beanstalk).
Using those elements we can build an architecture for a secure, scalable and highly available e-commerce website. The following diagram shows how everything works together:
Consider that Checkout application has its own infrastructure connected to each Elastic Beanstalk, described as follows.
2- Checkout service
In this part of the post, we will focus on the checkout service. In order to complete every e-commerce transaction, you will need to manage the checkout process, which involves many coordinated steps. Some of them are subject to specific regulatory requirements like credit card transactions. There is also manual work, like packaging and shipping items that involves physical activities. Customers expect their credit card information and any other private data to be managed in a highly secure way.
Using the tools provided by AWS, a secure checkout service that manages the whole process can be built.
The e-commerce front end redirects the customer to an SSL-encrypted checkout application to authenticate the customer and execute a purchase securely. For the checkout architecture, the following Amazon products will be used:
- Elastic Beanstalk: where the checkout application will be deployed, same as described in the previous section. It will use Amazon Simple Workflow Service to authenticate the customer and perform a new order workflow.
- Amazon SWF: it is in charge of coordinating all running order workflows using SWF Deciders and SWF Workers.
- SWF Decider: it implements the workflow logic, running on an Elastic Compute Cloud (EC2) instance within a private subnetwork that is isolated from the public Internet. It is located within an Auto Scaling group to increase the number of instances during demand spikes, and decrease it during low demand periods to minimize costs.
- SWF Workers: they manage the different steps of the checkout pipeline, like validating the order, charging the credit card, triggering the sending of order and sending confirmation emails. They are deployed in on Elastic Compute Cloud (EC2) instances within a private network, and into a Auto Scaling group.
- SWF Workers can also be implemented on mobile devices (like tablets) to optimize the manual work like pick, pack and ship process and integrate them into the overall order workflow.
- Simple Email Service (SES): used to send order and shipping confirmations to the customers.
- Relational Database Service (RDS): customers and orders data are hosted into redundant databases in multiple Availability Zones, within private subnetworks isolated from Internet.
Using these elements we can build an architecture for managing the whole check out process, integrating even the manual work to the workflow. The following diagram shows how each component work together:
Following these two architectures, a secure, maintainable and highly scalable E-Commerce website can be built
For more detailed information about these and other AWS architecture, check AWS Architecture Center