ARCHITECTURE EXERCISES / SYNTHETIC EXAMPLES

What I'd test
before choosing the design.

These exercises are deliberately made-up scenarios with real engineering constraints. Their purpose is to show the questions I'd ask, the math I'd check and the evidence that could change my mind.

For actual first-person project stories, including cloud portability and retail analytics, see the Work page.

Four decisions I'd
work through on paper first.

Not a pattern catalog.
A decision record.

01Declare assumptions

Separate the facts known from estimated inputs and unknown dependencies.

02Compare real alternatives

Account for throughput, reliability, ownership, operational complexity, and cost.

03Define falsification

Specify the measurement or evidence that could reverse the recommendation.

Can a rate-limited REST API support near-real-time reporting?

Imagine an enterprise source that produces 12 million events/hour, at an average payload of 1 KB/event, while a vendor limits retrieval to 50 requests/second. The reporting target is a 15-minute freshness window.

3,333EVENTS / SECOND AT AVERAGE LOAD
~12 GBUNCOMPRESSED PAYLOAD / HOUR
≥67EVENTS / REQUEST NEEDED AT 50 RPS

Before selecting streaming infrastructure, the upstream API must pass a feasibility test. If each request returns one event, 50 requests/second supports only 180,000 events/hour—far below the required volume. The minimum of roughly 67 events per successful request ignores retries, pagination overhead, throttling, and peak bursts.

Options to compare

  • Incremental paginated polling with checkpoints and backpressure.
  • Vendor-native bulk export or change feed if available.
  • Scheduled ingestion into object storage followed by streaming or micro-batch transforms.

Decision criteria

  • Actual page size, allowable requests, response size and latency.
  • Peak burst profiles, retry budgets, consistency, ordering, and deduplication.
  • End-to-end freshness, not just downstream processing speed.
Provisional recommendation

Prove extraction capacity first. Prefer a durable, replayable landing zone and incremental checkpoints over coupling reporting directly to vendor HTTP calls. Switch to bulk or event-based exports if measured API throughput cannot sustain bursts within the freshness budget.

What would change the decision?

A demonstrated vendor bulk export, larger allowable page size, or a different rate-limit interpretation could change feasibility materially. A cap on concurrent connections is not automatically a cap on requests/second: validate what the contract actually limits.

When tuning SQL cannot fix a slow operational workflow

Suppose an application waits synchronously for a computationally expensive analytical reforecast. Even with efficient queries, a user-facing request inherits the entire cost and variability of data preparation, computation, service capacity, and retries.

Option A · Keep it synchronous

Simple request-response flow, but latency spikes and failure propagation remain user-visible. This is appropriate for short, predictable, interactive operations.

Option B · Decouple execution

Queue a job, process asynchronously, materialize versioned results, and let the application retrieve the latest complete result. This adds status handling, staleness policies, and operational coordination.

Decision rule

If the workflow tolerates eventual freshness but not unpredictable request latency, an asynchronous batch or job boundary is often a better first step than deeper query tuning. A serving redesign may follow once access and update patterns are measured.

What I would measure

  • P50/P95 completion time, actual compute time versus queue and startup time.
  • Whether users need immediate results, the latest complete snapshot, or progress notifications.
  • Failure recovery, idempotency, versioned output, and consistency during job replacement.

What would change the decision?

If the workload is consistently short, deterministic, and requires strongly consistent interactive updates, synchronous execution or a different serving store could be preferable. The user experience and freshness contract—not technology preference—should determine the boundary.

A shared metric definition is not the same as a shared answer

Imagine SQL, a BI dashboard, and an AI assistant all claim to compute net revenue using the same governed source. Different joins, refund handling, fiscal windows, or user permissions can still produce inconsistent outcomes.

The meaningful test is whether they preserve the same business contract: equivalent grain, filters, time semantics, authorization, and data snapshot for an equivalent question.

What fails in practice

  • Refunds silently omitted from one implementation.
  • Fiscal reporting filters applied differently across consumers.
  • AI-generated queries using the wrong effective access scope.

What a defensible harness checks

  • Reference outputs and reproducible input fixtures.
  • Equivalent question and authorization scope.
  • Consumer-specific result comparisons and discrepancy explanations.

One metric. One meaning. Everywhere.

Run a synthetic six-transaction dataset through SQL, BI, and agent-like calculation paths. Toggle defects to see exactly why apparent semantic alignment can break.

Open the executable metric lab ↗

What would change the decision?

Running this against a real platform means real query engines, real user identities, snapshot controls and drift checks over time. The browser version shows the method.

The cheapest run cost can conceal the most expensive change

Compare two notional platform choices: an integrated stack with fewer short-term integration points versus modular components with more explicit contracts. Neither wins by default.

Integrated approach

Potential advantage: lower operational overhead and faster time to value. Risk: business definitions or governance become tightly coupled to one vendor's stack.

Composable approach

Potential advantage: selectively replace components without rebuilding every layer. Risk: poorly owned interfaces can create expensive integration and governance work.

A more complete cost model

Compare run cost + integration and operations + change effort + security/governance continuity + migration and retraining + value of time-to-decision. Use ranges and explicit assumptions, not a false single-point TCO number.

What would change the decision?

Validated change frequency, dependency maps, vendor portability tests, governance requirements, team skills, and a measured cost-of-change estimate. Open file formats alone do not answer the question.

From examples to
repeatable methods.

The studies above illustrate how to reason about trade-offs. For reusable prompts, decision rubrics, and test contracts, visit the Frameworks page.

Explore the frameworks →