effect-batching
CommunityBatch and deduplicate requests with resolvers.
Software Engineering#observability#deduplication#effect#resolver#n+1 problem#request batching#sqlresolver
Authormpsuesser
Version1.0.0
Installs0
System Documentation
What problem does it solve?
It prevents N+1 query problems by batching many concurrent lookups into fewer resolver executions, while deduplicating identical requests inside the batch window.
Core Features & Use Cases
- Automatic request batching & deduplication: Use Effect.request with Request and a RequestResolver to collect concurrent requests and resolve them together.
- Precise resolver control: Implement resolvers that must complete every entry, with utilities for pure, effectful, grouped, tagged, and combinator-based resolver behavior.
- Batch tuning, caching, and observability: Configure delay, batch size, and caching, and add spans for tracing batch execution details.
- SQL-aware batching integration: Use SqlResolver (ordered, grouped, findById, void) for schema-validated batched SQL execution with transaction awareness.
- Use Case: When fetching users by ID for 200 items, define a per-item GetUserById request and let the resolver batch them into a single fetch, returning typed errors for misses.
Quick Start
Use the effect-batching skill to implement a RequestResolver that batches GetUserById lookups into one fetch and deduplicates identical IDs automatically.
Dependency Matrix
Required Modules
None requiredComponents
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: effect-batching Download link: https://github.com/mpsuesser/pi-effect-harness/archive/main.zip#effect-batching Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.