1 of 34

Below the tip of the Iceberg

How Wikimedia reduced reporting latency 10x using dbt and Iceberg

2 of 34

Agenda

  • Intros
  • Context + Motivation
  • Solution Overview: Building an Open-Source Data Lake
  • Tooling Deep Dive
  • Outcomes & Impact
  • Learnings & Takeaways

3 of 34

Meet the speakers

Joseph Mando

Lead Analytics Engineer

Wikimedia Foundation

Avishua Stein

Senior SRE - Data Engineering

Wikimedia Foundation

Speaker Three

Job Title

Company

3

4 of 34

Context + Motivation

5 of 34

The Wikimedia Foundation

  • Nonprofit organization hosting Wikipedia and other free knowledge projects

  • Mission to make knowledge sharing easy and accessible

  • Funding is powered by small donations from supporters worldwide

6 of 34

How does analytics help?

  • Data-driven fundraising through building dashboards and data models for effective fundraising

  • Key insights like A/B testing results and campaign health metrics

  • Empowers fundraising teams to secure funds for the Wikimedia Foundation and its work

7 of 34

all_donations

  • In order to support data-driven fundraising, analytics:
    • Provides comprehensive revenue reporting
    • All_donations was built to accomplish this
      • Consolidates 6 years of clean and attributed donation data
      • Single source of truth

8 of 34

Building all_donations

  • Patched together automation with python scripts scheduled via cron jobs
  • 5-hour full refresh
  • Three separate scripts for different refresh frequencies
  • Identical queries across scripts
    • All have to be updated and tested for even a single change

9 of 34

All_donations Limitations

  • Adding and backfilling a new columns required up to one week lead time plus development

  • Limited to 6 years of data due to performance constraints
    • Missing long-term patterns and insights

  • Slow to query

10 of 34

The rest of the models

  • Downstream models had the same constraints
    • Every model change required updates across multiple scripts
    • Long lead times to fully populate new columns
  • No built in way to see and test model dependencies

11 of 34

The need for change

  • 3+ minute query times created poor user experience in our BI tools
    • Aggregated models provided speed but increased tech debt
  • Growing demand for deeper insights drive more model complexity
  • We simply had outgrown mysql/mariadb and our model development process

12 of 34

The Need For Change

Question

  • How has revenue from banners grown year over year?

Self Serve

  • Navigate to dashboard and wait for it to load
  • Add filters and wait for more loading

Refine

  • See data
  • Realize it is limited
  • Cannot drill down
  • Need to filter further
  • More waiting

Request

  • Request adhoc data from analytics

13 of 34

Solution Overview: Building an Open-Source Data Lakehouse

14 of 34

Moving to a new stack

Why On-Prem & Open Source?

  • Stronger data security
  • Private deployments reduce attack surface
  • Full software control (no reliance on SaaS vendors)

Wikimedia-Specific Benefits

  • Aligns with existing on-prem FR Tech systems
  • Supports culture of in-house infrastructure & development

Other Advantages

  • Cost-effective hardware
  • No vendor lock-in or forced updates

15 of 34

Our new analytics stack

16 of 34

Data lakehouses

  • Storage and compute separated for flexibility
  • Modern table formats (e.g. Iceberg) enable interoperability
  • Benefits:
    1. Lower cost + flexible compute choices
    2. Near data warehouse query performance
    3. ACID transactions → improved data quality
    4. Handles structured, semi-structured, and unstructured data
    5. Supports schema & partition evolution

17 of 34

Data architectures

18 of 34

Tooling deep dive

19 of 34

Components: Trino

  • Query engines transform data (compute)

  • Benefits of Trino:
    • Performant
    • Large community
    • Federated
    • Integrations
      1. dbt
      2. MinIO/ Iceberg
      3. Metabase

20 of 34

Components: Iceberg & Modern table formats

Data lakehouses rely on modern table formats for ACID guarantees and increased performance

Table formats like Iceberg bring new capabilities to data lakes:

  • Better metadata to improve query performance
  • ACID compliance
  • Schema evolution, smarter partitioning, time travel

21 of 34

Components: dbt

  • Y’all know why dbt is great:
    • Version control
    • Run queries in parallel
    • Great community
    • Works with our tools
      • Trino
      • MinIO/ Iceberg
      • Dagster
      • Metabase

22 of 34

Outcomes & Impact

23 of 34

Improved Performance

  • 5+ hours for all_donations to about 1.5 hours to build all models
    • Lead time of data backfills no longer one week
  • 6 years of revenue data in 8+ minutes to 18 years in 8 seconds
    • BI tool timeouts to (closer to) instant data access
    • More time for insights, less time waiting for data

24 of 34

The change

Question

  • How has revenue for banners grown year over year?

Self Serve

  • Navigate to dashboard
  • Add filters
  • See data
  • Initial question answered

Refine

  • Filter further
  • Drill Down

Request

  • Request more complex analysis from analytics

25 of 34

End-user feedback

OMG this is amazing!

I’ve answered so many questions for myself I have been wondering for years, in five minutes!

26 of 34

donations model in dbt

  • SQL largely unchanged
  • Replaced custom Python scripts with SQL files ran through dbt commands
  • Macros and seeds eliminate some repetition

27 of 34

Macros in dbt

  • Rather than repeating this case statement we can now just call this macro
    • Results in less and cleaner SQL

28 of 34

Building the donations table in dbt

  • dbt's incremental functionality replaces multi-script architecture
  • Same SQL file handles both incremental and full builds
  • Automation with Dagster replaces manual cron job management
  • Macros and Jinja enable environment and incremental-specific builds

29 of 34

Other models in dbt

  • Downstream and upstream models also use incremental functionality
  • Less files to create and maintain
  • Lineage graphs show dependencies

30 of 34

Other advantages of dbt

  • Built-in documentation and testing
  • Column descriptions visible in BI tools
  • Seed files replace complex case statements

31 of 34

Learnings & Takeaways

32 of 34

Learnings & takeaways

  • Set up logging and alerting early
  • Open source often does not include a manual
  • Experiment with configs!
  • Reducing threads in dbt improved performance and caused fewer failures!
  • Consider TCO!
  • Any columnar database will likely perform analytics better than row-based

33 of 34

Check out Wikimedia

Donate

Join Us

33

34 of 34

Thank you

Please be sure to take the post-session survey

34