Deploying on AWS
If you want to compete in today’s rapidly evolving eCommerce landscape, it’s essential to launch a responsive, reliable, and scalable online store. SCAYLE is a robust platform for building eCommerce applications, and its storefront is the ideal starting point for any enterprise brand.
This guide provides a comprehensive overview of deploying the SCAYLE Storefront on AWS ECS. So your online store is optimized to handle growing traffic efficiently and provide a seamless user experience.
SCAYLE’s Storefront Architecture
The SCAYLE Storefront architecture is designed for scalability and reliability. Here's how the system is structured.
- ECS Fargate: The storefront application runs on AWS ECS Fargate. This enables a serverless operational model that eliminates the need to manage servers or clusters.
- AWS Application Load Balancer (ALB): All requests to the storefront are intelligently routed through an ALB, ensuring high availability and fault tolerance.
- ElastiCache: Sessions and cached requests are stored in ElastiCache. This reduces latency and improves the responsiveness of the storefront.
Implementing the SCAYLE Storefront Stack
Setting up your SCAYLE storefront stack is fast and easy. Follow these steps to get your storefront off the ground.
Prerequisites
Before deploying the storefront, you need to have an existing SCAYLE instance.
The SCAYLE instance must also be configured to have a “Shop Country” with the ID “1001” if you launch the storefront application using our prebuilt demo storefront image.
5 Steps to Deploy SCAYLE’s Storefront
- Set up an AWS Application Load Balancer (ALB)
Set up an ALB to distribute incoming traffic across your services in a “round-robin” algorithm to enhance load handling and uptime. - Host your services with AWS Fargate
Opt for AWS Fargate for hosting your services. This choice simplifies deployment as there's no need to manage servers. Simply deploy your docker image through a registry, like DockerHub or AWS Elastic Container Registry. - Configure your services
- Aim for at least two AWS Fargate tasks for redundancy (each in a different availability zone) to ensure continuous availability.
- To handle requests efficiently, allocate at least one CPU and two gigabytes of memory to each task.
- Auto Scaling is important so you don’t have to take manual action during a traffic peak. We recommend using CPU-based Auto Scaling with a target CPU set to 40% for production loads.
- The storefront application logs to Standard Out (stdout). Logs are then forwarded to CloudWatch. To enable structured tracing of your chosen monitoring solution, integrate with OpenTelemetry.
- Store and cache data with AWS ElastiCache
Utilize AWS ElastiCache for Redis to store and cache session data. It seamlessly integrates with the AWS environment. - Manage configurations with AWS Secrets Manager
Configurations, such as tokens or URLs, are automatically injected into the application for secure storage and management.
Please be aware that your infrastructure setup needs to take care of in-transit encryption (TLS) for AWS ElastiCache, as this is not
More details can be found here:
Integrating With Your SCAYLE Instance
The storefront interfaces with the SCAYLE platform through:
- The storefront API – handling product, category, wishlist, and basket data
- The checkout API / The embedded checkout component
- The auth API – used for user registration, login, and third-party authentication
Launching the Stacks
Deploy your SCAYLE Storefront with ease:
git clone https://github.com/scayle/storefront-boilerplate-aws-deployment
cd storefront-boilerplate-aws-deployment
Parameters
Name | Description |
---|---|
Tenant Space | Your SCAYLE Account Manager will provide you with a “SCAYLE tenant space identifier”. |
Storyblok Access Token | Currently, our storefront requires a Storyblok access token – we are working on removing this restriction. If you’re not using Storyblok already, your SCAYLE Account Manager can provide you with an access token. |
Storefront API Token | You can create a token to access the storefront API in the SCAYLE Panel.
|
Auth Client ID | Create the ID for the credential pair of the SCAYLE Authentication API in the SCAYLE Panel.
|
Auth Client Secret | The corresponding secret to the SCAYLE Authentication API Client ID. |
Checkout Secret | A secret to access the Checkout APIs from SCAYLE. Your SCAYLE Account Manager will provide this. |
Checkout Token | A token to access the Checkout APIs from SCAYLE. Your SCAYLE Account Manager will provide this. |
Deploy the stack
aws cloudformation deploy
--stack-name ${STACK_NAME}
--capabilities CAPABILITY_NAMED_IAM
--template-file stack.yml
--parameter-overrides SCAYLETenantSpace=${TENANT_SPACE} StoryblokAccessToken
=${STORYBLOK_ACCESS_TOKEN} SCAYLEStorefrontAPIToken=${STOREFRONT_API_TOKEN} SCAYLEAuthClientId=${AUTH_CLIENT_ID} SCAYLEAuthClientSecret=${AUTH_CLIENT_SECRET} SCAYLECheckoutSecret=${CHECKOUT_SECRET} SCAYLECheckoutToken=${CHECKOUT_TOKEN}
--no-fail-on-empty-changeset
Upon successful deployment, your storefront will be accessible via the public ALB URL provided.
Some features such as login might not work as they require a valid SSL Certificate.
Conclusion
Deploying the SCAYLE Storefront on AWS ECS offers a scalable, resilient, and efficient way to launch your eCommerce platform. This setup not only enables seamless user experiences but also ensures your store can scale with demand.
With this guide, you're well equipped to deploy your own SCAYLE Storefront, setting the stage for eCommerce success.