← All projects
CASE 05

SmartGrid Lakehouse — analytics on regulated data that never leaves

A Databricks lakehouse for smart-meter telemetry, where identifiers are tokenized at the edge and a gate blocks any upload that leaks.

Working pipeline · in progress
The problem

Utilities and other regulated companies want cloud analytics, but personal data and critical-infrastructure identifiers may not leave the organisation. Masking inside the cloud is too late: by then the real values are already there.

What I built

Every identifier (meter, customer, site, SCADA IP) becomes a deterministic HMAC token before upload, so joins still work across tables and platforms. Names, IDs and IBANs are dropped and GPS is generalised. A Leak Gate checks every outgoing cell against the real sensitive values and blocks the upload on a single match. All systems are reached through an OOP connector layer with least privilege built into the types.

Architecture
ON-PREM
Raw CSVmeters · sites · batteries · prices
→
Edge maskerHMAC tokens, drop PII, GPS 0.1°
→
Leak Gatereal values vs every outgoing cell
DATABRICKS · UNITY CATALOG
UC Volumelanding zone, least privilege
→
BronzeDelta, _ingested_at · _source_file
→
Silverbroadcast joins, partition by date
→
Goldhourly MERGE, next step

Connectors: Source (read-only, allow-list) · Sink (one Volume only) · Workspace (OAuth session) · NotebookRunner (serverless) · MaskingPolicy (one policy.yaml feeds the masker, the gate and UC column tags).

Outcome
364 / 379,022real sensitive values checked against every outgoing cell
PASS → BLOCKpassed clean data; blocked one real name injected on purpose
0 secrets in codeOAuth profile to Databricks, no personal access token
Stack
DatabricksDelta LakeUnity CatalogServerlessPython (OOP)Databricks SDKHMAC-SHA256policy.yaml
Honest status

The Leak Gate and the Databricks connection are tested. The full cloud deploy is written but not yet run, the Gold layer is next, and I know the token length needs to grow from 32 to 64 bits.