Add batch insert operations to storage system#282
Open
wbssbw wants to merge 9 commits intoobelisk:storage/refactor-apisfrom
Open
Add batch insert operations to storage system#282wbssbw wants to merge 9 commits intoobelisk:storage/refactor-apisfrom
wbssbw wants to merge 9 commits intoobelisk:storage/refactor-apisfrom
Conversation
f0a8dbb to
1800586
Compare
… storage provider
1800586 to
7fa9ab7
Compare
obelisk
requested changes
Mar 13, 2026
Owner
obelisk
left a comment
There was a problem hiding this comment.
Is there a reason sled is not implemented? Also pending discussion.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements
insert_batchandinsert_batch_sharedfunctions for the storage system, enabling atomic insertion of multiple key/value pairs in a single operation. This improves performance for bulk storage operations and reduces round trips between guest modules and the storage layer.Changes
Runtime Storage Functions (
runtime/plaid/src/functions/storage/)insert_batchandinsert_batch_sharedhost functions that accept JSON-serialized arrays ofItemstructsStorage Provider Implementations (
runtime/plaid/src/storage/)insert_batchtrait method toStorageProviderTransactWriteItemsfor atomic batch writesUnimplementederrorStandard Library (
runtime/plaid-stl/src/plaid/storage.rs)Itemstruct for representing key/value pairs with Serde supportinsert_batch(&[Item])andinsert_batch_shared(namespace, &[Item])functions for guest modulesTesting
insert_batchtest case totest_dbmodule demonstrating bulk insertion with pipe-separated key=value pairsError Handling
StorageErrorvariants:Unimplemented,BuildError,BatchWriteErrorRationale
Individual insert operations require multiple host function calls and storage provider round trips. Batch insertion reduces overhead for bulk data scenarios and enables atomic multi-item writes where supported (e.g., DynamoDB transactions).