惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
Security Latest
Security Latest
P
Proofpoint News Feed
GbyAI
GbyAI
PCI Perspectives
PCI Perspectives
博客园 - Franky
N
Netflix TechBlog - Medium
博客园_首页
WordPress大学
WordPress大学
K
Kaspersky official blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Vercel News
Vercel News
T
Threatpost
The Hacker News
The Hacker News
H
Help Net Security
S
Securelist
Recent Announcements
Recent Announcements
腾讯CDC
T
Tailwind CSS Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Engineering at Meta
Engineering at Meta
C
Cisco Blogs
V
V2EX
C
Check Point Blog
S
Schneier on Security
Cyberwarzone
Cyberwarzone
C
Cybersecurity and Infrastructure Security Agency CISA
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
B
Blog RSS Feed
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Jina AI
Jina AI
M
MIT News - Artificial intelligence
T
Threat Research - Cisco Blogs
博客园 - 叶小钗
A
Arctic Wolf
AWS News Blog
AWS News Blog
Latest news
Latest news
Martin Fowler
Martin Fowler
Recorded Future
Recorded Future
Last Week in AI
Last Week in AI
The GitHub Blog
The GitHub Blog
小众软件
小众软件
B
Blog
aimingoo的专栏
aimingoo的专栏
C
Cyber Attacks, Cyber Crime and Cyber Security
V
Visual Studio Blog
P
Palo Alto Networks Blog
Spread Privacy
Spread Privacy

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything BFF模式详解:构建前后端协同的中间层 I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
How Shared GraphQL Fragments Silently Killed Our List Performance
Ryo Tsugawa · 2026-05-24 · via DEV Community

Something felt slow

Our product backlog list page was sluggish. Not dramatically broken — just… off. The kind of slowness you notice when you switch from a fresh demo tenant to a real one with actual data.

So I measured it:

  • 8 items: 206ms TTFB (Time To First Byte)
  • 67 items: 675ms TTFB

That's a +469ms difference, or roughly 8ms per item of linear degradation. Every single backlog item added ~8ms to the response time. Not great.

The first instinct was to blame the frontend — maybe the component tree was re-rendering too aggressively. But TTFB ruled that out immediately. The browser hadn't even started rendering; the server was taking that long to respond.

So the bottleneck was somewhere between the API server and the database. Time to dig deeper.

How our preloading works

We run Go + gqlgen + GORM on Cloud Run, talking to Cloud SQL (MySQL). The GraphQL layer is designed around a simple principle:

The client requests only the fields it needs. The server preloads only what's requested.

In practice, our resolver inspects the incoming GraphQL selection set and translates it into GORM Preload() calls. If the frontend asks for tasks { assignees { user } }, the backend dutifully preloads Tasks → Assignees → User. If it only asks for tasks { backlogStatus }, we only preload Tasks → BacklogStatus.

This is the "right" design. The backend trusts the frontend to declare its data needs accurately, and responds with exactly that — no more, no less.

In theory.

What was actually happening

Here's the GraphQL query our list page was firing (simplified):

query GetProductBacklogItems($projectId: ID!) {
  productBacklogItems(projectId: $projectId) {
    edges {
      node {
        id
        name
        storyPoint
        priority
        progress
        backlogStatus { id name status }
        tasks {
          ...SubTaskFields
        }
      }
    }
  }
}

And SubTaskFields looked like this:

fragment SubTaskFields on Task {
  id
  name
  backlogStatus { id name status }
  assignees {
    user { id givenName familyName }
  }
}

See the problem? The list page was requesting tasks { ...SubTaskFields }, and SubTaskFields includes assignees { user { ... } }.

The list page doesn't display task assignees. Not a single component on that page reads task.assignees. But the query was asking for it anyway.

On the backend, this triggered a 4-level preload chain — executed once per backlog item:

Level Preload
1 Tasks
2 Tasks.BacklogStatus
3 Tasks.Assignees
4 Tasks.Assignees.User

For 67 items, that's 67 × 4 cascading database lookups. Every single one hitting Cloud SQL over the network. No wonder it was linear.

Why nobody caught it

This is the frustrating part: the Fragment was doing exactly what it was supposed to do — in a different context.

We have two views for backlog items:

  1. List view — shows name, status, story points, progress. No task-level assignee info.
  2. Detail view — shows everything, including who's assigned to each subtask.

The detail view legitimately needs assignees { user } inside SubTaskFields. That Fragment was written for the detail view, and it was correct there.

The list view just… borrowed it. Same Fragment, different context, wildly different performance characteristics.

