Portfolio case study

Chess Data Platform

Magnus Carlsen’s public chess.com history, turned into a report on where he wins and loses points: 10,033 games since 2014, replayed move by move on Microsoft Fabric.

chess.com API→Bronze→Silver→Gold→Azure SQL + Direct Lake→Power BI

Power BI report, page 1: standard chess rating by month and time control, results by year, accuracy by year Report page 1 of 6. More below ↓

The output

What a user gets

“Where does a player lose points, and what should they practise?”

A six-page Power BI report answers it, one question a page, sliced by time control and colour. Findings from the 10 November 2026 load; ratings are for standard chess only.

Rating progress · report page 1, above

2,880 → 3,404blitz rating, June 2016 to October 2026, with a peak of 3,421.
76.6%score across all games, against opponents averaging 2,981.
89.1average accuracy. In every year with more than 50 games it stays between 88.4 and 90.9.
Report page 4: material by game phase and score by material balance

Game phases

+1.31pawns of material won per game in the endgame; +0.52 in the middlegame, even in the opening.
77% vs 75%score when up three or more against down three or more. Material barely predicts the result.
6,683of 10,033 games are decided in the endgame.
Report page 3: opening families and the most common move sequences with scores

Openings

81.0%after 1.Nf3, the best-scoring first move, in 904 games.
71.0%in the Ruy Lopez after 3.Bb5, the weakest common line, in 412 games.
1,359games in the Sicilian Defense, the most played family, at 76.8%.
Report page 2: results by colour
White and Black78.8% as White, 74.4% as Black. The gap is widest in rapid: 74.6% against 67.5%.
Report page 5: clock management
The clock58.3% in the 2,702 games that reach time trouble, 83.3% in the rest. 366 of 1,735 losses are on time.
Report page 6: performance by session position and previous result
HabitsThe first game of a session scores 81.4%; later games 76.0%. After a loss, 74.1%; after a win, 77.9%.

The data behind it

10,033games, December 2014 to October 2026
892,373moves, each replayed for position, material and clock
781,527distinct board positions reached
1,300+different opponents
5,000+openings and variations played
3,421peak blitz rating

Games and moves live from the mart’s load audit. Last run: 10 Nov 2026.

Behind the scenes

The platform that produces it

A medallion lakehouse on Microsoft Fabric fetches the monthly archives from the chess.com API, replays every game, models the result as a star schema and serves it to Power BI and this website. These figures are about the platform, not the games.

What a business gets from it

  • Pays only while it works.The Fabric capacity is resumed for a run and paused after it, whether or not the load succeeded.
  • New subjects are configuration, not code.Tracking another account is a row in a config table. No pipeline, notebook or report names one.
  • No secrets in code.Data Factory signs in as its own managed identity, the one SQL password lives in Key Vault, and the load user can do nothing else.
  • Rebuildable from source.The raw layer keeps the API’s bytes as returned, so every table downstream can be rebuilt without calling the API again.
  • Numbers that were checked.The replay was tested against real archives, every measure was run before a chart used it, and each load writes an audit row per table.
  • Up when the platform is down.An Azure SQL copy of the results stays available while Fabric is paused and feeds this site’s live figures.
~15 minof compute per run; paused between runs
1 rowto track another player
42tested measures in the semantic model
13gold tables: 3 facts, 10 dimensions
67monthly archives landed raw
6report pages generated from code
  • Microsoft Fabric
  • OneLake
  • Delta Lake
  • PySpark
  • Fabric Data Factory
  • Azure Data Factory
  • Azure SQL
  • Direct Lake
  • Power BI
  • TMDL / PBIR
  • Key Vault
  • Entra ID
  • GitHub

Architecture

A medallion lakehouse on Microsoft Fabric

Left to right. A Copy activity lands the API responses, PySpark notebooks refine bronze to silver and silver to gold, and a Copy activity publishes gold to Azure SQL by truncate and reload. Fabric and the Azure resources share one Entra tenant. Data Factory reaches the capacity as its own managed identity, so there is no secret to store for it; the SQL password is in Key Vault; a contained SQL user does the load and nothing else.

Azure Data Factory · PL_Mart_Chess_MonthlyResumes the F2 capacity, waits for the Fabric run, pauses the F2. The pause runs whether or not the load succeeded.
Fabric · PL_Chess_MonthlyReads the tracked accounts from mart.tracked_account, runs PL_Chess_Bronze per account, then PL_Chess_Transform for silver, gold and publish.
  1. Source

    api.chess.com player game archives, one JSON per month.

    originexternal REST API
  2. Bronze

    lh_bronze / Files. Raw JSON, exactly as returned.

    Fabric Copy activityHTTP, binary
  3. Silver

    lh_silver / Tables. Delta: chess_game, chess_move, chess_position.

    PySpark notebooksnb_silver_chess, nb_silver_chess_position
  4. Gold

    lh_gold / Tables. Delta star schema, 13 tables.

    PySpark notebooknb_gold_chess
  5. Serve

    Azure SQL mart.* plus a Direct Lake semantic model.

    Copy activityTRUNCATE + INSERT
  6. Consume

    Power BI report: 6 pages, 42 measures.

    Direct Lake / Importand the browser dashboard

