Architecture Review — Simplicity Grade
Architecture Review — Simplicity Grade
Reviewer: Architecture review of
SmallBusinessGrade/ (documents, diagrams, Python reference
implementation) Date: 2026-11-06
Scope: README.md,
Architecture/01, Architecture/02,
Architecture/diagrams/, src/ (adapters,
storage, silver/gold, tests) Method: read every
document and source file, ran the test suite (3 passed), attempted
pip install -e ., and checked the external-API claims
against vendor documentation.
The findings below describe v1.0 as reviewed on 2026-11-06. The High and Medium findings were then remediated in v1.1; the outcome is in section 1.1. Each finding names where it was fixed. Severity: High = the claim or design is wrong and would mislead a reader or lose data; Medium = inconsistent or under-specified; Low = polish.
1. Verdict
The design idea is sound and fits a mid-market team: serverless containers, an adapter per source, immutable landing, Delta tables, a Python-first transform. The documents are well written and the trade-offs against the Enterprise grade are clear.
It is not yet defensible as a complete architecture, for four reasons:
- The serving story contradicts the thesis (Power BI "Direct Lake" is a Fabric feature) and no serving layer is actually chosen.
- The GDPR story overclaims. Plaintext names stay in Silver, Bronze/landing erasure is unspecified, and a global salted hash is pseudonymisation, not anonymisation.
- The reference implementation does not implement what the
documents promise (no
MERGE, no paging loop, no token-bucket, a stub Google Ads adapter) and contains two data-loss bugs. - Cloud, orchestrator hosting and table format are left open ("Azure or AWS or GCP", "Dagster or Prefect", "Delta or Iceberg"), which an architecture document should decide.
| # | Area | Severity | Finding |
|---|---|---|---|
| F1 | Serving | High | "Direct Lake" and "DirectQuery from Gold Delta" are not available outside Fabric |
| F2 | GDPR | High | Silver keeps plaintext names; "zero plaintext identifiers" is false |
| F3 | GDPR | High | Erasure does not cover Bronze, landing replay, or source-initiated deletes |
| F4 | Code | High | Salesforce LIMIT 2000 silently truncates
extraction |
| F5 | Code | High | Google Ads Silver de-duplication keeps the oldest value, defeating restatement |
| F6 | Consistency | High | Retention 14 days vs. replay, 90-day restatement and backfill |
| F7 | Cost | Medium | Orchestrator is not scale-to-zero; run-time estimate is optimistic |
| F8 | Cost | Medium | Fabric comparison uses only F8/F16 and ignores pause and smaller SKUs |
| F9 | Code | Medium | Documented MERGE, token bucket, paging loop and OAuth
refresh do not exist |
| F10 | Code | Medium | Google Ads adapter is a stub on a retired API version |
| F11 | Docs | Medium | Bronze exists in the prose but not in the C4 view or the code |
| F12 | Docs | Medium | Open choices: cloud, orchestrator, table format, PySpark vs. delta-rs |
| F13 | Ingestion | Medium | HubSpot webhook receiver and rate limits are mis-specified |
| F14 | Data model | Medium | No attribution model; fact_attribution and
dim_customer are unspecified |
| F15 | Cross-cutting | Medium | No environments, CI/CD, IaC, DR, network security or data-quality design |
| F16 | Packaging | Low | pip install -e . fails; docs inconsistencies and
leftovers |
v2.0 note (simplification). After v1.1 the client profile was clarified: a marketing company that needs a simple architecture. v2.0 therefore switched the recorded default cloud to Google Cloud and removed the heavier v1.1 additions: the Dagster server and its PostgreSQL database, the webhook receiver and queue, private endpoints, two environments and five of the eleven ADRs. This review is kept as history of v1.0. ADR numbers and mechanisms named in the tables below refer to v1.1; v2.0 has ADR-S01 to S06 (mapping in 02-Architectural-Rationales.md). Several findings are now closed by removing the component rather than by fixing it: F7 (orchestrator cost and scale-to-zero), F11 (Bronze), F13 (webhook receiver), and most of F15 (kept as a short operations section). F1 (serving) is closed by BigQuery instead of Power BI Import. The code fixes (F4, F5, F9, F10 and the two extra defects) and the privacy design (F2, F3, F6) are unchanged.
1.1 Remediation status (v1.1, 2026-11-06)
High and Medium findings (F1 to F15) were addressed in the documents and the reference code; F16 was cleaned up as well. The test suite grew from 3 to 23 tests and passes. "Open" means a confirmation or a live validation is still needed.
| # | Status | What changed | Still open |
|---|---|---|---|
| F1 | Fixed (design) | Direct Lake and DirectQuery claims removed; Power BI Import chosen, SQL engine as an upgrade path (Architecture/01 s10, ADR-S09) | Proof of concept for the Delta connector and refresh time |
| F2 | Fixed | Names dropped from Silver; keyed HMAC; no default key (fails closed); field classification table; "pseudonymisation, not anonymisation" stated; no routine key rotation | DPO sign-off on the classification |
| F3 | Fixed | Erasure ledger and erase_subject (code, tested);
runbook covers landing, Silver, Gold, vacuum, serving; source-initiated
deletes feed the ledger; Bronze removed |
DPO confirmation of the one-month assumption |
| F4 | Fixed | LIMIT removed; nextRecordsUrl followed;
regression test with 2,001 records |
|
| F5 | Fixed | Newest ingestion wins, independent of file order; regression test | |
| F6 | Fixed (proposed) | Landing retention 21 days, vacuum 7 days, worst-case erasure 28 days (ADR-S10) | Architect to confirm the 21 days |
| F7 | Fixed (docs) | One cost model, about $50 to 100 per month, orchestrator shown as always-on, run profile stated | Validate with the Azure Pricing Calculator |
| F8 | Fixed | F2/F4/F8/F16 comparison; saving restated as roughly 3 to 10 times; build and run effort stated | Confirm current Fabric list prices |
| F9 | Mostly fixed | Delta MERGE with newest-wins and tombstones, token
bucket, paging loop, retries on network errors, max_retries
honoured, 401 refresh, watermark driver,
extract_historical |
Dagster wiring, ADLS sink, Key Vault client and reconciliation job are described, not coded |
| F10 | Partly fixed | Real searchStream call, OAuth refresh, configurable API
version (default v21), trailing window; Salesforce version
configurable |
Never run against a live account; mocked contract tests only |
| F11 | Fixed | Bronze removed from the design; landing is the raw layer | |
| F12 | Fixed (proposed) | Azure, Dagster self-hosted, Delta with delta-rs, no Spark, no Prefect (ADR-S02, S07, S08) | Architect to confirm the Proposed ADRs |
| F13 | Fixed | Webhook receiver and queue added to C4; 5 requests per second, page
size 200 shared constant; contacts use lastmodifieddate;
requested properties list added |
Verify property names against a live portal |
| F14 | Specified | Gold model, keys, campaign_key, attribution rule and
join identifiers (Architecture/01 s11); dim_campaign and
fact_daily_spend use the composite key |
fact_attribution not built; needs marketing input on
rule and gclid/UTM capture |
| F15 | Fixed (docs) | Section 15 and ADR-S11: environments, CI/CD, IaC, identity, network, DR, data quality, drift, monitoring | No IaC or pipeline files written yet |
| F16 | Fixed | pip install metadata builds; README, placeholder
e-mail, deprecated utcnow, LaTeX arrows, diagrams aligned
with the code |
Two defects were found while fixing and were not in the original review:
- The HubSpot search request did not ask for
phone,lifecyclestageor any other non-default property, so Silver would have received empty values. The adapter now requests an explicit property list. - A hard delete in the Delta
MERGElet a late, older batch resurrect a deleted row. Deletes are now tombstones.
2. Findings
F1 — Serving layer contradicts the thesis (High)
01 §2says Power BI uses "DirectQuery or Import from Gold Delta"; the C4 container diagram says "Direct Lake / SQL";01 §7.2lists "Power BI Direct Lake / Import Licensing".- Direct Lake runs only on Microsoft Fabric capacity (F SKUs; legacy P SKUs for existing customers) (Microsoft Learn, Direct Lake overview). Using it brings back the always-on capacity the architecture rejects in ADR-S01.
- Power BI has a Delta Lake connector for Import mode; there is no DirectQuery connector for raw Delta files on S3/ADLS (to be confirmed in a proof of concept). Metabase and Superset cannot read Delta files directly either; they need a SQL engine in front.
- Fix: add an ADR "Serving layer". Options: (a) scheduled Import refresh of Gold into Power BI (simplest; fits batch freshness and the existing Power BI Pro licences), (b) DuckDB/Trino/Synapse serverless/Databricks SQL as a SQL endpoint, (c) export Gold to a small warehouse. Remove every "Direct Lake" reference. State the refresh cadence against the Tier 1 latency promise: a 15-minute CRM tier is meaningless if the dashboard refreshes eight times a day.
F2 — Silver keeps plaintext identifiers (High)
01 §9.1and the diagram promise "Silver and Gold datasets hold zero plaintext identifiers".transformations/silver.pywritesfirstnameandlastnamein clear. Salesforce records (FIELDS(STANDARD)) bring far more personal fields (name, address, phone, title, email).- The text says HMAC-SHA256 (diagram) and
sha256(concat(email, salt))(prose); the code computessha256(f"{email}:{salt}"). It is not an HMAC. Usehmac.new(key, msg, sha256). - The default salt
"acme_secret_salt_2026"is hard-coded inSilverConformer.__init__. A missing secret must fail the job, never fall back to a constant. - A deterministic hash of an e-mail address with a single global key is pseudonymisation under GDPR (Recital 26), not anonymisation. The data stays personal data and in scope. Anyone holding the key can re-identify by dictionary. The text in ADR-S05 ("privacy-friendly", "no privacy risk") should say so.
- Key rotation breaks joins. Rotating the salt
(promised as "rotatable") changes every
pseudonym_id; the design needs a key version column and a re-key procedure, or rotation is not offered. - "Free-text notes and IP addresses are stripped or generalised" is stated but not implemented or designed (which fields, which job).
- Fix: decide per field (drop, hash, keep) in a field-level classification table; drop names from Silver or move them to a restricted schema; use HMAC with a versioned key; fail closed on a missing key.
F3 — Erasure is incomplete (High)
- The erasure runbook deletes from
silver.contactsandgold.customer_attributiononly. The architecture also holds: landing JSONL (verbatim PII), Bronze Delta ("append-only",01 §2), Delta history/time travel, any BI Import cache and exports. VACUUMremoves old files only after the retention window (Delta default 7 days); until then time travel still returns the erased rows. The heading says "Crypto-Shredding" but nothing is shredded: no per-subject key is destroyed.- Source-initiated deletes are not designed. When
HubSpot or Salesforce deletes a contact for GDPR, the lake keeps its
copy unless the delete is propagated.
01 §3lists delete detection, but Silver/Gold handling of those tombstones is never described. - To erase by e-mail, the operator must hash the e-mail with the current key. That works only while the e-mail is known and the key version is known (see F2).
- Fix: write an erasure runbook that lists every store, the maximum time to complete, how it is evidenced, and the interaction with the 14-day landing retention. Either keep Bronze out of the design (see F11) or treat it as an erasable store.
F4 — Salesforce extraction truncates silently (High, code)
adapters/salesforce.py appends LIMIT 2000
to the SOQL. The REST query endpoint returns done: true as
soon as the limited result set is delivered, so for a window with more
than 2,000 changed records the adapter returns the first 2,000, sets
has_more = False, and the watermark advances. The rest is
lost without an error.
nextRecordsUrl is read but never used.
Fix: drop the LIMIT and follow
nextRecordsUrl until done, or use Bulk API 2.0
for large windows (as the document claims). Add a test with a
2,001-record fixture.
F5 — Google Ads Silver keeps the oldest row (High, code)
process_google_ads_performance calls
drop_duplicates(subset=["campaign_id","metric_date"]),
which keeps the first row seen. The architecture exists
to absorb restatements (a trailing 30-day pull re-delivers the same day
with newer numbers). Which copy wins depends on file read order, so
stale metrics can win. process_hubspot_contacts sorts by
updated_at before de-duplicating; the ads path has no
equivalent, and ad rows carry no source version at all (only
_batch_id).
Fix: order by _ingested_at (or batch
time) descending and keep the newest, or do the Delta MERGE
the document describes with "newest wins". Add a restatement test.
F6 — Retention rules contradict recovery rules (High)
01 §9.2: landing files older than 14 days are deleted automatically.01 §5.3: replay "from the raw landing files" after a transformation bug; reload "e.g. due to an upstream audit";01 §4Tier 4: weekly 90-day reconciliation.- After day 14 there is nothing to replay; every replay older than two weeks becomes a source re-extract and spends API quota, the thing replay was meant to avoid. A bug found on day 20 cannot be replayed.
- Fix: choose the retention from the recovery objective (for example 35–90 days) and make the erasure design cover it (F3), or keep landing long-term in encrypted form with per-subject keys. State the decision in an ADR.
F7 — Cost model is optimistic (Medium)
- Dagster open-source needs a web server, a daemon and a Postgres metadata database, all always on. That is not scale-to-zero and costs more than the "$0–20" line. Dagster Cloud Serverless is a paid per-credit service. The cost table's "Total ~$20–65" and the claim "zero idle compute" do not hold with a self-hosted orchestrator.
- Tier 1 asks for 15-minute polling: 96 runs/day per entity. With container start-up, auth, paging and write, "~45 min/day total" for all sources is unlikely. Re-estimate as runs × duration.
- The webhook receiver (F13) is an always-on or HTTP-scaled endpoint, also missing from the cost table.
- The figures disagree across documents: README **$35–90/month**, `01` summary "sub-$100",
01 §7.220–65 * *,ADR − S01compute * *15–40 against01 §7.2compute $12–25. Use one sourced estimate with stated assumptions and a date. - Engineering and on-call effort is not costed. For a small team that is the dominant cost, and it is the real counter-argument to "build it yourself" (see F8).
F8 — The Fabric comparison is a narrow comparison (Medium)
The "capacity trap" argument prices only F8/F16 at "€1,150–2,300". Smaller SKUs (F2, F4) exist, and capacities can be paused or scheduled; also, Fabric includes the SQL endpoint, Power BI Direct Lake, governance and managed Spark that this design has to build or buy separately. Re-check the euro figures against the current Azure pricing page before quoting them, and compare like-for-like (F2/F4 with pause, plus the missing serving layer from F1). The conclusion (serverless is cheaper at this volume) is probably still right, but the document should show that it survives the strongest version of the alternative.
F9 — Documented mechanisms do not exist in the code (Medium)
| Claim in documents | Reality in src/ |
|---|---|
Delta Lake MERGE INTO into Silver
(01 §5.2) |
No Delta write anywhere. deltalake is a dependency but
never imported. Silver functions return pandas DataFrames. |
Token-bucket rate limiting (02 ADR-S04,
01 §8) |
Only retry with backoff. No limiter. |
Full paging loop, extract_historical,
_apply_retry_backoff,
_write_to_landing_storage, ISourceAdapter
(ADR-S04 and diagrams §3) |
extract_window performs one fetch and
returns has_more; nothing loops. The other methods and the
interface do not exist. |
max_retries constructor parameter |
Ignored; the decorator hard-codes 5 attempts. |
| Retry on transient errors | Only HTTP 429/5xx. requests.ConnectionError and
Timeout are not retried. The 429 path sleeps
Retry-After and then also waits the tenacity backoff. |
| OAuth token refresh | Salesforce and Google tokens are static constructor arguments; they expire. |
| Secrets in Key Vault | Tokens are passed as plain strings; no secret provider abstraction. |
| Watermark store and safety lag | Watermark model exists, nothing reads or writes
it. |
| Reconciliation notebook with 0.05 % threshold | Not implemented; also hard to apply uniformly (Google Ads has no cheap source-side record count, and source counts differ from Silver counts after de-duplication and deletes). Define the reconciliation per source. |
The reference code is described in README.md as
"production-grade". It is a good illustration of the adapter pattern;
call it a reference skeleton until the above exists.
datetime.utcnow() is deprecated (Python 3.12+); use
datetime.now(timezone.utc).
F10 — Google Ads adapter is a stub on a retired API (Medium)
GoogleAdsAdapter._fetch_records returns a single
hard-coded record regardless of input; test_connection
always returns True. The base URL is …/v16.
Google retires each API version about a year after release; v16 was
scheduled to sunset in early 2025 (Google's schedule was tentative), and
v20/v21 are the current versions (Google
Ads API sunset dates). The document also repeats "Basic Developer
access, 15,000 operations/day"; check the current access-level limits
before quoting them. Salesforce is pinned to v60.0 (Spring
'24); pin a current version and add the version to the configuration,
not the code.
F11 — Bronze exists in prose only (Medium)
01 §2 defines Landing → Bronze Delta →
Silver; the C4 container diagram has no Bronze container and the code
reads landing JSONL straight into Silver. Decide: either drop
Bronze (landing is the raw layer; simpler, and removes one PII
store from F3) or keep it and add it to the C4 view and the code. The
word "Bronze" in the README's comparison table (Enterprise has Bronze)
invites the question. The same sequence diagram in 01 §6
still says "OneLake / S3 Storage", a Fabric leftover.
F12 — Open choices that an architecture should close (Medium)
- Cloud: Azure Container Apps / ECS Fargate / Cloud Run are listed as equals everywhere. Acme uses Power BI, so Azure is the evident default. Record it in an ADR and name the AWS/GCP equivalents only as a portability note.
- Orchestrator: "Dagster (or Prefect)": choose one and the hosting model (F7).
- Table format: "Delta or Iceberg" (README §2):
choose Delta (delta-rs/
deltalakeis already used) or justify Iceberg. - Engine: the text says "PySpark/Polars/DuckDB" and
"no Spark cold-start" in the same paragraph. PySpark in a 2 vCPU / 4 GB
container is not a lean option. The code uses pandas +
deltalake. Standardise on Polars or DuckDB with delta-rs and say that PySpark is out of scope. - ADR coverage: ADR-S01…S06 omit: cloud provider, table format, serving layer (F1), landing retention (F6), environments/IaC (F15). All six ADRs are "Accepted" with no recorded approver or decision-rights mode; the Enterprise set records Proposed/Accepted by a board.
- Naming: the ADR file is
02-Architectural-Rationales.mdwithADR-S0nheadings; consider one file per ADR if the set grows (the Enterprise grade usesdecisions/NNNN-*.md).
F13 — HubSpot webhooks and rate limits (Medium)
- A webhook "nudge" needs a publicly reachable HTTPS endpoint with signature validation. There is no container for it in the C4 view, and it contradicts "scales to zero" unless the platform scales on HTTP and tolerates a cold start for the first event.
01 §8quotes "100–150 req/10 sec". That is the general API burst limit. The CRM search endpoints are limited to 5 requests per second per account, 200 objects per page, 10,000 results per query (HubSpot developer docs). The document specifiesLIMIT 200; the code useslimit: 100and hard-codeslen(results) == 100to decidehas_more. Make the page size a constant used in both places.HubSpotAdapter.test_connectioncalls the private-app API-usage endpoint; confirm it works with the minimal scopes a read-only private app gets, or use a cheap object read instead.
F14 — No attribution model (Medium)
The Gold layer promises dim_campaign,
dim_customer, fact_ad_spend,
fact_attribution. Only dim_campaign and a
daily-spend fact exist in code. The business value of the platform is
joining ad spend to CRM outcomes, and the documents never state the join
key: gclid/UTM capture in HubSpot and Salesforce,
campaign-ID mapping across Google Ads, HubSpot and Salesforce, the
attribution rule (first touch, last touch, windowed), and how restated
spend flows through. dim_campaign is keyed by
campaign_id alone and will collide across channels; it
needs a surrogate key or a (channel, campaign_id) key.
F15 — Cross-cutting concerns not covered (Medium)
Nothing is said about: dev/test/prod environments and promotion;
CI/CD for the container image and pipeline code; infrastructure as code;
network isolation (private endpoints for storage and Key Vault);
identity and RBAC (workload identities, who may read PII-bearing zones);
backup and disaster recovery (Delta time travel and VACUUM
are not backups; enable object versioning and soft delete); data-quality
checks beyond schema (freshness, null rates, row-count bounds);
schema-drift handling in practice (what happens to an unknown field);
logging, metrics and SLOs; runbooks. The Enterprise grade covers these;
a lean architecture may do less, but it should say what it does
instead.
F16 — Packaging and polish (Low)
pip install -e .fails:pyproject.tomldeclaresreadme = "README.md"andsrc/README.mddoes not exist. The README also listsnotebooks/andtests/as siblings of the package; the notebook is underacme_simplicity/notebooks/.- The author e-mail
kiril.iliev@example.comis a placeholder. - Only three tests exist, all for HubSpot/Silver. The README promises "contract and resilience testing". Missing: Salesforce paging (would have caught F4), Google Ads restatement (F5), Gold, storage, idempotent rerun.
$\rightarrow$(LaTeX) appears in01 §9.1and ADR-S06; it renders literally in GitHub Markdown and in the Pages build. Use→.01 §6usesdagster job execute --config '{…}'; verify the CLI syntax against the Dagster version chosen (F12).- Status line says "Approved for Executive & Technical Review" while ADRs say "Accepted"; align the vocabulary.
diagrams §3showsISourceAdapter,secrets_manager,rate_limiter,TikTokAdsAdapter; the code has none of them. Mark the TikTok class as illustrative.
3. What is good (keep)
- Clear positioning against the Enterprise grade, with explicit trade-offs in every ADR.
- Per-source ingestion table (SystemModstamp, keyset paging, trailing window) is technically right and the rationale for each is correct.
- Immutable landing plus idempotent downstream write is the correct recovery model, once F5, F6 and F9 are fixed.
- Notebook-first debuggability is a real argument and the walkthrough file demonstrates it.
- Adapter pattern with a thin subclass per source is a good extensibility story; the code shape supports it.
4. Recommended order of work
- Correct before showing a client: F1, F2, F3 (text), F6; reconcile the cost figures (F7).
- Fix the two data-loss bugs and add tests: F4, F5.
- Close the open choices with ADRs: cloud, orchestrator, table format, serving layer, landing retention (F12, F1, F6).
- Make the skeleton match the claims or reword the claims: F9, F10, F11, F13, F14.
- Add the missing cross-cutting section: F15.
- Polish: F16.
5. Open questions for the architect
- Is the intended audience a real small-business client (then the serving layer and GDPR scope drive the design) or a portfolio contrast with the Enterprise grade (then reword "production-grade" and keep the code a skeleton)?
- Which cloud does Acme's Power BI tenant already live in?
- What is the recovery objective for a transformation bug: days, weeks or months? It sets landing retention.
- Is the 15-minute Tier 1 target a hard requirement? If the dashboard refreshes a few times a day, the polling cost and the webhook receiver can both go.