1. System Overview & Problem Statement
Modern enterprise Data Analysis has evolved beyond static Jupyter notebooks and manual ad-hoc scripts. Modern organizations require production-grade analytics engines capable of ingesting high-velocity heterogeneous data streams, performing complex statistical operations, and serving low-latency interactive visual summaries ("sketches") directly to business stakeholders.
The DuckDB Columnar Data Sketch platform was built during an intensive 60-day DBERT incubation sprint to address the fragmentations commonly observed in data analysis workflows: memory bottlenecks during exploratory data analysis (EDA), state desynchronization between analytical runtimes and visual interfaces, and fragile JSON metadata parsing in automated analytics pipelines.
By bridging modern data engineering patterns (vectorized in-memory computation, columnar query execution, and robust schema validation) with data analysis workflows, the platform provides automated exploratory data summaries, real-time outlier detection, and responsive visual telemetry.
Verified Submission Details - Production Source Code: https://github.com/aadityakadam432-sketch - DBERT Verified Credential: https://dbert.in/verify/CERT-DBERT-2026-DA-024 - Pre-Screening Rubric Score: 75/100 (High Merit)
2. Architectural Blueprint & Technical Stack Decisions
The system utilizes an event-driven, micro-service-inspired analytics architecture designed to process incoming unstructured and semi-structured datasets, transform them via vectorized execution engines, and persist aggregated metadata for downstream dashboard rendering.
+-----------------------------------------------------------------------------------+
| CLIENT LAYER |
| Interactive Data Dashboard & Web GUI |
+-----------------------------------------------------------------------------------+
|
(HTTPS / JSON)
v
+-----------------------------------------------------------------------------------+
| API GATEWAY LAYER |
| Nginx Reverse Proxy + FastAPI Authentication |
+-----------------------------------------------------------------------------------+
|
+----------------------+----------------------+
| |
v v
+------------------------------------+ +-------------------------------------+
| CORE DOMAIN ENGINE | | ASYNC BACKGROUND SERVICE |
| - Dynamic Schema Validator | | - Celery Worker (Batch Compute) |
| - DuckDB Analytical Query Engine | | - Outlier & Anomaly Detection Job |
| - Statistical Summary Generator | | - Automated PDF/JSON Reporter |
+------------------------------------+ +-------------------------------------+
| |
+----------------------+----------------------+
|
v
+-----------------------------------------------------------------------------------+
| DATA & CACHE LAYER |
| - Redis 7.0 (Analytical Result Query Cache & Session Store) |
| - PostgreSQL 16 (Structured Metadata & Pipeline Telemetry) |
| - Amazon S3 / MinIO Object Storage (Parquet Data Lake Storage) |
+-----------------------------------------------------------------------------------+Key Technical Stack Components - API & Application Tier: Python 3.11, FastAPI, Pydantic v2 (Strict Type Enforcement). - Analytical Engine: DuckDB (Embedded OLAP Engine), Pandas, NumPy, SciPy. - Asynchronous Task Architecture: Redis 7.0, Celery (Distributed Data Pipelines). - Persistence & Storage: PostgreSQL 16 (Metadata Store), Apache Parquet (Columnar Lake Storage). - Deployment Stack: Docker, Docker Compose, Nginx, Linux (Ubuntu 22.04 LTS).
3. Core Implementation & Engineering Highlights
Highlight 1: Vectorized Analytical Query Pipeline with DuckDB & Pydantic
To eliminate standard Pandas memory overhead when ingesting raw CSV/JSON dumps, the platform executes columnar queries directly against Parquet backing files using DuckDB, converting output straight into validated Pydantic schemas.
from typing import List, Optional, Dict, Any
from pydantic import BaseModel, Field, ConfigDict
import duckdbclass DatasetSummarySchema(BaseModel): model_config = ConfigDict(arbitrary_types_allowed=True)
total_records: int = Field(..., ge=0, description="Total processed row count") null_percentages: Dict[str, float] = Field(..., description="Null count per column ratio") numerical_metrics: Dict[str, Dict[str, float]] = Field(..., description="Mean, StdDev, IQR per feature") skewness_scores: Dict[str, float] = Field(..., description="Fisher-Pearson coefficient of skewness")
class AnalyticalEngine: def __init__(self, database_path: str = ":memory:"): self.con = duckdb.connect(database_path)
def generate_columnar_sketch(self, parquet_filepath: str) -> DatasetSummarySchema: """ Executes low-latency SQL aggregation directly on disk-backed Parquet files, preventing RAM spikes on multi-gigabyte analytical inputs. """ # Execute duckdb aggregate query summary_query = f""" SELECT COUNT(*) as total_records, AVG(val_col) as mean_val, STDDEV(val_col) as std_val, PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY val_col) as median_val FROM read_parquet('{parquet_filepath}') """ result = self.con.execute(summary_query).fetchone()
if not result or result[0] == 0: raise ValueError(f"Target dataset at {parquet_filepath} contains zero readable records.")
return DatasetSummarySchema( total_records=result[0], null_percentages={"val_col": 0.0}, numerical_metrics={ "val_col": { "mean": float(result[1] or 0.0), "std": float(result[2] or 0.0), "median": float(result[3] or 0.0), } }, skewness_scores={}, ) ```
4. Production Deployment & Key Learnings
- Columnar Query Efficiency: Running aggregate sketches directly over Parquet via DuckDB avoids loading raw multi-gigabyte tables into Python process memory.
- Strict Type Contracts: Returning DuckDB query summaries through validated Pydantic v2 schemas prevents schema drift between backend analytics and frontend dashboards.
Interested in building production AI & Full Stack systems with 1:1 mentorship and verified credentials? Explore the [DBERT AI Fellowship](https://lms.dbert.in).