Preparing your design workspace

Loading the problem and your latest saved attempt…

Design Daily JSON Ingestion into a Data Warehouse

Load one daily JSON file into a warehouse with clear readiness, validation, retry and publication guarantees.

Problem statement

For this exercise, assume a source produces one immutable JSON-array file per UTC day in object storage. A completion marker identifies the day, object version, content hash and schema version. The file contains records for that day and may be up to 10 GB.

Design a daily pipeline that detects a completed file, validates it, applies a versioned deterministic field mapping and publishes its rows into one day-partitioned warehouse table.

The completion marker, schema versions, field mapping and storage interface are practice assumptions. Every record must satisfy the selected schema; one malformed record, unsupported schema or mismatched file hash fails that run without exposing partial new output.

A missing completion marker means the day is waiting, not that an empty successful dataset exists. An empty, valid JSON array is a successful zero-row daily dataset.

For this exercise, one logical run is identified by dataset, day, immutable file version/hash and transformation version. Repeated scheduling or worker retries of that same run must not duplicate visible rows.

Publish a day atomically only after the entire file has been parsed and staged output passes the declared row-count and schema checks. A successful day remains visible through retries of its completed run.

Conflicting content or transformation versions for an already published day require an explicit conflict outcome; designing corrections to a published day is outside scope.

Target publication within one hour of the completion marker and retain raw files, validation results and run manifests for 30 days as practice assumptions. A worker may fail at any step, including after warehouse commit but before recording local success.

Operators must distinguish waiting, running, failed and published days, inspect safe diagnostic evidence and replay the same immutable input. Explain bounded-memory parsing, staging, publication authority, retries, access control and monitoring.

Streaming CDC, multi-source joins, dashboard design, arbitrary transformation code and historical corrections are outside scope.

What to build

  1. The pipeline discovers the completed immutable JSON file for a day and distinguishes missing input from a valid empty dataset.
  2. The pipeline verifies the file identity, parses the full JSON array, validates each record and applies a pinned deterministic mapping into isolated warehouse staging.
  3. A validated day becomes visible atomically, and retries of the same logical run do not duplicate rows or expose partial output.
  4. Authorized operators can inspect run status and safe validation evidence, and replay the same immutable input after failure while preserving lineage.

At scalePractice assumption

  • Process one daily JSON-array file of up to 10 GB and publish its warehouse partition within one hour of the completion marker.
  • Retain immutable raw input, run manifests and validation results for 30 days so the same logical run can be replayed.
  • Scheduler delivery may repeat and workers may fail before or after warehouse commit; transport and execution need not be exactly once.
  • No partial new day is visible, and a published day rejects a different input or transform identity rather than silently replacing data.