The problem
Sales and project data lived in Excel files, and leadership reports were put together by hand. Managers and agents needed dashboards limited to their own projects, inside the CRM, on a small budget and without BI licence fees.
Follow the data
Scroll the diagram sideways to see all of it.
Excel files land as Parquet
A Pandas step converts the sales and project spreadsheets into Parquet, and a generated column mapping keeps inconsistent headers aligned.
Spark curates, Great Expectations checks
The silver layer is built with Spark and validated before publishing. A failed check alerts the team in Slack and nothing reaches a dashboard.
Iceberg tables publish to S3
Validated data is written as partitioned Apache Iceberg tables, registered in the Glue Data Catalog and defined in Terraform.
Athena queries and smoke-tests
Athena reads the Iceberg tables directly. After every run, smoke tests count recent rows and compare the schema with the one recorded at publish time.
Superset applies row-level security
Each agent and manager sees only their own projects, with deck.gl maps of the emirates and Dubai's districts. Dashboards live in Git as YAML and deploy through GitHub Actions.
The CRM embeds the dashboards
Short-lived guest tokens and a role that can only view dashboards, with SQL Lab switched off. Only the CRM's own site may frame them.
How I built it
Foundation: from Excel to validated Parquet
- A Pandas ingest step converts raw Excel files into Parquet (the bronze layer), and a generated column mapping keeps inconsistent spreadsheet headers aligned.
- A Spark curation step builds the silver layer, and Great Expectations checks run before anything is published. A failed check alerts the team in Slack.
Version 1.0: one governed source and secure dashboards
- Iceberg tables on S3. Curated data is published as partitioned Apache Iceberg tables, registered in the AWS Glue Data Catalog, defined in Terraform and queried with Athena.
- Smoke tests after every run. Athena counts rows in the newest partitions and compares the schema with the one recorded at publish time, alerting if a partition is empty or the schema has drifted.
- Dashboards that respect access. Apache Superset 5.0 dashboards use row-level security, so each agent and manager sees only their own projects, with deck.gl GeoJSON maps of the UAE's emirates.
- One command for the whole pipeline. A make target runs ingest, Iceberg publishing, the catalog update and the dashboard export in order.
- Staging, user acceptance with the business, then the dashboards embedded in the CRM.
Version 1.1: production hardening
- Dashboards stored as YAML and deployed through GitHub Actions: the pipeline builds the Superset image, imports dashboards to staging, waits for smoke tests and then promotes to production.
- A white-label theme, Redis caching and Celery workers, and automated user onboarding through Superset's REST API with a nightly reconciliation job.
- deck.gl polygon and scatter maps for Dubai's districts, simplified with Mapshaper so they stay fast.
- Scheduled Iceberg maintenance and daily email alerts.
- An n8n agent that queries the Iceberg tables through Athena, so the WhatsApp assistant could answer from the same governed data.
Key decisions
- Check data before anything is published. Validation sits between curation and publishing, so a bad file stops at the gate instead of reaching a dashboard.
- Apache Iceberg instead of Delta Lake. The first design used Delta Lake. I moved to Iceberg because Athena queries it natively, other engines can read and write the same tables, and AWS can take over table maintenance later. The switch ran as a one-time copy with a 24 to 48 hour parallel run before queries were pointed at the new tables.
- Glue's catalog first, managed S3 Tables later. Glue had the simplest permissions and tooling on day one, so I started there, kept table definitions compatible with S3 Tables, and planned a review after load testing.
- Superset instead of Metabase. Superset's open-source edition gave row-level security, embedding with short-lived guest tokens, map charts and dashboard export as YAML, with no licence cost.
- Least privilege for embedded dashboards. The embedded role can only read datasets and view dashboards, SQL Lab is switched off for it, and only the CRM's own site may frame the dashboards. Staff sign in through AWS IAM Identity Center.
- Test security, not just data. An integration test logs in as a sample agent and checks that only that agent's rows come back.
Operations and cost
- Superset runs in containers on AWS with PostgreSQL on Amazon RDS for its metadata and Redis for caching and background work.
- Iceberg maintenance rewrites manifests daily, compacts files weekly and expires snapshots older than 14 days.
- Athena workgroups enforce encryption, reuse query results and cap the bytes scanned per query. CloudWatch alarms watch scanned bytes, queue time and failure rates.
- The Superset image is pinned to a 5.0.x release and upgraded only after staging tests.
- Sized to run on about USD 80 a month of AWS, with no BI licence fees.
Results
- One validated source for sales and project data, with Great Expectations keeping data loss under 1% on ingests of about 260,000 rows.
- Superset 5.0 dashboards with row-level security, deck.gl and Mapbox maps and CRM embedding, versioned as YAML in GitHub Actions.
- About 85% less manual reporting, with weekly sales and lead-conversion reports for leadership.
- CRM lead packs and campaign trackers automated, cutting their preparation from over three hours to under ten minutes.
- Delivered with Agile and PRINCE2, with data governance kept to ISO practice and the UAE Personal Data Protection Law (PDPL).
What I would do differently
- Choose the table format for the query engine first. Starting on Delta Lake and moving to Iceberg cost a migration; picking the format that Athena reads natively from the start would have saved it.
- Write the row-level security test before the first dashboard. Access rules are easy to get subtly wrong, and a test that logs in as a real role catches it immediately.
- Treat dashboards as code from day one. YAML exports in Git made every change reviewable; adding them earlier would have avoided some manual promotion.
Stack
- Python
- Pandas
- PySpark
- Great Expectations
- Apache Iceberg
- Amazon S3
- AWS Glue
- Amazon Athena
- Apache Superset 5.0
- deck.gl
- Mapbox
- Redis
- Celery
- Terraform
- GitHub Actions
- n8n