Skip to content

feat(db): async gcore:db/kv — execute/batch return pollable futures - #11

Closed
godronus wants to merge 4 commits into
feat/db-interface-asyncfrom
feat/db-interface-kv-async
Closed

godronus wants to merge 4 commits into
feat/db-interface-asyncfrom
feat/db-interface-kv-async

Conversation

@godronus

@godronus godronus commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Base feat/db-interface-async (#9), with feat/db-interface-kv (#10) merged in. Until #10 merges, this diff also shows the kv-types + kv-sync commits. The new parts are the merge and 09f4443.

  • deps/db/kv.wit: interface gcore:db/kv, the async variant of kv-sync. database.execute(op) and batch(ops) return future-op-result / future-batch-result (subscribe() -> pollable, get(), result returned once). open stays synchronous. Reuses kv-types op / op-result.
  • world reactor-async imports gcore:db/kv@0.1.0 beside gcore:db/sql; world reactor is unchanged (kv-sync).

The WIT documents the ordering rule: calls already started run independently. Read-your-writes holds for a call started after an earlier call's result is ready. Dropping a future abandons the result, and the operation may or may not have been applied.

Decisions needed

# Decision Proposal
1 execute(op) instead of a method per op Two future types instead of seven; maps 1:1 onto the host's KvBackend::execute. The SDKs keep get, set, ... on top
2 Ship async KV for JS Yes, as for SQL: Promise.all of 3 gets takes 48 ms, against 147 ms awaited in turn

Engine design + measurements: docs/db/KV_ASYNC.md in G-Core/FastEdge (branch feat/db-interface-kv-async).

Related: #9 (base), #10 (merged in), G-Core/FastEdge#662, G-Core/FastEdge-sdk-js#159

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant