Agent skill

Database Architecture

by celeriant in celeriant/celeriant-db

Core architecture invariants for Celeriant. An agent skill from celeriant/celeriant-db.

Apache-2.0Auto-check passedBackend & APIs

Install Database Architecture

skills CLI
$ npx skills add celeriant/celeriant-db --skill database-architecture -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install celeriant/celeriant-db database-architecture --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/celeriant/celeriant-db.git skills-src && mkdir -p .claude/skills && cp -r skills-src/.claude/skills/database-architecture .claude/skills/database-architecture && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
database-architecture
GitHub stars
114
Token cost
~1.5k tokens
SKILL.md length
745 words
Files
1
Skills in repo
13
Repo updated
First seen
Licence
Apache-2.0

At a glance

Core architecture invariants for Celeriant. An agent skill from celeriant/celeriant-db.

  • Implementing features
  • SKILL.md covers Memory: Bounded Everything, Write Pipeline, Durability and Storage Layout, plus 4 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md
  • Understanding why patterns exist

What it does

Database Architecture is an agent skill from celeriant/celeriant-db. Core architecture invariants for Celeriant. Memory bounds, WAL durability, write pipeline, storage layout, and tracing rules. Use when implementing features, reviewing code, or understanding why patterns exist.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.

It sits in Backend & APIs. The repository describes itself as: Fast, distributed per-aggregate event log with strict ordering and optimistic concurrency control. The licence is Apache-2.0.

When your agent uses it

  • Implementing features
  • Understanding why patterns exist

Example prompts

  • “/database-architecture”

What it can do on your machine

Read from SKILL.md and the folder at commit d071a6d. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md.

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Database Architecture loads about 1.5k tokens when it runs. Until then it costs about 58 tokens; SKILL.md has 745 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from celeriant/celeriant-db at commit d071a6d, republished under its Apache-2.0 licence (© celeriant). 745 words, ~1,458 tokens.

