A legacy PHP-based loyalty platform was struggling with crippling latency as its user base grew, primarily due to unoptimized database queries and monolithic data processing.
The existing system used complex SQL joins that fetched entire datasets (millions of rows) into memory for processing, leading to frequent timeouts and high server costs. There was no pagination at the database level, and the system lacked modern APIs for integration with third-party partners. The goal was to modernize the codebase, optimize the data layer for sub-second responses, and implement a new suite of performant REST APIs.