Electoral Donation Data Insights
Integrated Data Systems for Electoral Donation Data in US States
A dual-architecture data engineering project that ingests, cleans, and analyzes 56 CSV files of Federal Election Commission contribution data spanning California, Florida, New York, and Pennsylvania. Two complete pipelines were built side-by-side: a PostgreSQL relational star-schema warehouse with KNIME ETL workflows, and a Hadoop HDFS implementation using Apache Pig, PySpark, and HiveSQL. Six business questions covering $721M in donation flows, party distributions, city-level breakdowns, top donor occupations, and monthly transaction trends were answered through both systems and compared.
Election Contribution Data at Scale
Relational Star Schema: 7-Table Design
| Table | Type | Primary Key | Key Attributes | Role |
|---|---|---|---|---|
| transaction_main | Fact | train_id + composite UNIQUE | cmte_id, tran_date_id, address_id, personal_info_id, tran_amt, state | Central join point; all foreign keys + the donation amount |
| party_info | Dimension | cmte_id | party_nm, cmte_nm, cmte_tp, cmte_dsgn, cmte_filing_freq | Committee type and party designation (Democrat / Republican / Other) |
| person_info | Dimension | personal_info_id | name, employer, occupation | Donor identity: who gave, what they do, who they work for |
| address_informations | Dimension | address_id | city, state, zip_code | Donor location enabling city and state-level geographic aggregation |
| transaction_dates | Dimension | tran_date_id | tran_date, cvg_end_dt, dd, mm, yyyy | Normalized date dimension enabling monthly/quarterly time series analysis |
| transaction_information | Dimension | tran_id | tran_type (cash/check), memo_code, memo_text | Transaction method and memo records (proof of donation) |
KNIME ETL Workflows and Hadoop Pipeline
| Dimension | PostgreSQL Data Warehouse | Hadoop (HDFS + Hive) |
|---|---|---|
| Storage model | Structured star schema, ~2 GB per table, single node | Distributed file system across compute cluster nodes |
| ETL tool | KNIME (visual node workflows) | PySpark + Apache Pig (code-based), then KNIME for reporting |
| Batch performance | Slow on large batches; significant delays on 56-file ingestion | Fast: mappers/reducers parallelize across nodes |
| Schema flexibility | Rigid star schema, predefined types and relations | Schema-on-read, flexible column definitions |
| Data quality tooling | KNIME detects type mismatches, missing values visually | Manual null-checks in PySpark code |
| Reporting | KNIME reporting service, rich chart types | KNIME via Hive Connector (same result quality) |
| Re-ingestion cost | Incremental via Reference Row Filter | Must clean and normalize data from scratch per batch |
| Best use case | Structured BI queries, role-based access, audit trail | Large-scale distributed analytics, growing data volumes |
Six Business Question Analysis Results
| State | Top City (share) | 2nd City | 3rd City | Distribution pattern |
|---|---|---|---|---|
| CA | San Francisco (21.75%) | Los Angeles (18.74%) | San Jose (9.27%) | Distributed: 30+ cities each contributing; top 2 hold 40% |
| NY | New York City (74.31%) | Albany (3.09%) | Brooklyn (varies) | Highly concentrated: NYC holds nearly 3 in 4 NY donation dollars |
| FL | Tampa (18.88%) | Miami (10.73%) | West Palm Beach (10.6%) | Balanced: 3 cities combined hold 40%; rest widely spread |
| PA | Philadelphia (39.09%) | Newtown Square (15.55%) | Pittsburgh (varies) | Moderate concentration: Philadelphia holds 2 in 5 PA dollars |
FL stands out: it is the only state where Democrats do NOT hold a majority of donation dollars. Republican and Other-affiliated committees together account for 61.45% of FL contributions, reflecting its competitive swing-state political landscape. CA, NY, and PA all show strong Democratic donation majorities (62-67%), consistent with their registration patterns.
Transaction volumes in 2023 show a strong pre-election surge from July onward, peaking in December at 470,086 total transactions. CA drives most of this surge, jumping from 125K in January to over 220K per month from August through December. The 2024 Q1 data shows a March peak (256,753) followed by a significant April drop (84,882), consistent with post-primary reporting deadlines.