From 10+ Seconds to Under One: Solving Their Slowest Operation - WunderGraph

TL;DR:

A growing personal finance marketplace hit severe planning delays on its Apollo Gateway, with complex queries taking more than 10 seconds and blocking traffic. After migrating to WunderGraph Cosmo and enabling the Cache Warmer, planning latency dropped by roughly 90–95 percent, and previously slow operations became 12–18 times faster.

The Limits of an Aging Gateway

A personal finance marketplace ran its platform on Apollo Federation, with a Node.js Apollo Gateway in front of roughly 10 subgraphs. Many of the subgraphs were Node services, with one written in Go. The setup worked when they supported fewer product lines, but as the system expanded, the gateway became a bottleneck. Complex requests began exposing long planning times. For example, some queries took more than 10 seconds to plan, and while they waited, other requests stacked up behind them.

Why the Problems Were Hard to Fix

The team attempted to prewarm slow queries with a custom script. This helped until a new slow query surfaced. A modern graph needs fast planners, safe composition, and predictable cold-start behavior. It needs visibility across subgraphs and a way to handle new query shapes without adding risk.

Defining the Requirements for a New Router

The team documented their requirements: strong Federation support, better performance on complex paths, lower maintenance weight, and the removal of the upgrade blocks that prevented them from shipping features.

Choosing WunderGraph Cosmo

WunderGraph Cosmo matched their requirements and included direct engineering support. Early in assessment, they found gaps around some Federation features addressed by the WunderGraph team.

A Phased Migration That Protected Customer Traffic

They followed a phased rollout. First, they matched the Cosmo Router to the gateway feature set. If they found any roadblocks during this process, they worked with the WunderGraph team to resolve them.

Gaining Clear Visibility Into the Graph

As the platform grew, the team needed a clearer view of request paths and system behavior. Cosmo Studio provided this with traces, analytics, and schema visibility.

Fixing Long Query Planning Times

The gateway struggled the most with heavy planning paths. Enter Cosmo’s Cache Warmer. It preplanned the slowest queries before serving traffic. After enabling the Cache Warmer, they shared performance data indicating that operations dropped to sub-second execution after warming.

What the Super Bowl Prep Revealed

During Super Bowl traffic preparation, it became clear that the real issue wasn’t throughput, but router instances starting with empty query-plan caches. To avoid this, the preparation work warmed the query-plan cache ahead of traffic.

Stable Performance and Safer Operations

Performance improved and long planning times no longer block unrelated traffic. Migrating to Cosmo provided a stable federated layer.

Why This Pattern Matters for Other Teams

Many teams encounter these issues as they scale. Cosmo helps resolve these issues at the root. The Cache Warmer eliminated heavy planning paths and removed cold-start hazards, giving the team a stable platform that could support real growth.