Logo von Dynamodb

Dynamodb

Community
ericrisco
dynamodb

Use when modeling or operating a DynamoDB table: deriving partition/sort keys from access patterns, single-table vs table-per-entity, adding a GSI/LSI, on-demand vs provisioned capacity, or diagnosing hot-partition throttling. NOT relational schema/SQL/EXPLAIN (that is `postgresdb`), NOT aggregation-pipeline document modeling (that is `mongodb`).

Übersicht

Herausgeberericrisco
Repositoryrsc-harness
Skill-Namedynamodb
Sterne
239
Forks
24
Mitgelieferte Dateien
4
LizenzMIT
Links
  • Anweisungen in Markdown

    Eine SKILL.md-Datei, die das Modell bei Bedarf lädt. So werden nur dann Token verbraucht, wenn eine Anfrage tatsächlich dazu passt.

  • Funktioniert mit jedem LLM

    KI-Skills bestehen aus reinem Markdown, nicht aus anbieterspezifischem Code. Daher funktionieren sie mit GPT, Claude, Gemini, Grok oder einem lokalen Modell.

  • Mitgelieferte Dateien: 4

    Skripte, Vorlagen und Referenzmaterial, die das Modell bei der Arbeit lesen kann. Die Dateien sind schreibgeschützt und werden niemals ausgeführt.

  • Open Source

    Von ericrisco auf GitHub veröffentlicht. Prüfen Sie vor der Installation die Quelldateien.

Installation

Installieren Sie den KI-Skill Dynamodb in TypingMind, um ihn mit jedem LLM zu nutzen, oder fügen Sie ihn einem anderen Agenten hinzu, der SKILL.md lesen kann.

1

In TypingMind installieren

TypingMind installiert einen Skill direkt aus seinem GitHub-Ordner. Dabei liest die App SKILL.md, bündelt die Ressourcendateien und speichert das Ergebnis lokal.

  1. Öffnen Sie die App und gehen Sie zu Plugins → Skills.
  2. Wählen Sie „Von GitHub installieren“.
  3. Fügen Sie die unten angegebene URL des Skill-Ordners ein und bestätigen Sie.
    https://github.com/ericrisco/rsc-harness/tree/main/skills/dynamodb
  4. Aktivieren Sie den Skill in jedem Chat, in dem er verfügbar sein soll.
Plugins → Skills → Skill hinzufügen → Über GitHub-URL. Fügen Sie dann die Ordner-URL ein und klicken Sie auf „Weiter“.
2

In einem anderen Agenten installieren

Jeder Agent, der das Agent-Skills-Format unterstützt, kann diesen Skill nutzen. Kopieren Sie den Ordner in das Skill-Verzeichnis des jeweiligen Agenten.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ericrisco/rsc-harness.git /tmp/rsc-harness
mkdir -p .claude/skills
cp -r /tmp/rsc-harness/skills/dynamodb .claude/skills/dynamodb
Starten Sie Claude Code nach dem Kopieren neu, damit der neue Skill erkannt wird.

In TypingMind verwenden

Aktivieren Sie Dynamodb in einem beliebigen Chat in TypingMind. Den Rest übernimmt das Modell. Name und Beschreibung des Skills stehen im System-Prompt. Sobald eine Anfrage passt, lädt das Modell selbstständig die vollständigen Anweisungen — Sie müssen den Skill nie manuell aufrufen, und er verbraucht erst Token, wenn er tatsächlich genutzt wird.

Das Modell lädt Dynamodb automatisch, sobald eine passende Anfrage gestellt wird.

Funktioniert mit jedem KI-Modell

KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher ist Dynamodb nicht an das Modell gebunden, für das der Skill geschrieben wurde. Installieren Sie ihn einmal in TypingMind und nutzen Sie ihn mit GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder einem selbst betriebenen lokalen Modell — alles mit Ihren eigenen API-Schlüsseln.

  • Wird nur bei Bedarf geladen

    Der System-Prompt enthält nur den Namen und die Beschreibung. Die Anweisungen werden bei der ersten passenden Anfrage geladen. Ein ungenutzter Skill verursacht daher keine Kosten.

  • Modell im laufenden Chat wechseln

    Da der Skill aus Anweisungen statt aus Code besteht, funktioniert er auch nach einem Modellwechsel — das nächste Modell liest dieselbe SKILL.md-Datei.

Skill-Anweisungen

Dies ist der Inhalt von SKILL.md, den das Modell lädt. Lesen Sie ihn vor der Installation — ein Skill besteht aus Anweisungen, denen Ihr Modell folgt.

DynamoDB — access-pattern-first modeling and capacity

