From 931f3def9fb0627fbd346b7f0f4abf896299d88f Mon Sep 17 00:00:00 2001 From: Heyang Zhou Date: Tue, 13 Aug 2024 02:32:57 +0800 Subject: [PATCH] Add KV transaction limits (#705) --- deploy/kv/manual/transactions.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/deploy/kv/manual/transactions.md b/deploy/kv/manual/transactions.md index b59adadc5..7d30a2dd5 100644 --- a/deploy/kv/manual/transactions.md +++ b/deploy/kv/manual/transactions.md @@ -91,3 +91,19 @@ atomic operation, setting the new balances with the versionstamp constraints. If the transaction is successful, the loop exits. If the version constraints are violated, the transaction fails, and the loop retries the transaction until it succeeds. + +## Limits + +In addition to a max key size of 2 KiB and max value size of 64 KiB, there are +certain limits with the Deno KV transaction API: + +- **Max keys per `kv.getMany()`**: 10 +- **Max limit per `kv.list()`**: 1000 +- **Max checks in an atomic operation**: 100 +- **Max mutations in an atomic operation**: 1000 +- **Max total size of an atomic operation**: 800 KiB. This includes all keys and + values in checks and mutations, and encoding overhead counts toward this limit + as well. +- **Max total size of keys**: 90 KiB. This includes all keys in checks and + mutations, and encoding overhead counts toward this limit as well. +- **Max watched keys per `kv.watch()`**:10