Naming conventions

Each item name says what kind of thing it is, then what it is for, so a workspace listing or a run log reads without a legend.

PrefixKindExamplesRule
lh_Lakehouselh_bronze, lh_silver, lh_goldOne per medallion layer, named for the layer.
PL_PipelinePL_Chess_Monthly, PL_Chess_Bronze, PL_Chess_TransformDomain, then role. The parent carries its cadence in its name; children carry the stage. The ADF bracket is PL_Mart_Chess_Monthly, so the two orchestrators read apart in a log.
nb_Notebooknb_silver_chess, nb_silver_chess_position, nb_gold_chessThe layer it writes, then the domain.
env_Spark environmentenv_chessThe domain whose libraries it pins.
dim_ / fact_Gold tablesdim_opening, fact_game_moveKimball: dimensions by subject, facts by grain. Keys end in _key; the unknown member is −1.
chess_Silver tableschess_game, chess_move, chess_positionDomain, then the real-world entity, one row each.
mart.Azure SQL schemamart.fact_game, mart.load_audit, mart.tracked_accountThe serving copy of gold, its audit, and the config table, in one schema a login can be scoped to.
DS_ / LS_ / TR_ADF datasets, linked services, triggersDS_Mart_LhBronze_Binary, TR_Mart_Chess_MonthlyADF’s own object types keep their own prefixes.

A run

One run, start to finish

Timings from the load on 24 September 2026. The publish step is the longest because the move fact is 892,373 rows. Spark jobs started by a service principal fail in Fabric with “unable to acquire user token”, so a user-owned Fabric schedule runs the work and ADF only resumes and pauses the capacity.

  1. ADFResume the F2 if paused.
  2. ADFPoll until Active, settle a minute.
  3. FabricThe schedule fires the parent; it looks up the tracked accounts.
  4. BronzeLand the newest archives, four at a time.
  5. SilverFlatten, reshape, replay every game.
  6. GoldDimensions, facts, surrogate keys.
  7. PublishCopy gold to Azure SQL, write the load audit.
  8. ADFSees the run finish and pauses the F2.

Layer 1

Bronze: the source as it arrived

Bronze is a replayable copy of the source. Because the API bytes are kept, silver and gold can be rebuilt without calling the API again, and an account that stops being tracked keeps its archives on disk. The folder names become partition columns when Spark reads them.

Where
lh_bronze / Files in OneLake, not Tables.
Format
Raw JSON, byte for byte the API response.
Layout
One file per player-month, Hive-style folders.
Volume
67 archives, December 2014 to October 2026.
Rule
Never edited. The newest archives are re-landed each run.

PL_Chess_Bronze

  1. Lookup the archive list
  2. Set variable: last N months
  3. ForEach, 4 in parallel
  4. Copy binary, HTTP to lakehouse
lh_bronze/Files/chessdotcom/games/
  username=<account>/
    archive=2026-08/games.json
    archive=2026-09/games.json

{ "games": [ {
  "url": ".../game/live/...",
  "time_control": "180+2",
  "time_class": "blitz",
  "rated": true,
  "end_time": 1785721149,
  "eco": ".../openings/Sicilian-Defense...",
  "white": { "rating": 3262, "result": "win",
             "username": "<account>" },
  "black": { ... },
  "pgn": "[Event ...] 1. d4 {[%clk 0:03:02]} ..."
} ] }

Layer 2

Silver: one row per game, one per move

The first notebook keeps the accounts it is handed, flattens the JSON, reshapes white and black into player and opponent, and replays every game with python-chess to get the board position, material and clocks after each move. A second notebook keeps a registry of every distinct board and the patterns found on it. The library is pinned in a Fabric Environment so every Spark executor has it.

Where
lh_silver / Tables as Delta.
chess_game
10,033 rows, one per game from the tracked player’s side.
chess_move
892,373 rows, one per half-move.
chess_position
781,527 rows, one per distinct board. A board is evaluated once, when it first appears, so this is the one table a run adds to instead of rebuilding.
Checked
The replay was tested locally against real archives before it ran on Fabric: every final position matched chess.com’s own.

chess_move, a 3+2 blitz game from August 2023

plysideSANpiececapturecastleclockmaterial W / Bposition after
1whited4P182.039 / 39rnbqkbnr/pppppppp/8/8/3P…
2blackd5P182.039 / 39rnbqkbnr/ppp1pppp/8/3p4/…
3whiteBf4B183.239 / 39rnbqkbnr/ppp1pppp/8/3p4/…
6blackdxe4Pyes172.738 / 39rnbqkbnr/pp2pppp/8/2p5/…
13whiteO-O-OKyes180.438 / 39rnbqkb1r/1p3ppp/p3pn2/…
19whiteRxd5Ryes160.934 / 35rnb1kb1r/1p3ppp/p7/q1pR4…

