Przejdź do treści
Biblioteka skilli
Dane i analityka · Planowanie

data-model-design

/data-model-design

Projektuje modele danych: schematy gwiazdy, wolno zmieniające się wymiary i decyzje o denormalizacji dla produktów danych.

Licencja
MIT
Ostatnia zmiana repozytorium
10.09.2026

Ocena i bezpieczeństwo

90/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść25 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
2
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 10.09.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co robi i kiedy

Projektuje modele danych: schematy gwiazdy, wolno zmieniające się wymiary i decyzje o denormalizacji dla produktów danych.

Wyzwalacze z opisu

how should I model this data?should I denormalize?
Oryginalny opis (EN)

Dimensional modeling and schema design for data products. Star schema patterns, slowly changing dimensions, denormalization decisions, and architecture decision records. Use when designing data models, reviewing schema designs, choosing between normalization strategies, or when someone asks "how should I model this data?" or "should I denormalize?" For OMOP CDM patterns specifically, see healthcare-data-domain.

Jak działa

  1. Star Schema as Default
  2. Slowly Changing Dimensions (SCD)
  3. Architecture Decision Records
  4. Design Validation
  5. Source Schema Evaluation
Sekcje z nagłówków SKILL.md, w oryginale · 68 linii, 518 słów
Podgląd SKILL.md
---
name: data-model-design
version: 0.1.0
description: >
  Dimensional modeling and schema design for data products. Star schema patterns,
  slowly changing dimensions, denormalization decisions, and architecture decision
  records. Use when designing data models, reviewing schema designs, choosing between
  normalization strategies, or when someone asks "how should I model this data?" or
  "should I denormalize?" For OMOP CDM patterns specifically, see healthcare-data-domain.
user-invocable: false
---

## Star Schema as Default

For analytics data products, default to star schema with strategic denormalization:

**Fact tables** contain events at the lowest useful grain:
- One row per event (transaction, visit, measurement, interaction)
- Foreign keys to dimension tables
- Numeric measures (amount, count, duration)
- Timestamps at the grain of the analysis

**Dimension tables** contain context:
- Descriptive attributes for filtering and grouping
- Human-readable labels alongside codes
- Hierarchies for drill-down (region -> state -> city)

NEVER fully denormalize into One Big Table. Many-to-many relationships cause exponential row growth. A patient with 10 conditions and 5 medications creates 50 rows instead of 15.

ALWAYS start with the query patterns. What questions will consumers ask? Design the schema to make those queries simple. If 80% of queries filter by date and group by category, those should be the primary dimensions.

## Slowly Changing Dimensions (SCD)

**Type 1** - Overwrite the old value. Use when history doesn't matter (correcting a typo in a name).

**Type 2** - Add a new row with effective dates. Use when you need to track what was true at a point in time (patient address at time of visit, product price at time of sale). Add `effective_start_date`, `effective_end_date`, and `is_current` flag.

**Type 3** - Add a column for the previous value. Use when you only need one level of history (current_category, previous_category).

Default to Type 2 for any dimension where the business asks "what was it at the time of X?" Start with Type 1 for everything else and upgrade when the need emerges.

## Architecture Decision Records

For every non-obvious modeling decision, write a lightweight ADR:
- **Context**: What situation prompted the decision?
- **Options**: What alternatives were considered?
- **Decision**: What was chosen and why?
- **Consequences**: What are the tradeoffs?

Keep ADRs in the repo alongside the schema. Future team members will ask "why is it modeled this way?" The ADR answers before they have to ask.

## Design Validation

Before building, validate with limited data:
1. Load a representative sample (1-5% of volume)
2. Run the top 10 expected queries
3. Verify results match expectations
4. Check query performance against SLA
5. Confirm grain is correct (no unexpected row multiplication)

## Source Schema Evaluation

You probably won't design the OLTP schema. But you'll need to evaluate whether it's a reliable source for your data product.

Quick checklist before building on a source system:
- Primary keys defined and enforced (not just implied by convention)
- Foreign keys constrained at the database level (not just in the application)
- Indexes on FK columns (missing indexes = slow extracts)
- NOT NULL on required fields (nullable everything = garbage in)
- Migrations are reversible (no destructive ALTER TABLE without a rollback plan)

Anti-patterns to flag immediately:
- `VARCHAR(255)` on every string column (signals no thought about data types)
- `FLOAT` or `DOUBLE` for money (use `DECIMAL` or integer cents)
- Missing FK constraints ("the app handles it" means orphaned rows)
- Dates stored as strings ("2024-01-15" in a `VARCHAR` breaks sorting and comparison)

See `schema-patterns.md` for common dimensional modeling patterns.
Pliki w paczce (2)
  • SKILL.md 4 KB
  • schema-patterns.md 3 KB

Wersje

W bazie nie ma innych skilli o nazwie data-model-design.

Migawka bazy z 13.11.2026 · wersja paczki 57d61841f34c (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 90data-dimensional-modeling
    Projektuje modele wymiarowe: schematy gwiazdy Kimballa, Data Vault 2.0, wolno zmieniające się wymiary i tabele faktów.
  • 100modeling-dimensional-data
    Projektuje modele danych analitycznych metodą wymiarową: schematy gwiazdy i płatka śniegu, tabele faktów i wymiarów, deklaracja ziarna, klucze zastępcze i wolno zmieniające się wymiary (SCD typu 1, 2, 3).
  • 95data-mart
    Projektuje i optymalizuje data marty: schematy gwiaździste, wymiary zmieniające się w czasie (SCD) oraz strategie ładowania.
  • 95data-modeling
    Projektuje modele relacyjne i grafowe: 3NF, schemat gwiazdy, Data Vault, grafy właściwości i RDF, z kluczami zastępczymi.
  • 90data-modeling
    Projektuje hurtownię i warstwę semantyczną: strukturę od źródła do marta, modelowanie wymiarowe, ziarno, wolno zmieniające się wymiary i warstwę metryk, z diagnozą wolnych lub błędnych zapytań.
  • 100star-snowflake-schema-dimensional-modeling
    Projektuje analityczne modele danych z centralną tabelą faktów i spłaszczonymi wymiarami do raportowania BI.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.