{"id":18016601,"url":"https://github.com/webassembly/wasi-keyvalue","last_synced_at":"2025-03-26T18:32:20.469Z","repository":{"id":105883610,"uuid":"536175100","full_name":"WebAssembly/wasi-keyvalue","owner":"WebAssembly","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-11T16:48:27.000Z","size":99,"stargazers_count":43,"open_issues_count":14,"forks_count":16,"subscribers_count":17,"default_branch":"main","last_synced_at":"2025-03-22T06:41:52.144Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/WebAssembly.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-09-13T14:49:45.000Z","updated_at":"2025-02-28T01:38:55.000Z","dependencies_parsed_at":"2023-10-26T18:34:07.122Z","dependency_job_id":"13358d15-4160-4296-8094-c775741c28b1","html_url":"https://github.com/WebAssembly/wasi-keyvalue","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":"WebAssembly/wasi-proposal-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-keyvalue","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-keyvalue/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-keyvalue/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WebAssembly%2Fwasi-keyvalue/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WebAssembly","download_url":"https://codeload.github.com/WebAssembly/wasi-keyvalue/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245713039,"owners_count":20660337,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-30T04:18:35.994Z","updated_at":"2025-03-26T18:32:20.143Z","avatar_url":"https://github.com/WebAssembly.png","language":null,"readme":"# WASI Key-Value Store\n\nA proposed [WebAssembly System Interface](https://github.com/WebAssembly/WASI) API.\n\n### Current Phase\n\nWASI Key-Value is currently in [Phase 2](https://github.com/WebAssembly/WASI/blob/main/Contributing.md#2-feature-description-available-wasi-subgroup).\n\n### Champions\n\n- Dan Chiarlone\n- David Justice\n- Jiaxiao Zhou\n- Taylor Thomas\n\n### Portability Criteria\n\n`wasi:keyvalue` must have at least two implementations in terms of relevant mainstream key-value\nstores in each of the following categories:\n\n1. Open-source key-value stores like Redis, Memcached, Etcd etc.\n2. Proprietary key-value stores like AWS DynamoDB, Azure CosmosDB, Google Cloud Firestore etc.\n\nThe implementations must be able to run on Linux, MacOS, and Windows.\n\nA testsuite that passes on the platforms and implementations mentioned above.\n\n### Table of Contents\n\n- [WASI Key-Value Store](#wasi-key-value-store)\n    - [Current Phase](#current-phase)\n    - [Champions](#champions)\n    - [Portability Criteria](#portability-criteria)\n    - [Table of Contents](#table-of-contents)\n    - [Introduction](#introduction)\n    - [Goals](#goals)\n    - [Non-goals](#non-goals)\n    - [API walk-through](#api-walk-through)\n    - [Working with the WIT](#working-with-the-wit)\n    - [References \\\u0026 acknowledgements](#references--acknowledgements)\n    - [Change log](#change-log)\n\n### Introduction\n\nThis `wasi:keyvalue` proposal defines a collection of [interfaces](/wit) for interacting with\nkey-value stores. It additionally defines a [world](/wit/world.wit), `wasi:keyvalue/imports`, that\ngroups together common interfaces including\n\n1. Store operations on single key-value pairs\n2. Atomic operations on single key-value pairs\n3. Batch operations on multiple key-value pairs\n\nThere is also an additional world called `wasi:keyvalue/handle-watch`, which includes the full\n`imports` world as well as a set of interfaces for watching for changes to a key-value store.\n\nThe API is designed to hide data-plane differences between different key-value stores. The\ncontrol-plane behavior/functionality (e.g., including cluster management, data consistency,\nreplication, and sharding) are not specified, and are provider specific.\n\n[Interfaces]:\n    https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#wit-interfaces\n[World]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#wit-worlds\n\n### Goals\n\nThe primary goal of this API is to allow WASI programs to access a wide variety of key-value stores.\nThis means the `wasi:keyvalue` interfaces should be implementable by a wide variety of key-value\nstores, including but not limited to: in-memory key-value stores, on-disk key-value stores, document\ndatabases, relational databases, and either single-node or distributed key-value stores.\n\nThe second goal of `wasi:keyvalue` interfaces is to abstract away the network stack, allowing\napplications that need to access key-value stores to not worry about what network protocol is used\nto access the key-value store.\n\nA third design goal of `wasi:keyvalue` interfaces is to allow performance optimizations without\ncompromising the portability of the API. This includes minimizing the number of copies of data,\nminimizing the number of requests and round-trips, and support for asynchronous operations.\n\n### Non-goals\n\n- The `wasi:keyvalue` interfaces only focus on the most common use cases for key-value stores. It\n  does not attempt to cover all possible use cases.\n- The `wasi:keyvalue` interfaces do not guarantee data consistency except as defined in the\n  interface documentation. Data consistency models (eventual, strong, casual etc.) are diverse and\n  are specific to each key-value store's architecture. The implication is that components importing\n  `wasi:keyvalue` interfaces would need to be aware of the data consistency model of the key-value\n  store they are using.\n- The `wasi:keyvalue` interfaces do not handle data replication and sharding. These are\n  control-plane behaviors that are specific to each key-value store's architecture. Replication\n  needs and sharding management are left to the outside of the `wasi:keyvalue` interfaces.\n- No cluster management is provided. Operational aspects like scaling, node management, and cluster\n  health are to be managed separately from the wasi:keyvalue interface `wasi:keyvalue` interfaces.\n- No built-in monitoring. Monitoring of key-value store performance and health should be done using\n  external tools and not be expected as part of the `wasi:keyvalue` interfaces.\n\n### API walk-through\n\nThe proposal can be understood by first reading the comments of [`world.wit`](./wit/world.wit),\n[`store.wit`](./wit/store.wit), [`atomic.wit`](./wit/atomic.wit), and\n[`batch.wit`](./wit/batch.wit).\n\n### Working with the WIT\n\nBindings can be generated from the `wit` directory via:\n\n```\nwit-bindgen c wit/ --world imports\n```\n\nand can be validated and otherwise manipulated via:\n\n```\nwasm-tools component wit wit/ ...\n```\n\n### References \u0026 acknowledgements\n\nThis proposal was inspired by Dapr's [State API]\n\n[State API](https://docs.dapr.io/developing-applications/building-blocks/state-management/)\n\n### Change log\n\n- 2024-03-29:\n  - Simplified interfaces to 3 key pieces of functionality: store, atomics, and batch. Also removed\n    the use of streams to simplify the starting point of the API\n- 2024-01-16:\n  - Changed the `readwrite` and `batch` interface names to `eventual` and `eventual-batch`. See more\n    details [here](https://github.com/WebAssembly/wasi-keyvalue/pull/30#discussion_r1442282650).\n- 2023-12-19:\n  - Changed the `size` to `incoming-value-size` and it's signature\n- 2023-11-30:\n  - Changed the `get` and `get-many` and `keys` signatures\n  - Updated comments in all the interfaces.\n  - Renamed `wasi-cloud-error` to `wasi-keyvalue-error`\n- 2023-05-17: Updated batch example to use one interface instead of 2\n- 2023-05-25: Change the WITs to the newest syntax.\n- 2023-02-13: The following changes were made to the API:\n  - Added `bucket` type to the `types` interface.\n  - Uses pseudo-stream and pseudo-resource types inspired from [wasi-io\n    ](https://github.com/WebAssembly/wasi-io)\n  - Added \\*.wit files for the interfaces and worlds, which are verified by the\n    [wasm-tools](https://github.com/bytecodealliance/wasm-tools)\n  - Added a inbound-keyvalue interface that handles the `watch` operation.\n- 2023-01-28: The following changes were made to the API:\n  - Changed `stream\u003cT\u003e` type to `list\u003cT\u003e` type because `stream\u003cT\u003e` is not supported by the current\n    version of [\\*.wit](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md).\n  - Removed the worlds section because the star import syntax is not supported by the current\n    version of [\\*.wit](https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md)\n- 2022-11-29: Renamed `bulk-get` to `get-multi` and `bulk-set` to `set-multi` to be consistent with\n  the naming convention of the other interfaces.\n- 2022-10-31: Initial draft\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebassembly%2Fwasi-keyvalue","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebassembly%2Fwasi-keyvalue","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebassembly%2Fwasi-keyvalue/lists"}