WIN-3370 — Rules on ingested data, explained for someone new

Video version (MP4)
WIN-3370 · Spike · Urgent

The ask, in one sentence

Design a standard way to add rules to data on its way into the data warehouse — and prove it with one real rule from Carrie.

Reporter

Carrie Rackers Cunningham

Assignee

Arnold Dajao

Type

Spike: a design plus a small proof of concept

Today each rule is written by hand, one at a time. The ticket's own word for that is "ad hoc".

Background

The landscape: where the data lives

Source

Salesforce

Where staff enter and update students, applications, programs and courses.
→
Warehouse

Amazon Redshift

A database built for reporting. A copy of the Salesforce data is kept here.
→
Consumers

Reports

Dashboards and analysts read from the warehouse, never from Salesforce directly.

"Ingestion" is the middle arrow on the left: getting data out of Salesforce and into Redshift. This ticket is about what happens to data during that step.

Background

Two roads into the warehouse

Road 1

Zero-ETL

  • AWS copies Salesforce objects into Redshift automatically.
  • One integration, active since 30 Sep 2026.
  • 27 objects, including IndividualApplication.
  • We write no code for the copy.
Road 2

ETL (our own job)

  • A Glue job, ies-data-salesforce-extraction, pulls changed records on a schedule.
  • It writes files to S3 storage; Redshift reads those files.
  • Used for IndividualApplicationHistory, which is not in the zero-ETL list.

ETL means Extract, Transform, Load: code we own that moves data. Zero-ETL means AWS does the move for us.

Background

Where the two roads meet

14
materialized views in
salesforce_reporting

A materialized view is a saved query whose result is stored, so reports read it quickly.

  • 13 read the zero-ETL copy and refresh automatically.
  • 1 (mv_individual_application_history) reads the files from the ETL job.

This is the shelf that reports take data from. So any rule that changes or hides data has to take effect here, whichever road the data came in on.

The ask, unpacked

Three kinds of rule

Transform

Adjust it

Change a value before reports see it.

Illustration: store a country as its full name instead of a code.

Check

Report it

Keep the record, but flag it when a condition is not true.

Illustration: an application with no program attached.

Skip

Leave it out

Do not show the record to reports at all.

Illustration: test records created by staff.

The illustrations are made up to show the idea. The real rules come from Carrie.

The problem

What is wrong today

Most views do nothing but rename

mv_individual_application only renames columns, for example "InternalStatus" becomes internal_status. No rules at all.

One rule already exists, hidden in SQL

WHERE old_value IS NOT NULL
  AND old_value != ''

In mv_individual_application_history, on the legacy history rows. They are dropped silently.

  • No list of which rules exist, who asked for them, or why.
  • No report of what was flagged or left out.
  • Each new rule means hand-editing a view.
The key constraint

Zero-ETL data cannot be touched on the way in

Salesforce
→
Read-only

Zero-ETL copy

AWS documentation: the destination database is read-only. No tables or views can be created in it.
→
Rules go here

After landing

A different database reads the copy and applies the rules.
  • We found no way to filter rows or change values before the data lands.
  • With our own ETL job we could apply rules earlier — but then rules would live in two places.
  • So: one place for rules, after landing, for both roads.
The bigger decision

Build the foundation once

Make the data on S3 the product, and every tool a replaceable reader.

Today

The data lives inside Redshift

Change the tool, and the data layer has to be rebuilt with it.
→
Proposed

The data lives in open tables on S3

Redshift is one reader among several. So is whatever comes next.
  • Open table format: Apache Iceberg. One catalog: the AWS Glue Data Catalog.
  • Redshift keeps its job — serving reports fast — but holds nothing that cannot be rebuilt.
The proposal

Four layers, one direction

1

Landing

Every source, every change, exactly as it arrived. Never edited.
→
2

Curated

Clean tables: one current, one history per subject. Rules are applied here.
→
3

Products

Reporting tables, machine learning features, predictions.
→
4

Serving

Redshift, Athena, SageMaker, Quick Sight. Replaceable.

Beside Curated sit two more tables: rule results and quarantine. Both roads from Salesforce — and later Workday and other systems — write into the same Landing layer.

The proposal

Rules run once, in the lake

