Przejdź do treści
Biblioteka skilli
Programowanie · Planowanie

dynamodb

/dynamodb

Wspiera projektowanie w AWS DynamoDB: single-table design, klucze partycji i sortowania, GSI, DynamoDB Streams i TTL, dla aplikacji serverless i magazynów klucz-wartość.

Repozytorium
Agent-Skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
01.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
1
Przestarzałość

Brak sygnałów. Repozytorium zmienione 01.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Wspiera projektowanie w AWS DynamoDB: single-table design, klucze partycji i sortowania, GSI, DynamoDB Streams i TTL, dla aplikacji serverless i magazynów klucz-wartość.

Oryginalny opis (EN)

Expert AWS DynamoDB assistance covering single-table design, Partition and Sort keys, GSIs, DynamoDB Streams, and TTL. Use when designing serverless NoSQL applications, high-scale key-value stores, or event-driven pipelines.

Jak działa

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Sekcje z nagłówków SKILL.md, w oryginale · 142 linii, 640 słów
Podgląd SKILL.md
---
name: dynamodb
description: Expert AWS DynamoDB assistance covering single-table design, Partition and Sort keys, GSIs, DynamoDB Streams, and TTL. Use when designing serverless NoSQL applications, high-scale key-value stores, or event-driven pipelines.
---

# Amazon DynamoDB

DynamoDB is a fully managed, serverless, key-value NoSQL database designed to run high-performance applications at any scale (Single-digit millisecond latency).

## When to Use

- **Single-Digit Millisecond Key-Value at Any Scale**: AWS managed NoSQL database scaling horizontally to millions of requests per second.
- **Serverless Web Backends (AWS Lambda)**: Applications requiring serverless pay-per-request pricing and zero connection-pool management.
- **Single-Table Design Architectures**: Modeling complex one-to-many and many-to-many relationships in a single unified DynamoDB table.
- **Global Multi-Region Replication**: Deploying active-active multi-region applications with DynamoDB Global Tables.

## Quick Start

```typescript
import { DynamoDBClient, PutItemCommand } from "@aws-sdk/client-dynamodb";

const client = new DynamoDBClient({});
const command = new PutItemCommand({
  TableName: "Users",
  Item: {
    PK: { S: "USER#123" },
    SK: { S: "PROFILE" },
    Name: { S: "Alice" },
  },
});
await client.send(command);
```

## Core Concepts

### Partition Key (PK) & Sort Key (SK) Architecture

The Partition Key determines physical partition routing; the Sort Key dictates B-Tree ordering within the partition:

```text
[ Single DynamoDB Table ]
  ├── PK: USER#101 | SK: METADATA        -> User Profile Record
  ├── PK: USER#101 | SK: ORDER#2026-0901 -> Order Record 1
  └── PK: USER#101 | SK: ORDER#2026-0925 -> Order Record 2
```

### Global Secondary Indexes (GSI) Inversion

Enables reverse lookups without scanning the entire table:

```typescript
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
import { DynamoDBDocumentClient, QueryCommand } from "@aws-sdk/lib-dynamodb";

const ddbDoc = DynamoDBDocumentClient.from(
  new DynamoDBClient({ region: "us-east-1" }),
);

// Query using GSI (Inverted Index: Find all users belonging to an organization)
const { Items } = await ddbDoc.send(
  new QueryCommand({
    TableName: "EnterpriseTable",
    IndexName: "GSI_1",
    KeyConditionExpression:
      "GSI1_PK = :orgId AND begins_with(GSI1_SK, :prefix)",
    ExpressionAttributeValues: {
      ":orgId": "ORG#enterprise_corp",
      ":prefix": "USER#",
    },
  }),
);
```

### DynamoDB Streams & Event-Driven Processing

Captures item-level change events to trigger asynchronous AWS Lambda functions:

```text
[ Table Write ] ──Capture Mutation──→ [ DynamoDB Streams ] ──Trigger──→ [ Lambda Worker ] ──→ [ OpenSearch Sync ]
```

## Common Patterns

### Single-Table Design with Composite Sort Keys

**Problem**: Traditional multi-table relational designs in DynamoDB require expensive multi-query joins.

