Proposal: Transition to Batch Record Processing
To resolve the systemic rate-limiting issues identified in #13, all data ingestion tools within this monorepo must be refactored to utilize the com.atproto.repo.applyWrites endpoint instead of sequential createRecord calls.
Architectural Plan:
- Batch Aggregation: Implement a buffering layer to group records into batches of 50-100 operations.
- Atomic Transactions: Use
applyWrites to commit these batches in single XRPC transactions, reducing network round-trips and PDS overhead.
- Dynamic Rate-Limit Awareness: Monitor
ratelimit-remaining headers to adaptively throttle the ingestion process, preventing service lockouts for the user.
- MST Optimization: Leverage single-root computation per batch to improve PDS performance.
This refactor will first target the core malachite ingestion engine before expanding to other croft.click utilities.
Associated Pull Requests:
- Branch:
refactor/batch-import-optimization
References:
- Bitcoin Taproot Scaling Analysis (signature aggregation as analogy for batch optimization)
- AT Protocol:
com.atproto.repo.applyWrites specification
Proposal: Transition to Batch Record Processing
To resolve the systemic rate-limiting issues identified in #13, all data ingestion tools within this monorepo must be refactored to utilize the
com.atproto.repo.applyWritesendpoint instead of sequentialcreateRecordcalls.Architectural Plan:
applyWritesto commit these batches in single XRPC transactions, reducing network round-trips and PDS overhead.ratelimit-remainingheaders to adaptively throttle the ingestion process, preventing service lockouts for the user.This refactor will first target the core
malachiteingestion engine before expanding to othercroft.clickutilities.Associated Pull Requests:
refactor/batch-import-optimizationReferences:
com.atproto.repo.applyWritesspecification