July 26th, 2024

90% of performance is data access patterns

A recent analysis revealed that 90% of application performance issues arise from data access patterns. A platform team improved performance by eliminating redundant API requests, reducing daily calls significantly and enhancing latency.

Read original articleLink Icon
90% of performance is data access patterns

A recent analysis highlighted that 90% of application performance issues stem from data access patterns. A platform team faced a significant performance bug linked to excessive API requests, particularly from a session middleware that fetched patient appointment histories unnecessarily. Initially, this caching method was effective when user numbers were low, but as the application evolved into a more complex single-page application, the inefficiencies became apparent. The middleware was causing a bottleneck by repeatedly fetching appointment data, leading to increased CPU usage and latency.

Upon investigation, it was discovered that the client application no longer required this data to be fetched on every request, as it had its own method for retrieving appointments. By removing a single line of code that triggered the redundant fetching, the team reduced the number of daily calls from 150,000 to 1,000, resulting in a 66% drop in CPU usage and a significant improvement in latency across all API requests.

This experience underscores the importance of observability in software development, as it allows teams to identify and address performance issues before they escalate into outages. The lesson learned is that while code may have been appropriate at the time of writing, changes in the environment necessitate ongoing evaluation and adaptation to maintain performance.

Related

Serving a billion web requests with boring code

Serving a billion web requests with boring code

The author shares insights from redesigning the Medicare Plan Compare website for the US government, focusing on stability and simplicity using technologies like Postgres, Golang, and React. Collaboration and dedication were key to success.

Bad habits that stop engineering teams from high-performance

Bad habits that stop engineering teams from high-performance

Engineering teams face hindering bad habits affecting performance. Importance of observability in software development stressed, including Elastic's OpenTelemetry role. CI/CD practices, cloud-native tech updates, data management solutions, mobile testing advancements, API tools, DevSecOps, and team culture discussed.

Four lines of code it was four lines of code

Four lines of code it was four lines of code

The programmer resolved a CPU utilization issue by removing unnecessary Unix domain socket code from a TCP and TLS service handler. This debugging process emphasized meticulous code review and system interaction understanding.

How we tamed Node.js event loop lag: a deepdive

How we tamed Node.js event loop lag: a deepdive

Trigger.dev team resolved Node.js app performance issues caused by event loop lag. Identified Prisma timeouts, network congestion from excessive traffic, and nested loop inefficiencies. Fixes reduced event loop lag instances, aiming to optimize payload handling for enhanced reliability.

Data Fetching for Single-Page Apps

Data Fetching for Single-Page Apps

Efficient data fetching in single-page applications is crucial for responsiveness. Key patterns include Asynchronous State Handler, Parallel Data Fetching, Fallback Markup, Code Splitting, and Prefetching. Optimizing data fetching enhances application performance universally.

Link Icon 2 comments
By @8note - 4 months
I'm not sure about the lessons learned.

Clearly somebody did a migration to move the data source on the UI for appoints from that call to something else, but didn't include removing the old way.

From a rest-y-ness perspective, I think this would also show up as an API smell, of returning something that should be paginated as part of an API call whose purpose is to do something else. Design review should really have caught this

By @leecommamichael - 4 months
Okay, but how did the data get there?