**Solution**:
Store multiple entity types in a single table using generic PK/SK keys:

```json
[
  {
    "PK": "USER#1001",
    "SK": "METADATA",
    "name": "Jane Doe",
    "email": "jane@example.com"
  },
  {
    "PK": "USER#1001",
    "SK": "ORDER#2025-03-01#9981",
    "status": "SHIPPED",
    "total": 149.99
  }
]
```

```javascript
// Query user and recent orders in a single round-trip
const params = {
  TableName: "StoreData",
  KeyConditionExpression: "PK = :pk AND SK begins_with(:orderPrefix)",
  ExpressionAttributeValues: {
    ":pk": "USER#1001",
    ":orderPrefix": "ORDER#",
  },
};
```

## Best Practices

**Do**:

- Adopt Single-Table Design: Group related entity types into a single table to fetch parent and children in a single `Query` call.
- Always Prefer `Query` Over `Scan`: Never run `Scan` operations in production application code paths; scans consume massive RCU/WCU.
- Use On-Demand Capacity for Variable Workloads: Avoid provisioned throttling errors by starting with On-Demand billing.
- Configure Time to Live (TTL): Automatically expire session records, temporary tokens, and transient logs at zero cost.

**Don't**:

- Use low-cardinality Partition Keys: Keys like `gender` or `status` route all traffic to a single partition, triggering hot-partition throttling.
- Project all attributes into GSIs (`ALL`): Project only needed attributes (`KEYS_ONLY` or `INCLUDE`) to reduce storage and write costs.
- Execute transactions (`TransactWriteItems`) unnecessarily: Transactions cost double the write capacity units of standard puts.

## Troubleshooting

| Error                                                     | Cause                                                          | Solution                                                                         |
| :-------------------------------------------------------- | :------------------------------------------------------------- | :------------------------------------------------------------------------------- |
| `ProvisionedThroughputExceededException`                  | Consumed capacity exceeded table or GSI provisioned RCUs/WCUs. | Switch to On-Demand capacity or implement exponential backoff retry logic.       |
| `ValidationException: Item size has exceeded 400KB limit` | Document payload exceeds maximum DynamoDB item limit.          | Compress payload or store large binaries in S3, keeping only S3 URI in DynamoDB. |
| `TransactionCanceledException`                            | One condition check failed in `TransactWriteItems`.            | Check condition expressions across all transactional items.                      |

## References

- [DynamoDB Developer Guide](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html)

Wersje

RepozytoriumWynikLicencja
Ta strona · G1Joshi/Agent-Skills100MIT
ericrisco/rsc-harness100MIT
itsmostafa/aws-agent-skills100MIT
aws-samples/sample-claude-code-plugins-for-startups100MIT

Migawka bazy z 13.11.2026 · wersja paczki 58fe1ed2d034 (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100aws-dynamodb
    Prowadzi projektowanie tabel Amazon DynamoDB: klucze partycji i sortowania, indeksy GSI i LSI, zapytania przez AWS CLI i boto3, zapisy warunkowe, transakcje, streamy, TTL i single-table design.
  • 100dynamodb-single-table-design
    Opisuje wzorce Amazon DynamoDB Single-Table Design: modelowanie wzorców dostępu, strategie PK i SK, GSI, indeksy rzadkie i transakcje w warstwach danych o dużej skali.
  • 95amazon-dynamodb
    Projektuje, recenzuje i debuguje warstwy danych DynamoDB: wylicza wzorce dostępu, dobiera klucze i GSI, wybiera single-table lub multi-table, konfiguruje Streams i TTL oraz szacuje koszt.
  • 100dynamodb-single-table-design
    Projektuje model danych DynamoDB w jednej tabeli z kluczami złożonymi, dla aplikacji o małych opóźnieniach i dużej skali.
  • 100dynamodb-table-designer
    Wspiera operacje projektowania tabel DynamoDB w kategorii AWS Skills i aktywuje się automatycznie na frazy związane z projektantem tabel DynamoDB.
  • 91dynamodb-design
    Projektuje modele danych DynamoDB pod wzorce dostępu: klucze partycji, indeksy GSI, planowanie pojemności i kod CDK.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.