Layer 3

Gold: a Kimball star schema

Three facts at different grains share seven conformed dimensions, so a slicer on time control or opening filters games, moves and pattern spans alike. The move fact carries two dimensions of its own and the span fact one. Surrogate keys are generated in Spark; a −1 member stands in for unknowns. The whole mart is truncated and reloaded each run, which is why there is no merge logic at this scale.

  • dim_date4,748 rows
  • dim_player1 row
  • dim_opponent1,358 rows
  • dim_time_control17 rows
  • dim_opening5,059 rows
  • dim_result15 rows
  • dim_color2 rows
fact_gameOne row per game, from the player’s side. 10,033 rows: result, ratings, accuracy, material by phase, time trouble, session position.
fact_game_moveOne row per half-move. 892,373 rows: clock, time spent, material, and the board position kept on the fact.
fact_pattern_spanOne row per unbroken stretch of a game in which a pattern held for one side. 19,382 rows: who held it, from which move to which, and whether it lasted to the end.
Only on the move fact: dim_position_profile · 47 rows, phase and castling flagsdim_position · 98,829 rows, every board of moves 1 to 10
Only on the span fact: dim_pattern · the pattern catalog

The position stays on the fact rather than in a dimension: 86% of the 892,373 moves reach a board that no other game reaches, so a row per position would be nearly as large as the fact. Boards repeat almost only in the opening, so dim_position keeps every board of the first ten moves, which is the opening tree the report’s explorer reads. Later play is described by pattern instead: a yes-or-no question about one side of a board, such as holding the bishop pair, that thousands of different boards share. The catalog holds that one pattern today; adding another is a function and a catalog row, with no change to the tables or the model.

Serving

Serving: Azure SQL and Direct Lake

The ChessImprovement semantic model reads the Delta tables in lh_gold through Direct Lake; the deploy script reframes it after each run. The same 13 tables are copied to Azure SQL, which stays available while Fabric is paused and feeds the live figures on this page. The model and the report are generated by a script from the gold schema and pushed through the Fabric REST API, so nothing is edited by hand.

  • Model: 13 tables, 24 relationships, 42 measures in display folders, hidden keys, friendly names, sort-by columns.
  • Report: six pages, one question each, sliced by time control and colour. The player’s name comes from the model, not the report.
  • Checked: every measure was run through the executeQueries API before a visual used it.
  • Import twin: the generator also writes an Import-mode project on Azure SQL for Power BI Desktop.
measure 'Performance Rating' =
    [Avg Opponent Rating]
      + 400 * DIVIDE([Wins] - [Losses], [Games])
  formatString: #,0
  displayFolder: Rating

measure 'Conversion %' =
    CALCULATE([Score %],
      'Game'[Max Material Diff] >= 3)

partition Game = entity
  mode: directLake
  source
    entityName: fact_game
    expressionSource: DatabaseQuery

Fabric

The workspace

Fabric draws the lineage from the items and their connections. These captures are from September 2026: the pipeline canvases predate the account lookup in the parent, and the position notebook and the two pattern tables were added after them.

Fabric workspace lineage view: HTTP and SQL connections feeding pipelines, notebooks and lakehouses through to the semantic model and report
Lineage

An HTTP connection for the chess.com API and a SQL connection feed the pipelines. env_chess supplies python-chess to the silver notebook. The gold lakehouse’s SQL endpoint feeds the semantic model, which feeds the report.

PL_Chess_Monthly pipeline canvas
PL_Chess_MonthlyLooks up the tracked accounts, runs bronze per account, then the transform child.
PL_Chess_Bronze pipeline canvas
PL_Chess_BronzeLookup the archive list, pick the newest, copy four at a time to lh_bronze.
PL_Chess_Transform pipeline canvas
PL_Chess_TransformSilver notebooks, gold notebook, then ForEach table: copy to Azure SQL and write the load audit.
nb_silver_chess notebook open in Fabric
nb_silver_chessThe replay: every game re-played move by move for position, material, castling and clocks.
Fabric Environment env_chess with the chess library pinned
env_chessPins chess 1.11.2 for every Spark executor.
lh_gold lakehouse showing fact_game_move as a Delta table
lh_goldfact_game_move as a Delta table, with its surrogate keys.
ChessImprovement semantic model in Fabric model view
ChessImprovementThe star schema in model view, generated as TMDL.
Fabric Monitor hub listing pipeline, notebook and semantic model runs
Monitor hub

Pipeline, notebook and semantic model runs with status and start time. Each publish also writes a row per table to mart.load_audit.

In short

  • Architecture: a medallion lakehouse on Fabric and OneLake.
  • Engineering: Data Factory, PySpark, Delta, a config table instead of names in code.
  • Modeling: a Kimball star schema: exact boards for the opening, patterns for the rest.
  • BI: a Direct Lake model and report generated from code.

The repository is private and available on request. A live walkthrough shows the most: resume the capacity, run the pipeline, watch the lineage and the report update.