data-performance-optimization

Community

Speed up data access end-to-end.

AuthorSwear4
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Data-heavy applications often suffer from over-fetching, N+1 query patterns, and inefficient pagination, leading to slow responses and high resource usage.

Core Features & Use Cases

  • Projections: enforce explicit field projections on MongoDB queries to minimize data transferred.
  • Cursor-based pagination: replace skip() with cursor-based pagination, including complex cursors for non-unique sort fields, with index guidance.
  • N+1 elimination: apply aggregation pipelines with $lookup or batched $in queries to minimize round-trips.
  • Frontend data access: standardize data fetching via TanStack Query with explicit staleTime and correct invalidation strategies.
  • Use Case: optimize a dashboard displaying thousands of records from MongoDB with minimal latency and predictable memory usage.

Quick Start

Replace all full-document fetches with explicit projections, switch pagination to cursor-based methods, and consolidate frontend data fetching with TanStack Query.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: data-performance-optimization
Download link: https://github.com/Swear4/agent_rules/archive/main.zip#data-performance-optimization

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.