
Security News
Suno Breached via Shai-Hulud Worm, Leaked Code Exposes AI Music Scraping
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.
@mastra/dynamodb
Advanced tools
Affected versions:
A DynamoDB storage implementation for Mastra using a single-table design pattern with ElectroDB.
npm install @mastra/dynamodb
# or
pnpm add @mastra/dynamodb
# or
yarn add @mastra/dynamodb
Before using this package, you need to create a DynamoDB table with the required structure. See TABLE_SETUP.md for detailed instructions on how to set up the table using CloudFormation or AWS CDK.
import { Memory } from '@mastra/memory';
import { DynamoDBStore } from '@mastra/dynamodb';
import { PineconeVector } from '@mastra/pinecone';
// Initialize the DynamoDB storage
const storage = new DynamoDBStore({
name: 'dynamodb',
config: {
region: 'us-east-1',
tableName: 'mastra-single-table', // Name of your DynamoDB table
},
});
// Initialize vector store (if using semantic recall)
const vector = new PineconeVector({
id: 'dynamodb-pinecone',
apiKey: process.env.PINECONE_API_KEY,
});
// Memory combines storage (like DynamoDBStore) with an optional vector store for recall
// Create memory with DynamoDB storage
const memory = new Memory({
storage,
vector,
options: {
lastMessages: 10,
semanticRecall: true,
},
});
For local development, you can use DynamoDB Local:
const storage = new DynamoDBStore({
name: 'dynamodb',
config: {
region: 'us-east-1',
tableName: 'mastra-single-table',
endpoint: 'http://localhost:8000', // Local DynamoDB endpoint
},
});
The IAM role or user used by this package needs the following permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"dynamodb:DescribeTable",
"dynamodb:GetItem",
"dynamodb:PutItem",
"dynamodb:UpdateItem",
"dynamodb:DeleteItem",
"dynamodb:Query",
"dynamodb:Scan",
"dynamodb:BatchGetItem",
"dynamodb:BatchWriteItem"
],
"Resource": [
"arn:aws:dynamodb:*:*:table/${YOUR_TABLE_NAME}",
"arn:aws:dynamodb:*:*:table/${YOUR_TABLE_NAME}/index/*"
]
}
]
}
The DynamoDBStore constructor accepts the following configuration options:
| Option | Type | Required | Description |
|---|---|---|---|
name | string | Yes | A name for the storage instance |
config.region | string | No | AWS region (default: 'us-east-1') |
config.tableName | string | Yes | The name of your DynamoDB table |
config.endpoint | string | No | Custom endpoint for DynamoDB (e.g., for local development) |
config.credentials | object | No | AWS credentials (accessKeyId, secretAccessKey) |
This storage adapter utilizes a single-table design pattern leveraging ElectroDB, which is a common and recommended approach for DynamoDB. This differs architecturally from relational database adapters (like @mastra/pg or @mastra/libsql) that typically use multiple tables, each dedicated to a specific entity (threads, messages, etc.).
Key aspects of this approach:
TABLE_SETUP.md for detailed instructions using tools like AWS CloudFormation or CDK. The adapter focuses solely on interacting with the pre-existing table structure.MastraStorage interface as other adapters, ensuring it can be used interchangeably within the Mastra Memory component.This implementation uses a single-table design pattern with ElectroDB, which offers several advantages within the context of DynamoDB:
FAQs
DynamoDB storage adapter for Mastra
The npm package @mastra/dynamodb receives a total of 59,956 weekly downloads. As such, @mastra/dynamodb popularity was classified as popular.
We found that @mastra/dynamodb demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
A Shai-Hulud infection exposed Suno's source code, which shows the AI music startup stream-ripped tracks to train its models.

Security News
Vercel is formalizing a monthly release program for Next.js. The change follows React2Shell and a sharp rise in AI-assisted vulnerability discovery.

Research
/Security News
11 malicious NuGet tools pose as game cheats to deploy Windows payloads, track hosts, and use Google Sheets for telemetry and control.