技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
nosql-data-modeling【数据与研究】Provides comprehensive patterns and best practices for modeling data in NoSQL databases like MongoDB, Cassandra, and DynamoDB.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
name: nosql-data-modeling description: Provides comprehensive patterns and best practices for modeling data in NoSQL databases like MongoDB, Cassandra, and DynamoDB. license: MIT compatibility: opencode metadata: version: "1.0.0" domain: coding triggers: nosql, mongodb, cassandra, dynamodb, data modeling, schema design archetypes: - tactical - generation anti_triggers: - brainstorming - vague ideation response_profile: verbosity: medium directive_strength: high abstraction_level: operational role: implementation scope: implementation output-format: code content-types: - code - guidance - examples - do-dont related-skills: database-design-modeling, api-design-principles
This skill provides comprehensive patterns and best practices for modeling data in popular NoSQL databases including MongoDB, Cassandra, and DynamoDB. When this skill is loaded, the model produces concrete examples, migration scripts, and query optimization patterns — not generic advice.
Primary Purpose: Provide developers with guidance on properly modeling data in NoSQL systems for optimal performance and scalability. Common Use Cases:
// Example document for a blog post in MongoDB:
{
_id: ObjectId('...'),
title: 'NoSQL Databases',
author: {
name: 'Jane Doe',
email: 'jane@example.com'
},
content: 'A deep dive into NoSQL...',
comments: [
{
user: 'John',
message: 'Great article!',
date: ISODate('2026-05-27T00:00:00Z')
},
// Additional comments
],
created_at: ISODate('2026-05-27T00:00:00Z')
}
Key Elements:
CREATE TABLE user_activity (
user_id UUID,
activity_time TIMESTAMP,
activity_type TEXT,
details TEXT,
PRIMARY KEY (user_id, activity_time)
);
// Insert example:
INSERT INTO user_activity (user_id, activity_time, activity_type, details)
VALUES (123e4567-e89b-12d3-a456-426614174000, '2026-05-27T00:00:00Z', 'login', 'User logged in from web.');
Key Elements:
user_id ensures all activities belong to a user.activity_time maintains order for each user's activities.Resources:
UserSessions:
Type: AWS::DynamoDB::Table
Properties:
TableName: UserSessions
BillingMode: PAY_PER_REQUEST
AttributeDefinitions:
- AttributeName: UserId
AttributeType: S
- AttributeName: CreatedAt
AttributeType: S
KeySchema:
- AttributeName: UserId
KeyType: HASH
- AttributeName: CreatedAt
KeyType: RANGE
description: DynamoDB User Sessions Table
Key Elements:
UserId for retrieving all sessions of a specific user.CreatedAt allows you to retrieve activity in chronological order efficiently.// Example aggregate query for user activity
db.user_activity.aggregate([
{ $match: { user_id: '1234' } },
{ $sort: { activity_time: -1 } },
{ $limit: 10 }
]);
CREATE MATERIALIZED VIEW user_logins AS
SELECT user_id, login_time, ip_address
FROM logins
WHERE login_time IS NOT NULL
PRIMARY KEY (user_id, login_time);
Resources:
UserInfo:
Type: AWS::DynamoDB::Table
Properties:
TableName: UserInfo
AttributeDefinitions:
- AttributeName: UserId
AttributeType: S
- AttributeName: Birthdate
AttributeType: S
GlobalSecondaryIndexes:
- IndexName: BirthdateIndex
KeySchema:
- AttributeName: Birthdate
KeyType: HASH
Projection:
ProjectionType: ALL
Authoritative documentation links for this domain. The model follows markdown links at load time to resolve external references and inline content.