At small scale, nobody noticed. 8 items × 4 preloads adds maybe 64ms. That's noise. But once you hit 50+ items, the linear cost becomes painfully visible.

There's another factor: local dev machines are too fast. In development, the database is either local or in a nearby Docker container — network round-trip is essentially zero. Each preload costs microseconds, so even 4 levels feel instant. In production, every preload is a network hop between Cloud Run and Cloud SQL. That per-hop latency, multiplied by 4 levels × N items, is what turned an invisible overhead into a real bottleneck.

The lesson: GraphQL Fragments are a convenience for the developer, not a contract about data needs. When you share a Fragment across views with different display requirements, you're silently opting into preloads you don't need.

The fix

Step 1: Remove the unnecessary field from the list query

The obvious move — stop asking for tasks { ...SubTaskFields } in the list query:

query GetProductBacklogItems($projectId: ID!) {
  productBacklogItems(projectId: $projectId) {
    edges {
      node {
        id
        name
        storyPoint
        priority
        progress
        backlogStatus { id name status }
        # tasks removed — list page doesn't render subtask details
      }
    }
  }
}

But there's a catch.

Step 2: The progress field still needs task data

The progress percentage on each backlog item is computed server-side from its child tasks. Specifically, it counts how many tasks are completed vs. total. To do that, the server needs to load Tasks and Tasks.BacklogStatus.

If the frontend stops requesting tasks, the backend stops preloading them, and progress silently returns 0 for everything. That's worse than slow.

Step 3: The EnhanceFields pattern

We already had an established pattern for this: field injection helpers that ensure required preloads exist regardless of what the frontend asks for. We use the same approach for project stats and team stats.

The idea is simple: before passing the requested fields to the preload layer, check whether the fields needed for server-side computation are present. If not, inject them.

func enhanceFields(fields []string) []string {
    // If the client didn't ask for "tasks" at all,
    // inject the minimum needed for progress calculation.
    if !contains(fields, "tasks") {
        fields = append(fields, "tasks", "tasks.backlogStatus")
    }
    return fields
}

In the resolver, this helper sits between the selection set parser and the preload builder:

func (r *resolver) ListItems(ctx context.Context, ...) {
    fields := enhanceFields(getRequestedFields(ctx))
    // fields is now guaranteed to include "tasks" + "tasks.backlogStatus",
    // but NOT "tasks.assignees" or "tasks.assignees.user"
    items := r.repo.FindAll(ctx, filters, fields)
    // ...
}

The key insight: the list and detail views now have asymmetric preload depths. The detail view still gets all 4 levels (the frontend asks for them). The list view gets only 2 — just enough to compute progress, without dragging in assignee data it never displays.

The result

Before After
Frontend requests tasks { backlogStatus, assignees { user } } (doesn't request tasks)
Backend preloads Tasks → BacklogStatus → Assignees → User Tasks → BacklogStatus
Preload depth 4 2
TTFB (67 items) 675ms 135ms

5× faster. The ~8ms/item linear degradation effectively disappeared.

And the best part: the detail view is completely unaffected. It still requests tasks { ...SubTaskFields }, and the EnhanceFields helper is a no-op when hasTasks is already true. Zero behavioral change for the detail page.

What I'd do differently

A few takeaways from debugging this:

  • TTFB is your first diagnostic. If TTFB scales linearly with item count, the problem is server-side. Don't waste time profiling React renders until you've ruled out the API.

  • Fragments are a DX convenience, not a data contract. The moment you share a Fragment across views that render different sets of fields, you've created an invisible coupling between those views' performance profiles. Consider having SubTaskFieldsList and SubTaskFieldsDetail instead of one shared Fragment.

  • "The server only loads what you ask for" only works if you ask correctly. GraphQL's promise of precise data fetching relies on the query author being precise. The server is faithfully doing what it's told — the problem is always in what you're telling it.

  • Linear degradation hides in small datasets. 8ms/item is invisible at 8 items. It's a wall at 100. If you only test with seed data, you'll never catch this class of issue. Profile with production-scale data counts.


This article is based on a real performance fix in Lasimban, a task management SaaS built for Scrum teams. It's free to use — no credit card required.

Try Lasimban for free → lasimban.team

Lasimban - Scrum-Focused Task Management Tool

Make Scrum development more intuitive and enjoyable. Lasimban is a Scrum-focused task management tool that shows your team the right direction.

favicon lasimban.team


Have you run into similar Fragment-sharing traps in your GraphQL setup? I'd be curious to hear how other teams handle the list-vs-detail preload split.