一键导入
layer-08-data-store
Expert knowledge for Data Store Layer modeling in Documentation Robotics
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Expert knowledge for Data Store Layer modeling in Documentation Robotics
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Expert knowledge for Data Store Layer modeling in Documentation Robotics
Graph-based code intelligence for using dr analyzer subcommands to understand codebase structure, discover elements, and verify model alignment
Expert knowledge for Application Layer modeling in Documentation Robotics
Expert knowledge for Motivation Layer modeling in Documentation Robotics
Expert knowledge for Business Layer modeling in Documentation Robotics
Expert knowledge for Security Layer modeling in Documentation Robotics
| name | LAYER_08_DATA_STORE |
| description | Expert knowledge for Data Store Layer modeling in Documentation Robotics |
| triggers | ["database","collection","namespace","data-store","NoSQL","MongoDB","DynamoDB","document store","access pattern","index","field"] |
| version | 0.8.1 |
Layer Number: 08 Specification: Metadata Model Spec v0.8.1 Purpose: Defines paradigm-neutral physical storage modeling, capturing databases, collections/tables, fields/columns, indexes, views, stored logic, validation rules, access patterns, event handlers, and retention policies across relational, document, key-value, time-series, and graph stores.
The Data Store Layer captures physical storage design in a paradigm-neutral way:
This layer supports multiple storage paradigms: relational (PostgreSQL, MySQL), document (MongoDB, Firestore), key-value (Redis, DynamoDB), time-series (InfluxDB, TimescaleDB), and graph (Neo4j, Amazon Neptune).
Central Entity: The Collection (table, document collection, stream) is the core modeling unit.
CLI Introspection: Run
dr schema types data-storefor the authoritative, always-current list of node types. Rundr schema node <type-id>for full attribute details on any type (e.g.,dr schema node data-store.collection).
| Entity Type | CLI Type | Description |
|---|---|---|
| Database | database | Database instance (any paradigm — relational, document, key-value, etc.) |
| Namespace | namespace | Logical grouping of collections (schema, keyspace, database prefix) |
| Collection | collection | Primary storage unit (table, document collection, stream, bucket) |
| Field | field | Field or column definition with data type and constraints |
| Index | index | Query optimization index (B-tree, hash, compound, text, geospatial) |
| View | view | Derived or materialized view over one or more collections |
| StoredLogic | storedlogic | Stored procedures, triggers, and user-defined functions |
| ValidationRule | validationrule | Database-level validation constraint or schema enforcement rule |
| AccessPattern | accesspattern | Named query access pattern (for performance and capacity planning) |
| EventHandler | eventhandler | Event-driven trigger or change-data-capture handler |
| RetentionPolicy | retentionpolicy | Data lifecycle, TTL, and retention rule definition |
Activate when the user:
Outgoing (Data Store → Other Layers):
x-json-schema → Data Model Layer (what logical schema does this implement?)x-governed-by-* → Security Layer (data access policies)x-apm-performance-metrics → APM Layer (query performance monitoring)Incoming (Other Layers → Data Store):
collection/field regardless of whether the underlying store is relational or documentAccessPattern entities before collectionsAccessPattern to document which index serves which patternx-pii on field entities to mark sensitive dataRetentionPolicy for collections with regulatory or storage requirementsStoredLogic entitiesEventHandler entitiesValidationRule for database-level constraints beyond field-level type enforcement# Add a database instance
dr add data-store database --name "users-db"
# Add a namespace (schema or keyspace)
dr add data-store namespace --name "public" --property parentDatabase=data-store.database.users-db
# Add a collection (table or document collection)
dr add data-store collection --name "users" --property parentNamespace=data-store.namespace.public
# Add a field to a collection
dr add data-store field --name "email" --property dataType=string --property nullable=false
# Add an index
dr add data-store index --name "idx-users-email" --property fields='["email"]' --property unique=true
# Add an access pattern (for NoSQL capacity planning)
dr add data-store accesspattern --name "get-user-by-email" --property queryType=point-lookup
# List collections
dr list data-store collection
# Validate data-store layer
dr validate --layer data-store
# Introspect available types
dr schema types data-store
id: data-store.collection.users
name: "Users Collection"
type: collection
properties:
parentNamespace: data-store.namespace.public
paradigm: relational # or: document, key-value, time-series, graph
fields:
- id:
dataType: uuid
nullable: false
primaryKey: true
- email:
dataType: string
nullable: false
x-pii: true
x-encrypted: true
- username:
dataType: string
nullable: false
- created_at:
dataType: timestamp
nullable: false
x-json-schema: data-model.object-schema.user
x-apm-performance-metrics:
- apm.metric.users-query-latency
id: data-store.accesspattern.get-user-by-email
name: "Get User by Email"
type: accesspattern
properties:
collection: data-store.collection.users
queryType: point-lookup
keyAttributes: ["email"]
consistencyLevel: strong
estimatedRps: 500
id: data-store.retentionpolicy.users-audit-log
name: "Users Audit Log Retention"
type: retentionpolicy
properties:
collection: data-store.collection.users-audit-log
ttlDays: 365
archiveAfterDays: 90
regulatoryBasis: "SOC2, GDPR Article 30"
collection, field, validationruleAccessPattern for NoSQL stores (DynamoDB, Cassandra) — define access patterns firstx-piix-json-schema)RetentionPolicy for regulated dataEventHandler for CDC or change-triggered workflows