Liking cljdoc? Tell your friends :D

konserve-dynamodb

A DynamoDB backend for konserve.

Usage

Add to your dependencies:

Clojars Project

Configuration

(require '[konserve-dynamodb.core]  ;; Registers the :dynamodb backend
         '[konserve.core :as k])

(def config
  {:backend :dynamodb
   :region "us-west-1"
   :table "konserve-demo"
   :id #uuid "550e8400-e29b-41d4-a716-446655440000"
   ;; Optional:
   :access-key "your-access-key"
   :secret "your-secret"
   :consistent-read? false  ;; Default: eventual consistency
   :x-ray? false})          ;; Enable AWS X-Ray tracing

(def store (k/create-store config {:sync? true}))

For API usage (assoc-in, get-in, delete-store, etc.), see the konserve documentation.

Implementation Details

Multi-key Operations

This backend supports atomic multi-key operations (multi-assoc, multi-get, multi-dissoc).

⚠️ Important: All multi-key operations are limited to 100 items due to DynamoDB API constraints. Exceeding this limit will throw an error.

OperationDynamoDB APIAtomicityLimit
multi-assocTransactWriteItemsAtomic (all-or-nothing)100 items
multi-getBatchGetItemEventual/Strong consistency*100 items
multi-dissocTransactWriteItemsAtomic (all-or-nothing)100 items

*Consistency for reads depends on the :consistent-read? option (default: false for eventual consistency).

Authentication

A common approach to manage AWS credentials is to put them into the environment variables as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to avoid storing them in plain text or code files. Alternatively you can provide the credentials in the dynamodb-spec as :access-key and :secret.

License

Copyright © 2024-2026 Christian Weilbach

Licensed under Eclipse Public License (see LICENSE).

Can you improve this documentation?Edit on GitHub

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close