DynamoDB is not a relational database with a different syntax. It has no joins, no ad-hoc queries, no server-side aggregation, and it punishes schema changes after launch. So the modeling discipline IS the work: enumerate every read and write the app must perform, THEN design keys so each one is a single GetItem or Query. Add an index only when the base table physically cannot serve a pattern. Decide capacity last.

Your job here is to stop the user from treating DynamoDB like SQL.

What you produce / what you refuse

You deliver three artifacts, in this order:

  1. An access-pattern list — a table of every query and write, with key condition, read/write, frequency, and what serves it. This is the contract the keys must satisfy.
  2. A key-design document — entity → PK/SK encoding → which table or named GSI serves each pattern.
  3. A capacity + cost recommendation — on-demand vs provisioned vs reserved, and the hot-partition risk.

You refuse to: click through the AWS console, wire the IaC/CI provisioning pipeline (that is ../deployment/SKILL.md), or model the data as normalized tables you then "join" in application code. You emit DDL, IaC snippets, and example SDK calls — you do not provision the infrastructure.

The steps below run in sequence — access patterns, then keys, then indexes, then capacity. Reordering them is the single most common DynamoDB mistake.

Step 1 — Enumerate access patterns

You cannot query what your keys do not express, and there is no WHERE over arbitrary columns, so produce this table before you name a single attribute. It is also exactly what scripts/verify.sh checks: run scripts/verify.sh <path-to-key-design.{md,json}> and every row must carry a key target (pk/sk or a named gsi) and a query_type. It FAILS on any pattern served by Scan, WARNS on FilterExpression, and asserts ≤20 GSIs / ≤5 LSIs. Read-only; exits 0 on an empty or clean target.

patternentitykey conditionread/writeest. freqserved by
Get a user by idUserPK=USER#<id>readhighbase table GetItem
Get a user's orders, newest firstOrderPK=USER#<id>, SK begins_with ORDER#readhighbase table Query
Look up a user by emailUserGSI1PK=EMAIL#<email>readmediumGSI1 Query
List open orders across all usersOrdersparse GSI2PK=OPENreadlowGSI2 (sparse) Query

Bad → Good. The whole game is moving from vague to executable:

  • Bad: "store users and orders." (No key condition is derivable from this.)
  • Good: "get all orders for a user, newest first, page size 25." (PK + SK range + sort direction fall out.)

Rule: if a pattern needs a FilterExpression over more than ~10% of the items it scans, that is a modeling smell — redesign the key, do not patch it with a filter.

Step 2 — Key design + single-table decision

Get this wrong and you pay for it forever: changing a table's key schema after launch means a full migration (new table + backfill + dual-write).

Composite-key encoding. Use prefixed, sortable strings so one partition holds an entity and its children — items read together are co-located, so one Query returns them — and so a sort-key range query slices them:

text
PK = USER#123
SK = USER#123                      <- the user item itself
SK = ORDER#2026-06-02T10:15#A91    <- an order, ISO-8601 timestamp sorts lexically = chronologically
SK = ORDER#2026-06-02T11:40#B07
json
{ "PK": "USER#123", "SK": "ORDER#2026-06-02T10:15#A91",
  "Type": "Order", "Total": 4200, "Status": "OPEN" }

One Query with PK = USER#123 AND SK begins_with("ORDER#") returns all of that user's orders, already sorted. That is a one-to-many relationship with no join.

Many-to-many uses an adjacency list: store the edge twice (or use an inverted GSI, see Step 3) so you can traverse it from either side. Worked end-to-end in references/access-patterns.md — a multi-tenant SaaS / e-commerce model (pattern table → PK/SK map → GSI map → AWS SDK v3 @aws-sdk/lib-dynamodb calls), adjacency-list many-to-many, time-series and leaderboard patterns.

Single-table vs table-per-entity — decide honestly, do not cargo-cult:

signalsingle-tabletable-per-entity
Many entities read together in one requestyesno
Many access patterns over related entitiesyesno
Entities are independent, patterns are few/simplenoyes (simpler, fine)
Team unfamiliar with overloaded keysweigh the costyes
Need clean per-entity IAM / TTL / capacity isolationnoyes

Single-table design earns its complexity when many related entities share access patterns. When entities are independent and the queries are few, separate tables are simpler and perfectly correct — say so.

