跳至正文
OpenAgentSkill
浏览已开放 · 目录记录日期 2026-11-21 · 自动更新和账户服务暂时关闭。
数据与分析

aerospike-data-modeling

Designs a new Aerospike data model from requirements, producing a schema guide and schema summary: record granularity, key design, bin structure, relationship and consolidation decisions, and index strategy. Use when no schema exists yet, when redesigning an existing model, or when reviewing a proposed schema for structural defects. This is design-time work that precedes code. For writing or reviewing client code against a model that already exists, or for client APIs, policies, CDT operations, and expression usage, use aerospike-development instead. Core database only; not Aerospike Graph.

aerospike · 已有 AI 审核记录

安装与使用

运行命令前先阅读来源与依赖说明。复制命令不会自动安装或执行。

npx skills add aerospike/agent-skills --skill aerospike-data-modeling

技能说明


name: aerospike-data-modeling description: >- Designs a new Aerospike data model from requirements, producing a schema guide and schema summary: record granularity, key design, bin structure, relationship and consolidation decisions, and index strategy. Use when no schema exists yet, when redesigning an existing model, or when reviewing a proposed schema for structural defects. This is design-time work that precedes code. For writing or reviewing client code against a model that already exists, or for client APIs, policies, CDT operations, and expression usage, use aerospike-development instead. Core database only; not Aerospike Graph. license: Apache-2.0 metadata: last_verified: "2026-08-06" server_versions: "7.0+"

Aerospike: data model design

Role

Act as a data architect. Your job is to turn requirements into a durable schema contract, not to write client code. The output is documents that a team reviews and implements against.

When to use this skill

Use it when the starting point is requirements without a schema:

  • A new application or service with no Aerospike model yet.
  • A redesign, where an existing model no longer serves its access patterns.
  • A review of a proposed schema for structural defects before implementation.

Not this skill: writing or reviewing client code against an existing model, tuning policies, choosing CDT operations, debugging a slow batch read. That is aerospike-development. If a schema already exists and the question is "how do I use it well," hand off.

What you produce

Two documents. Write them to files — they are review artifacts with a life beyond the session, not chat output.

DeliverableContents
Schema guideThe full design: entity and relationship map, access pattern matrix, key schema, bin schema, one JSON example record per set, relationship and consolidation decisions, sizing worksheets, index rationale, growth and hot-key plan, validation plan. Plus the reasoning — an assumptions log, the alternatives rejected, and what evidence would reopen each decision.
Schema summaryThe condensed contract derived from the guide: one table per set with key format, bins, types, and a one-line purpose; the index list; growth and overflow triggers. No rationale.

The schema summary is generated from the schema guide, never authored independently. If they disagree, the schema guide wins and the summary is regenerated.

See references/model-deliverables-schema-guide-summary.md.

Mental model for data architects

Aerospike is neither a relational database nor a document database.

  • Records are semi-structured. A record is a collection of strongly typed bins, and the typing is per bin per record — there is no set-level schema. Two records in the same set can have entirely different bins, and the server enforces nothing. Absent bins cost nothing, so sparse and heterogeneous shapes are cheap rather than wasteful. The consequence for design: the data model is an application-level contract — namespace, set, key format, bin names, and bin types that every client agrees on — and nothing in the database will stop a client that writes a different shape. Write the contract down; that is what the schema guide is for.
  • Records are the unit of I/O. Record data is stored contiguously, so every read fetches the entire record from storage, and every write rewrites the entire record — Aerospike does not do in-place updates. Requesting a subset of bins trims what crosses the network, not what is read from device. A record in the tens of KiB therefore spends tens of KiB of I/O on every access, no matter how small the change. Record size is an I/O budget, not just a storage number.
  • There are no server-side joins. The multi-record tool is the batch read, which scatters and gathers across nodes in parallel.
  • Every record costs 64 bytes of primary index metadata, per replica, usually in RAM. Many tiny records spend more memory on index than on data.
  • Access patterns drive the model — not entity normalization, and not document embedding.
  • Consolidate, but bound it. Enough to avoid tiny records; not so much that one record becomes a monolith or a hot key.

If your instinct is a table per entity and a row per sub-entity, or one giant embedded document, you will produce a bad Aerospike model.

Record sizing — target band, the configured max-record-size limit, and the architectural ceiling are three different bounds that are easy to conflate. Do not carry a number from memory; read the current values from the data modeling guide (see Escalation below).

Whatever the band's endpoints are, read it as a distribution, not a target: design so the bulk of records sit at the low end (single-digit KiB), and treat the upper end as headroom for outliers and slowly-changing consolidated structures — 1:N and N:M relationship lists, where one record per edge would cost more. Size only hurts once multiplied by write frequency: a large record on a hot write path is a design defect even when it fits, because every update rewrites it in full — but the same size where writes are infrequent relative to reads is a legitimate design, not a compromise. Ask for the update rate, not just the byte count.

Do not design without clarifying first

The first deliverable is a written clarification document, not a schema. Ask requirements-gap questions — "what is the p95 fan-out?", "is eventual consistency acceptable here?" — never mechanism-preference questions like "which pattern do you prefer?". If deterministic guidance already resolves a choice, apply it instead of asking.

Do not fill gaps with assumptions and continue. When entity ownership, lifecycle, cardinality, or an access path is unclear, stop and ask. Where an input cann

阅读完整来源 ↗