CLOUD INFRASTRUCTURE

Highly Available (HA) Cloud Infrastructure For Spree Commerce

We developed a highly available cloud infrastructure for one of the largest home furnishing and performance bedding brand of US for their eCommerce platform. Our client, SHEEX operates an eCommerce store to sell functional bedding and sleepwear focused on the science of sleep and recovery. SHEEX are the world’s first and only performance fabric bedding and sleepwear.

Technology Stack:

The Challenge

There were multiple issues with the eCommerce Platform when we came on board to redesign the infrastructure:

1. The eCommerce site was crashing quite frequently.

2. The AWS cloud infrastructure was not developed to handle the growing demand. It was designed with a single EC2 instance over 3 years ago when the traffic to the site was very low.

3. There was no CDN enabled.

4. The images and static content were being served from the same server.

5. The admin interface for managing content, dashboard, EDI, batch uploads etc. is also being served from the same server.

6. eCommerce landing pages and call center were using the APIs via the main site itself.

7. EDI server would constantly crash.

The Solution

We created a highly available AWS infrastructure using Docker and Kubernetes. With Kubernetes, we created multiple worker nodes with optimized docker containers using the alpine version of docker images where possible to reduce deployment time and increase application performance. We also configured a CI/CD deployment pipeline.

We also divided spree into four separate containers

1. Main site and checkout

2. SPREE API

3. SPREE Admin

4. SPREE EDI

This allowed us to better maintain and monitor SPREE. Dividing the containers also gives us much-needed insight on how many resources were being used at each section of SPREE and allow the development team to optimize the code where needed.

The highest number of requests we received at the time was about 60000 with about 5000 users on the site. We had better monitoring and alert mechanism in place. The eCommerce site never went down in last 4 months. We are now able to manage the maintenance without bringing down the server. The client saw an increased conversion by over 40%. This conversion is very high because of the above infrastructure business is able to put more marketing efforts hence the increased conversion.

Other improvements

We optimized the N+1 queries that were being run by Spree Commerce and used Redis caching heavily for database queries.