Cloud App Dev

Multi-Billion Dollar Supermarket Chain Improves Performance, Security, And Application Scalability

Overview

Our client is a multi-billion dollar US-based supermarket chain with over 350 stores throughout the country that consistently ranks as one of the top privately-owned companies and amongst the best retailers in the USA. However, to keep up with the growing importance of speed, efficiency, and reliability in the last mile delivery sector, our client needed a new logistics solution – one that leveraged the latest technology and could help secure a comfortable lead over other major players in the industry.

D3V identified and overcame major challenges in the workflows surrounding last-mile delivery which allowed the company to reach peak performance and efficiency.

The Challenges

Lack of Scalability

One of the biggest challenges faced by our client was their lack of scalability. The ability to quickly respond to periods of high and idle loads was very limited in their existing infrastructure. This also meant that our client could not fully utilize seasonal sales and promotions.

Security Vulnerabilities

Our retailer’s massive reach attracted significantly higher traffic during promotions. A few promotions also attracted malicious traffic that posed a threat to the server’s stability and security. The bad IP addresses could also negatively alter the legitimate user’s shopping experience.

Performance Bottleneck in Last-Mile Routing

Last-mile delivery refers to the final leg of the delivery that ends at the shopper’s doorstep. This is often the most crucial and expensive part of the delivery process. In order to ensure a timely, safe, and cost-efficient delivery, the last-mile routing must be imperative. However, our client was suffering from a performance bottleneck during routing which consumed 95% of the time for generating the routing solution.

Key Accomplishments

Automating Routing with Google OR Tools

As the company grew, manually routing and assigning customer orders to drivers for last-mile delivery became a bottleneck. With a limited number of dispatchers, our client wanted an intelligent solution that would help remove this bottleneck and reduce the burden on dispatchers.

We leveraged Google OR Tools to automate the entire routing process as well as programmed the system to automatically assign orders to drivers for maximum efficiency. This resulted in a 75 percent drop in manual tasks and also allowed the business to divert the newly freed human resource to providing valuable support to a growing customer base.

D3V’s solution was programmed in a way to make future enhancements and improvements easy to integrate and highly scalable.

User-friendly Dashboard for Tracking and Organizing Deliveries with Demand & Supply Prediction

We also created an intuitive and user-friendly UI that displays all of the current customer orders to help organize deliveries. The solution also tracked and displayed the number of current orders and the available roster of drivers. It also predicted driver requirements (at a given hour at a given store/area. etc) and send automated SMS alerts to drivers.

The ability to accurately track and organize with so much control allowed our client to improve productivity and significantly reduce human error.

Using Google Kubernetes Engine (GKE) for Increased Scalability

Google Kubernetes Engine (GKE) was an ideal solution for these business challenges. GKE is an open-source container orchestrator that can run anywhere: on-premises, VM, public cloud, etc. A multi-zonal GKE cluster (to handle zonal outages) was set up with connectivity to a managed Cloud SQL database by a team of cloud-certified D3V engineers. In addition, several compelling tools, such as Skaffold, facilitated the need to deploy frequent software updates to the GKE Cluster. Additionally, Leveraging Horizontal Pod Autoscaler (HPA) feature in Google Kubernetes Engine (GKE) application was used to scale out when there was demand and scale down during an idle period.

Overall, the Kubernetes Engine (GKE) helped the client cut down on operations cost through efficient scaling and also roll out new features and updates more quickly.

Filtering Web Traffic with AWS ELB Features

To combat the surge of bad IP addresses and malicious traffic during promotions, D3V engineers wrote custom scripts to parse and analyze various applications and web server log files to filter bad web requests. Then, we looked for a solution at the Apache layer, followed by the application layer, and finally zeroed in on the load balancer layer. Post evaluation, the managed security solution from AWS called AWS WAF was selected and deployed along with the Application Load Balancer (ALB). This helped to filter traffic before it reached the Apache server.

This resulted in a reduced manual analysis effort and secured the application Infrastructure from malicious traffic. We were also able to reduce the database CPU performance from 100% to around 35% and the average response time was reduced by 3x.

10x Performance in Last-Mile Routing with Google Distance Matrix

D3V engineers ran multiple comprehensive performance analysis and tests to figure out the root cause of the performance bottleneck in the routing process. The problem, as it turned out, was in the construction of a cost matrix for the routing solution, that used sequential API calls made to Google APIs, to determine the distance and estimated time among the routing points such as customers, drivers, and storage centres.

To overcome this bottleneck, D3V engineers developed a customized generic solution to construct the cost matrix using Google Distance Matrix API, which eliminated this performance bottleneck and diminished the time consumption by a factor of 10X.

This solution was still challenging to achieve due to the limitation with the Google Distance Matrix API, which caps the total combination of source and destination inputs to 100 elements. With our customized generic solution we were able to work around this limitation and develop modular reusable components for the generic solution, that catered to various cost matrix size permutations based on the unique requirements for each routing problem, which frequently exceeded the limitation of 100 elements with various sizes of the source and destination points.

Together, these innovative solutions have helped this market leader extend its advantages over competitors and pave the way for future advancements.