DynamoDB Storage

Serverless, auto-scaling storage on AWS.

The DynamoDBStore is perfect for serverless applications running on AWS Lambda. It uses the `TTL` attribute feature for expiration.

Installation

Pythonbash
pip install halt[dynamodb]
TypeScriptbash
npm install @aws-sdk/client-dynamodb

Usage

Python

from halt.stores.dynamodb import DynamoDBStore

store = DynamoDBStore(
    table_name="rate_limits",
    region_name="us-east-1"
)

TypeScript

import { DynamoDBStore } from 'halt/stores/dynamodb';

const store = new DynamoDBStore({
  tableName: 'rate_limits',
  region: 'us-east-1'
});

Table Setup

Ensure your DynamoDB table has:

  • Partition Key: key (String)
  • TTL Attribute: ttl (Number) - Enabled in settings