...
Code Audit for a Retail Data Platform — Optimize Performance & Cut Costs

Code Audit for a Retail Data Platform — Optimize Performance & Cut Costs

Home / Projects / Code Audit for a Retail Data Platform — Optimize Performance & Cut Costs

Client Overview

Since 1989, our client has provided GIS-based planning tools to support smarter decision-making regarding retail locations, infrastructure, and targeted sales. As their platform matured, performance, cost, and scalability became increasingly critical.

Business Challenge

Common challenges included:

  • icon 1 Long data processing times for statistics and reports
  • icon 2 Increasing cloud infrastructure expensescloud
  • icon 3 Need to modernize legacy approaches and
    streamline DevOps
  • icon 3 The code complexity that made scaling new
    features difficult

To address these issues, we conducted a comprehensive code audit, which allowed us to identify key bottlenecks, redundant logic, and areas with high technical debt. This audit laid the groundwork for targeted improvements across the platform.

Solution

Throughout 2024, our cross-functional team — including developers, DevOps experts, and a dedicated PM — worked in close collaboration with the client on a multi-phase performance optimization plan.

1. Faster Data Calculation

We started with an in-depth code audit that uncovered multiple inefficiencies in the current data processing logic. In response to these discoveries, the DevCom team:

  • Refactored and optimized backend data flows

Problem Discovered: A new connection to the database was created on each iteration of retrieving the data of the same structure.

Code Audit for a Retail Data Platform — Optimize Performance & Cut Costs 1

Pic. 1. Recursive calling for each result of getChildrenByDatasetIdWithSort – many database calls leads to slow performance

Code Audit for a Retail Data Platform — Optimize Performance & Cut Costs 2

Pic. 2. All the elements are received at one database call; then the tree is structured on the Java side

  • Optimized heavy SQL queries by avoiding unnecessary data joiningRefactored and optimized backend data flows

Problem Discovered: The query algorithm starts with a heavier operation when filtering rows after joining instead of to join prefiltered ones.

Code Audit for a Retail Data Platform — Optimize Performance & Cut Costs 3

Pic. 3. Example of not-optimized query with LEFT JOIN operation to the whole large table

Code Audit for a Retail Data Platform — Optimize Performance & Cut Costs 4

Pic. 4. Reorganized algorithm, optimized to use only necessary rows from big tables

  • Significantly reduced the execution time of key statistics reports and Voronoi tools
  • Shifted data preparation to pre-calculation methods
  • Improved Excel generation and report exportin

2. Voronoi Report Enhancements

  • Implemented percentage-based logic for square–polygon intersections
  • Enriched polygon and field correlation data
  • Improved naming, drawing, and layout of polygons

3. DevOps & Infrastructure Optimization

  • Migrated parts of the system to Aurora Serverless and AWS Lambda
  • Separated dependencies and improved task delivery via S3
  • Refined VM configurations for performance
  • Adopted infrastructure-as-code practices
  • Migrated to Hetzner, including DNS and CI/CD

Results

Code Audit for a Retail Data Platform — Optimize Performance & Cut Costs 5

With the Hetzner migration now complete, our next steps include finalizing team-side prerequisites, like Java updates and testing. This migration has already significantly reduced long-term infrastructure costs while maintaining reliability and performance.

Thanks to the initial code audit, the client now has a clear technical roadmap and a cleaner, more scalable codebase, making adopting new features and technologies easier.
The client is now positioned to deliver faster insights at lower costs, with a scalable foundation ready to support more advanced features by 2025.

Technologies used

  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1
  • Tech 1

Want to speed up your analytics platform and reduce cloud costs?

Let’s explore how DevCom’s code audit can help you deliver smarter, faster, and more affordable insights.

    USA HQ

    PO 290333,

    Port Orange, FL 32129

    United States