Step 3 — GSIs (only when the base table can't serve it)

Three named patterns, each with a one-line why:

  • Inverted index — swap PK and SK on the GSI so you can read the relationship from the other side (GSI1PK = SK_value, GSI1SK = PK_value). Serves "given an order, who owns it" / many-to-many reverse.
  • Sparse index — only items that carry the GSI's key attribute are indexed. Write the attribute only on the few items you want to find ("OPEN" orders, flagged accounts) so the index is tiny and the query is "find the few" instead of "scan the many."
  • Overloaded GSI — reuse generic GSI1PK/GSI1SK attributes across multiple entity types so one index serves several patterns. Keeps you under the index quota.

Rule: add a GSI only when the base table physically cannot answer the pattern. Every GSI is a standing cost.

Warnings that bite people:

  • GSIs are always eventually consistent — you cannot read-your-own-write through a GSI. If a pattern needs strong consistency, it must hit the base table.
  • Each write to the base table replicates to every GSI whose keys changed, each consuming its own write capacity. More indexes = multiplied write cost.
  • Project only the attributes each pattern needs. Blanket ProjectionType: ALL doubles storage and write cost; use KEYS_ONLY or INCLUDE when you can.

Quotas (default, adjustable for GSIs): up to 20 GSIs and 5 LSIs per table. LSIs must be defined at table creation, share the base partition key, and impose a 10 GB item-collection cap (all items under one partition key). GSI-only tables have no such cap — a real reason to prefer GSIs over LSIs.

Step 4 — Capacity & cost

Capacity mode is a billing decision, not a modeling one — it changes nothing about the keys, so pick it after the model is stable. Decision table:

traffic shaperecommendationwhy
Spiky / unpredictable, or < ~10M req/monthOn-demand (the AWS default)Nov-2024 ~50% price cut made it cheapest for most workloads; no capacity planning
Sustained utilization > ~40%Provisioned + auto-scalingprovisioned writes (~$0.047/M) are far cheaper than on-demand at high utilization
Predictable, long-running, > ~70% utilProvisioned + reserved capacity3-year reserved (~$0.013/M write) is dramatically cheaper still

On-demand request unit pricing (us-east-1, standard table class): RRU $0.125 / million, WRU $0.625 / million. Warm throughput (the instantaneous read/write a table can serve) is shown by default at no cost and rises automatically as you scale; you pay only if you proactively pre-warm ahead of a known spike.

Hot partitions. Each physical partition has a hard ceiling of 3,000 RCU and 1,000 WCU per second, regardless of the table's total capacity. Drive one partition key past that and you are throttled even while well under your table limit — this is why "writes throttled but I'm under capacity" means a hot key. Fix with high-cardinality keys or write-sharding: append a suffix bucket to the PK.

text
# Hot: every write lands on one partition
PK = METRIC#daily_total

# Sharded: spread writes across N buckets, scatter-gather on read
PK = METRIC#daily_total#<0..9>

Capacity math, full pricing detail (including the Nov-2024 cut), warm throughput, the full quota table, and hot-partition diagnosis + the sharding recipe live in references/capacity-and-limits.md.

Step 5 — Operational guardrails

  • Item size is hard-capped at 400 KB (attribute names + values). Offload large blobs to S3 and store the S3 key in the item.
  • Query/Scan return at most 1 MB per request. That is why a Query "only returns some rows" — loop on LastEvaluatedKey until it is absent.
bash
aws dynamodb query --table-name App \
  --key-condition-expression 'PK = :pk' \
  --expression-attribute-values '{":pk":{"S":"USER#123"}}' \
  --starting-token "$LAST_EVALUATED_KEY"   # paginate; absent => done
  • TransactWriteItems / TransactGetItems group up to 100 unique items; a transactional write consumes 2× WCU.
  • BatchWriteItem takes up to 25 put/delete requests per call.
  • FilterExpression runs AFTER the read consumes capacity — it saves bandwidth, not RCU. Never use a filter as a substitute for a key condition.
  • TTL for automatic expiry (set an epoch-seconds attribute); deletion is best-effort, not instant.
  • DynamoDB Streams for change capture / building derived & denormalized views.

Anti-patterns

Anti-patternWhy it failsDo instead
Designing keys before listing access patternsThe keys won't express the queries; post-launch fix is a full migrationList every read/write first; derive keys from them
Scan + FilterExpression as your "query"Scan reads (and bills) the whole table; the filter only trims the responseMake the pattern a Query on a key or GSI
One GSI per attribute "just in case"Each GSI multiplies write cost and counts against the 20-GSI quotaAdd a GSI only when the base table can't serve a real pattern
Normalizing into separate tables joined in app codeDynamoDB has no joins; app-side joins are N round-trips and racesCo-locate related items under one PK; query once
Low-cardinality PK (e.g. status, tenant)All traffic funnels to one partition → throttling at 3000 RCU / 1000 WCUHigh-cardinality PK; write-shard hot keys
Expecting strong consistency from a GSIGSIs are always eventually consistent — stale readsRead consistency-critical patterns from the base table
ProjectionType: ALL on every GSIDoubles storage and write cost on each indexed writeProject KEYS_ONLY / INCLUDE only what the pattern needs
Storing > 400 KB inline (images, docs, logs)Hits the 400 KB item cap; bloats every readPut the blob in S3, store the pointer in the item
Picking capacity mode before the model is doneMode is billing, not modeling — premature and often wrongStabilize keys/GSIs first, then choose on-demand vs provisioned

Route elsewhere when the engine is different

Relational schema / SQL / EXPLAIN / indexing → ../postgresdb/SKILL.md; MySQL-engine schema → mysql; document modeling + aggregation pipeline → mongodb; cache / queue / rate-limiter → redis; vector store / semantic search → vector-db; AWS account / IAM / VPC setup → aws-essentials; provisioning the table in CI/CD → ../deployment/SKILL.md; API-layer auth/secrets in front of the table → ../secure-coding/SKILL.md.

Mitgelieferte Dateien

Das Modell liest diese Dateien bei Bedarf, während der Skill geladen ist. Sie werden als lesbare Dateien bereitgestellt und niemals ausgeführt.

Häufig gestellte Fragen

Was macht der KI-Skill Dynamodb?

Use when modeling or operating a DynamoDB table: deriving partition/sort keys from access patterns, single-table vs table-per-entity, adding a GSI/LSI, on-demand vs provisioned capacity, or diagnosing hot-partition throttling. NOT relational schema/SQL/EXPLAIN (that is `postgresdb`), NOT aggregation-pipeline document modeling (that is `mongodb`).

Warum Dynamodb in TypingMind nutzen?

Weil Sie den Skill einmal installieren und mit jedem Modell verwenden können. Dynamodb besteht aus reinem Markdown statt aus anbieterspezifischem Code. So funktioniert derselbe Skill mit GPT-5, Claude, Gemini, Grok oder einem lokalen Modell – und Sie können das Modell mitten im Chat wechseln, ohne dass der Skill seine Funktion verliert. TypingMind verwendet Ihre eigenen API-Schlüssel. Sie bezahlen die Anbieter daher direkt statt über ein Abonnement pro Nutzerplatz, und Ihre Skills und Chats bleiben in Ihrem eigenen Speicher.

Wie installiere ich Dynamodb in TypingMind?

Öffnen Sie in TypingMind Plugins → Skills → Von GitHub installieren und fügen Sie https://github.com/ericrisco/rsc-harness/tree/main/skills/dynamodb ein. TypingMind liest die Datei SKILL.md, bündelt die zugehörigen Dateien und installiert alles als Skill, den Sie für jeden Chat einzeln aktivieren können.

Welche KI-Modelle können Dynamodb nutzen?

Jedes Modell, das Sie mit TypingMind verbinden. KI-Skills bestehen aus reinen Markdown-Anweisungen statt aus anbieterspezifischem Code. Daher können GPT, Claude, Gemini, Grok und lokale Modelle diesen Skill laden, wenn eine Anfrage dazu passt.

Wie viele KI-Modelle kann ich mit Dynamodb verwenden?

So viele Sie möchten. In TypingMind können Sie Dynamodb mit jedem Modell verwenden, das Skills unterstützt, etwa mit GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama. Dabei nutzen Sie Ihre eigenen API-Schlüssel.

Ist der KI-Skill Dynamodb kostenlos?

Ja. Der Skill wird von ericrisco auf GitHub unter der Lizenz MIT veröffentlicht. Sie bezahlen nur Ihren eigenen KI-Anbieter für die verwendeten Token.

Was sind KI-Skills?

Ein KI-Skill ist ein wiederverwendbares Anweisungspaket, das einem KI-Modell vermittelt, wie es eine bestimmte Aufgabe erledigt. Es folgt dem offenen Format Agent Skills: Die Datei SKILL.md enthält den Namen und die Beschreibung des Skills. Hinzu kommen bei Bedarf Skripte, Vorlagen oder Referenzdateien für das Modell. Das Modell liest die Anweisungen nur, wenn Ihre Anfrage zum Skill passt. Ein installierter Skill verursacht daher erst Kosten, wenn er verwendet wird.

Wie unterscheiden sich KI-Skills von Plugins oder MCP-Servern?

Ein Plugin oder MCP-Server stellt einem Modell neue aufrufbare Tools bereit – Code, der auf einem System ausgeführt wird und ein Ergebnis zurückgibt. Ein KI-Skill vermittelt dem Modell stattdessen Wissen und Vorgehensweisen: wie es eine Aufgabe angeht, welche Schritte es befolgt und wie eine gute Ausgabe aussieht. Skills bestehen aus reinem Markdown und kommen daher ohne Server, API-Schlüssel und Laufzeitumgebung aus. Sie funktionieren mit jedem Modell.

Alle anzeigen

Jetzt eigenen KI-Arbeitsbereich einrichten

Abonnieren Sie unseren Newsletter und erfahren Sie mehr über neue Funktionen und kommende Gewinnspiele 👇