Skip to main content

DynamoDB

AWS DynamoDB for state storage.

Setup

Quick Start

Storage Schema & Migration

Hash fields live in a native DynamoDB Map attribute called hash, with automatic lazy migration from the legacy JSON-string format. Hash fields are stored in a native Map attribute (hash) on each item. Earlier versions kept them inside a JSON-encoded string under value. Migration is automatic and lazy. On the first hset or hdel against a legacy key, the store reads the JSON-string value, seeds the native hash map via SET #h = if_not_exists(#h, :seed), then applies the field write. hget and hgetall transparently read either representation. No manual migration script is required and no downtime is needed. Reads keep working against un-migrated items.

Item shape after migration

Legacy shape (still readable)

Legacy items remain readable and are migrated in place on the next mutation.

Behavior & Guarantees

Hash writes are atomic and TTL is honoured on every read path.

Atomic hash writes

hset uses UpdateExpression: SET #h.#f = :val, updated_at = :now, and hdel uses REMOVE #h.#f1, #h.#f2, ... with ConditionExpression: attribute_exists(pk). Concurrent writers on different fields of the same key no longer clobber each other.

TTL on hget/hgetall

hget and hgetall now return None/{} for keys whose stored ttl is in the past, matching the behaviour of get.
Native hash map storage, atomic writes, and TTL on hget/hgetall apply as of PraisonAI #4215.

Best Practices

Use hset(key, field, value) per field. The atomic UpdateExpression on the native map means concurrent writers on different fields never lose writes.
Legacy JSON-string items migrate in place on their next hset/hdel. Reads keep working throughout β€” no script, no downtime.
Expired keys return None/{} from get, hget, and hgetall alike, so stale reads are consistent regardless of access method.

Firestore

Google Cloud Firestore state store with scoped credentials

Recipe Serve

Serve recipes over HTTP backed by a state store