Back to homeArchitecture

The technical build

Trusted grocery data becomes business action.

Trusted grocery data in the lakehouse becomes business metrics, AI-assisted insights, and faster inventory actions.

3
Medallion layers
8
Gold objects
1
Daily 6 AM workflow
<1s
Cached page load
Medallion architecture

Bronze → Silver → Gold

One Unity Catalog schema: workspace.grocery_data_intelligence.*. The app only ever reads Gold.

Bronze

Raw, append-only

bronze_sales_raw

5,150 rows · +150/day

Silver

Cleaned + validated masters

silver_stores (10) · silver_products (15)

silver_sales (5,150) · silver_inventory (150)

Gold

Business metrics the app reads

gold_inventory_risk_daily · 150 rows/day

+ 7 business-logic views (KPI, risk, story, actions)

Gold objects powering every screen

gold_inventory_risk_daily

150 rows/day

Per-store, per-product daily risk + recommended action.

vw_dashboard_kpi_summary

Chain-wide KPI tiles on the Dashboard.

vw_top_stockout_risk_products

Lowest days of supply, ranked.

vw_top_waste_risk_products

Closest to expiry, ranked.

vw_store_risk_summary

Per-store attention score.

vw_category_risk_summary

Stockout vs waste, by category.

vw_today_inventory_story

Daily narrative for the Story page.

gold_product_action_recommendations

Per-product recommended action for the Actions page.

End-to-end flow

From raw store data to confirmed action

Step 01

Raw Grocery Data

Stores · Products · Sales · Inventory

Step 02

Databricks Lakehouse

Bronze · Silver · Gold layers

Step 03

Semantic Layer / UC Metric Views-ready

Days of supply, stockout risk, waste risk, priority, recommended actions

Step 04

Genie-style Ask Data experience

Natural language over trusted business data

Step 05

LLM / FM API reasoning layer

Interprets the question, generates business-friendly answers

Step 06

Action Center

Reorder · Promotion · Discount · Donation · Monitoring

Step 07

Lakebase-ready OLTP layer

Reorder plans, action status, decisions, feedback history

Step 08

Business outcomes

Fewer stockouts, less waste, better planning, faster action

Risk model

Deterministic rules, not a black box

Every recommendation in the app comes from these rules in the Gold view — auditable and identical across Dashboard, Actions, and Story pages.

Stockout risk

  • High< 2 days of stock remaining
  • Medium2 – 5 days remaining
  • Low> 5 days remaining

Waste risk (perishables)

  • High≤ 1 day until expiry
  • Medium2 – 3 days until expiry
  • Low> 3 days until expiry
  • N/Anon-perishable items

Recommended actions

Reorder Nowstockout imminent

Discount or Donateexpiry within 1 day

Promote Soonexpiry within 2 – 3 days

Monitor Closelymedium stockout risk

No Action Neededoptimal inventory

Daily workflow

One 6 AM job refreshes everything

Daily at 06:00 America/Chicago on a Serverless Starter Warehouse (PRO 2X-Small · Photon · 10-min auto-stop).

Bronze append (+150) → Silver clean & validate → Gold risk + actions → Summary

Data growth

90-day projection

Day      Bronze     Silver Sales    Gold Risk
─────    ──────     ────────────    ──────────
Day 1     5,150          5,150            150
Day 30    9,650          9,650          4,500
Day 60   14,150         14,150          9,000
Day 90   18,650         18,650         13,500
Databricks stack

What's live today, what's next

Current Next

Databricks Free Edition

Current

Build and demo without enterprise setup cost.

Lakehouse Architecture

Current

Foundation that moves grocery data from raw to clean to business-ready.

Bronze Layer

Current

Raw stores, products, sales, and inventory data.

Silver Layer

Current

Cleans, standardizes, and joins raw data so it's reliable for analysis.

Gold Layer

Current

Business metrics: days of supply, stockout risk, waste risk, priority, recommended action.

Databricks SQL / SQL Warehouse

Current

Powers the app, dashboard, Ask Data + AI, and approved views.

Gold Views

Current

Surfaces trusted data to the app instead of raw tables.

Unity Catalog

Current

Catalog / schema / table / view governance for trusted data assets.

Semantic Layer (concept)

Current

Consistent business definitions across dashboard, Ask Data, and actions.

AI/BI Genie-style experience

Current

Plain-English questions answered from trusted data — live for some intents today, powered by a Databricks-hosted Foundation Model.

UC Metric Views

Next

Native Databricks semantic layer for reusable metrics like days of supply and reorder priority.

Materialized / Serving Tables

Next

Faster dashboard and AI queries as data grows.

Lakebase

Next

Store action state — reorder plans, task status, user decisions, feedback history.

Databricks Apps

Next

Host the app closer to Databricks data and security.