Download SKILL.mdSave it as .claude/skills/database-architecture/SKILL.md (or your agent's skills folder).
name
database-architecture
description
Core architecture invariants for Celeriant. Memory bounds, WAL durability, write pipeline, storage layout, and tracing rules. Use when implementing features, reviewing code, or understanding why patterns exist.

Database Architecture

Memory: Bounded Everything

Celeriant supports millions of aggregates per shard. No data structure grows proportional to cardinality.

All long-lived caches use LruCache with byte-based capacity derived from a per-shard memory budget. Total memory = detected_memory * CELERIANT_MEMORY_CONSUMPTION_PERCENT / 100 (default 80%, respects cgroup limits). Divided equally across shards, then split into fixed ratios: recent_write 71.5%, aggregate_snapshots 9%, client_snapshots 9%, schema_cache 9%, WAL sequence 1.5%.

Scan pollution prevention: entries from WAL scans insert at low priority, only into spare capacity, immediately demoted to LRU tail. A list operation can't flush the hot working set.

Intentionally unbounded exceptions: pending_append_queue and aggregate_queue_positions are transient in-flight state that drains every fsync cycle (milliseconds). pending_replication_batches is bounded indirectly by pending_replication_high_water_bytes triggering S3 fallback.

Periodically shrink collections that grew temporarily - shrink_to_fit() when capacity > 2x length.

Write Pipeline

queue -> fsync (amortised) -> replication (amortised) -> ACK

Multiple concurrent writers coalesce into a single fsync, then a single replication round. Under low load, the fast path executes immediately. Under high load, delay-based batching kicks in. One fsync and one TCP round-trip can serve hundreds of writers.

The fsync coordinator's two phases: capture snapshot first, then clear queue. This ordering prevents a race where a new leader finds an empty queue.

Durability

Never acknowledge a write before it's durable. The disk write order within a single fsync: datablocks first (offsets known), metablocks (referencing those offsets), dual headers, then fdatasync(). In-memory state updates only after fsync succeeds.

Both primary header (offset 0) and backup header (end of file) are written on every fsync. If the primary is corrupt on recovery, the backup is used. CRC32C validates before deserialisation.

All I/O uses Direct I/O (O_DIRECT via glommio DmaFile). Bypasses the kernel page cache entirely. Buffered I/O is vulnerable to silent data loss on fsync failure. DMA writes aligned to 4096 bytes, with carry-over buffers for unaligned datablock positions.

Replication is synchronous. Client gets an ACK only after both leader and follower have fsynced. If replication fails (follower and S3 both down), rollback fires: revert write cursor to read cursor, clear all un-replicated in-memory state, rewrite headers at rolled-back positions, fsync. Durable before any new writes.

Storage Layout

File layout: [Header 512KB] [Metablocks growing down ->] [Free space] [<- Datablocks growing up] [Header 512KB].

Metablocks are fixed 1024 bytes. Datablocks grow backwards from the bottom. File rotates when they meet. Log segments are preallocated at creation (minimum 1.5MB).

Small events (<= 512 bytes serialised) live inline in the metablock itself, avoiding a separate disk seek. Auto-selected transparently.

Each segment carries a 256KB bloom filter (10 hashes, <1% FP at 200k aggregates). The reverse WAL scanner skips entire segments with a single bloom check. This is how unlimited cardinality works without unlimited index memory.

The small-metablock compile-time feature halves metablock size (1024 -> 512 bytes) and inline threshold (512 -> 128 bytes). Affects the on-disk format and replication wire format only. Client request/response protocol is unaffected. Both cluster nodes must be compiled with the same setting.

Show full SKILL.md (260 more words)Show less

Read Visibility

Two separate LRU caches: write snapshots (updated after fsync, used for OCC/idempotency) and read snapshots (updated after replication on leader, used by reads). On leader, writes are invisible to readers until replication completes.

Recent write cache entries carry WAL sequence. Reads filter by visible_wal_seq, excluding un-replicated data. The hot cache can hold speculative data without leaking it.

Read operations are never rejected based on node status. A fenced or catching-up node serves stale reads silently.

OCC and Idempotency

OCC checks use the write-ahead snapshot, not the read snapshot. A write fsynced but not yet replicated still triggers OCC conflict.

Check ordering matters: OCC first, then idempotency. If OCC fails, client retries with fresh state. If OCC passes but idempotency fails, the exact write already landed (crash recovery scenario, treat as success). Reversing this order creates false-positive "already landed" results from concurrent writers that use the same client event index source.

Tracing

No info! or debug! in hot paths. This generates gigabytes of logs and degrades performance.

  • error!: unrecoverable failures, data integrity issues (fsync failure, corruption)
  • warn!: recoverable issues (client disconnect, timeout, retry)
  • info!: startup, shutdown, configuration, rare events
  • trace!: per-request detail, disabled by default

Use structured fields (aggregate_key = ?key, error = %err, "Write failed") not string interpolation.

Metrics

Every new metric must get a describe_counter!/describe_gauge!/describe_histogram! line in register_metric_descriptions() at celeriant_runtimes/src/sidecar/metrics_server.rs. Prometheus exposes the metric without it, but the /metrics HELP text — and Grafana's tooltips/autocomplete — go missing. This is the single source of truth for what the cluster ships; if a metric is fired anywhere, it has a line here.

© celeriant, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

Just SKILL.md in .claude/skills/database-architecture of celeriant/celeriant-db.

Open the folder on GitHubat commit d071a6d

Compare with similar skills

Database Architecture next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Database Architecture compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Database Architecture this skillceleriant/celeriant-db114—~1.5kAutomated safety check: PassApache-2.0
Configuring Horizoncoollabsio/coolify63k4 repos~898Automated safety check: PassMIT
Nestjs Best Practicesrolling-scopes/rsschool-app10k6 repos~1.2kAutomated safety check: PassMIT
Sub2API AdminWei-Shaw/sub2api43k1 repos~717Automated safety check: PassLGPL-3.0
Firecrawl Build Onboardingfirecrawl/firecrawl189k1 repos~1.4kAutomated safety check: NotesISC
Obsidian BasesAtmosphere/atmosphere3.8k22 repos~3.2kAutomated safety check: PassApache-2.0

Similar skills

  • Configuring Horizon

    coollabsio/coolify

    A skill your agent uses whenever the user mentions Horizon by name in a Laravel context.

    63k GitHub starsUsed in 4 repos~898 tokens
    Backend & APIsAuto-check passed
  • Nestjs Best Practices

    rolling-scopes/rsschool-app

    NestJS best practices and architecture patterns for building production-ready applications.

    10k GitHub starsUsed in 6 repos~1.2k tokens
    Backend & APIsAuto-check passed
  • Sub2API Admin

    Wei-Shaw/sub2api

    Manages a Sub2API deployment from the command line: accounts, redeem and invitation codes, groups, proxies, imports, exports and raw admin API calls.

    43k GitHub starsUsed in 1 repo~717 tokens
    Backend & APIsAuto-check passed
  • Firecrawl Build Onboarding

    firecrawl/firecrawl

    Gets Firecrawl working in a project: signs you in through the browser, saves FIRECRAWL_API_KEY to .env and picks the first SDK or REST path.

    189k GitHub starsUsed in 1 repo~1.4k tokens
    Backend & APIsAuto-check: notes
  • Obsidian Bases

    Atmosphere/atmosphere

    Create and edit Obsidian Bases (.base files) with views, filters, formulas, and summaries.

    3.8k GitHub starsUsed in 22 repos~3.2k tokens
    Backend & APIsAuto-check passed
  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed

More from celeriant/celeriant-db

All 13 skills in this repo
  • Error Handling

    celeriant/celeriant-db

    Error handling patterns in Celeriant. An agent skill from celeriant/celeriant-db.

    114 GitHub stars~550 tokensUpdated 9 days ago
    Auto-check passed
  • Testing

    celeriant/celeriant-db

    How to write and run tests in Celeriant. An agent skill from celeriant/celeriant-db.

    114 GitHub stars~951 tokensUpdated 9 days ago
    Auto-check passed
  • Understanding Celeriant Structure

    celeriant/celeriant-db

    Celeriant codebase architecture, crate responsibilities, and how they fit together.

    114 GitHub stars~803 tokensUpdated 9 days ago
    Auto-check passed
  • Extract A Type

    celeriant/celeriant-db

    Refactor a named Rust type or its surrounding code with an agreed scope.

    114 GitHub stars~934 tokensUpdated 9 days ago
    Auto-check passed
  • Client Server Protocol

    celeriant/celeriant-db

    Celeriant's client-server protocol invariants, network behavior, failure modes, and shard routing.

    114 GitHub stars~1.6k tokensUpdated 9 days ago
    Auto-check passed
  • Glommio Locking Patterns

    celeriant/celeriant-db

    Locking patterns for Glommio's single-threaded async executors.

    114 GitHub stars~876 tokensUpdated 9 days ago
    Auto-check passed

Categories

Questions about Database Architecture

What does Database Architecture do?

Core architecture invariants for Celeriant. An agent skill from celeriant/celeriant-db. Database Architecture is an agent skill from celeriant/celeriant-db. Core architecture invariants for Celeriant.

When should I use Database Architecture?

Database Architecture fits situations like: implementing features; understanding why patterns exist.

How do I install Database Architecture in Claude Code?

Run `npx skills add celeriant/celeriant-db --skill database-architecture -a claude-code`. Or copy the skill folder (.claude/skills/database-architecture in celeriant/celeriant-db) into .claude/skills/database-architecture in your project. Claude Code loads it when a task matches its description.

How do I install Database Architecture in Codex?

Run `npx skills add celeriant/celeriant-db --skill database-architecture -a codex`. Or copy the skill folder (.claude/skills/database-architecture in celeriant/celeriant-db) into .agents/skills/database-architecture in your project. Codex loads it when a task matches its description.

Can I use Database Architecture in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add celeriant/celeriant-db --skill database-architecture -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/database-architecture, .gemini/skills/database-architecture, .github/skills/database-architecture and .opencode/skills/database-architecture in your project.

What does Database Architecture need to run?

SKILL.md names no scripts, command-line tools or credentials: Database Architecture is instructions for the agent only.

Does Database Architecture access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Database Architecture safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Database Architecture use?

Database Architecture is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Database Architecture use?

About 1.5k tokens (SKILL.md is roughly 5.8k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Database Architecture?

Skills that share tags, products or a category with Database Architecture: Configuring Horizon (coollabsio/coolify, 63k stars), Nestjs Best Practices (rolling-scopes/rsschool-app, 10k stars), Sub2API Admin (Wei-Shaw/sub2api, 43k stars) and Firecrawl Build Onboarding (firecrawl/firecrawl, 189k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Database Architecture?

celeriant (a GitHub organization) maintains it in celeriant/celeriant-db, which has 114 GitHub stars. The repository holds 13 skills in this directory. The repository was last updated on September 28, 2026.

Source: celeriant/celeriant-db on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.