1

Rule registry

One file listing every rule. Reviewed like code.
→
2

Runner

A Glue job — the tool the team already uses every day.
→
3

Three outputs

  • The curated tables, with rules applied
  • A results table: each rule, each run, how many failed
  • A quarantine table: every skipped record and which rule skipped it

Rules are plain conditions in a list, so the runner can be swapped later without rewriting them. Carrie's reports read the results and quarantine tables from any tool.

The proposal

What adding a rule would look like

- id: sf_ia_incomplete_001
  owner: Carrie Rackers Cunningham
  ticket: WIN-3370
  source_object: IndividualApplication
  type: check        # transform | check | skip
  condition: "<to be given by Carrie>"
  severity: warn
  active: true

The steps

  1. Add one entry like this.
  2. A teammate reviews it.
  3. The runner picks it up on its next run.

No new job. No view edited by hand.

This format is a proposal. It has not been built yet.

Why now

The machine learning use cases need this shape

Candidate use caseWhat it needs from the data
Enrollment and withdrawal prediction (the lead)Every change, with its date. A model may only use what was known when the student applied.
Forecasting, ledger anomaliesFinance and Workday data in the same landing zone, not only Salesforce.
Duplicate person matchingOne agreed person record across systems.
A fact from the AWS documentation: SageMaker Canvas connects to provisioned Redshift, not Redshift Serverless — and production runs Serverless. It reads the lake through Athena instead.
Starting point

We are not starting from zero

A layered lake already exists

Bronze, silver and gold databases with 4, 13 and 136 tables. Older file format; latest updates mid-2026. Owner not yet identified.

A landing table already exists

The scheduled extract job appends application history to S3 every run.

The 14 Redshift views

Become the generated serving layer.

The zero-ETL integration

Its target cannot be changed. A new one that writes to S3 replaces it.
The proof of concept

Proving it with one thin slice

One subject only: the individual application and its history. The ticket's test case is applications "with ap incomplete"; the exact condition is not written down yet.

  1. Meet Carrie and write down the exact condition, and whether it is a check or a skip.
  2. Land the application data as open tables in the lake.
  3. Add her rule as one entry in the registry and run it.
  4. Read the result from two tools — Redshift and Athena — and compare.
  5. Carrie validates the list of failing applications against Salesforce.

The 13 live views are not touched during the proof of concept.

Nuance

Things that are easy to get wrong

TopicWhy it matters
Check or skip?A skip removes data from reports. Each rule must say which one it is.
Related recordsIf an application is skipped, what about its timeline and participant records?
Coming backWhen a skipped record is later fixed, should it reappear by itself?
RefreshAWS pages disagree on automatic refresh over these tables. Plan for scheduled refresh.
Zero-ETL to S3How updates and deletes are applied is not documented. Test on one object first.
Lowercase namesRedshift views over open tables need lowercase names. Curated uses them throughout.
PermissionsToday's permission model for the lake could not be read. It must be decided once.
The trade-off

What the foundation buys, and what it costs

Pros
  • Tools can change without rebuilding the data.
  • One landing zone for both roads and every source.
  • History is kept, which machine learning needs.
  • Rules and reports work from any tool.
Cons
  • More to build than rules inside Redshift alone.
  • A new integration; all 27 objects reload.
  • 13 views to re-point, one at a time.
  • Unverified behaviour until the thin slice tests it.
  • More to operate: table upkeep and permissions.

Why accept the cost: the thin slice is the same size as the original proof of concept, and it tests the foundation and the rules together.

Next

What is needed to move

Decisions
  1. Accept the thin slice as this ticket's deliverable?
  2. Reuse the existing lake's bucket and names, or start new?
  3. Which permission model?
  4. Build in production scratch space, or the dev account?
  5. Rules runner: Glue job, or dbt?
  6. Carrie's rule, and acceptance criteria.
Phases
  1. Decisions.
  2. Thin slice — this ticket.
  3. Move zero-ETL to land in S3.
  4. First machine learning feature table.
  5. Other sources into the landing zone.

Full detail and evidence: docs/WIN-3370_lakehouse_foundation_design.md

Narration uses your browser's built-in voice. Keys: space = play or pause, arrows = move between scenes.