Skip to content

Latest commit

 

History

9 Commits

Folders and files

Repository files navigation

High-Performance Data Engineering: Integrating Python and Rust

Live course site: betoalien.com/High-Performance-Data-Engineering

This repository contains a comprehensive course on building hybrid data engineering systems that combine Python's flexibility with Rust's speed and memory safety.

Course Structure

dataengineering_rust_python/
├── index.md                 # Course overview
├── _config.yml              # GitHub Pages configuration
├── chapters/
│   ├── 01-introduction.md   # Ch 1 - The Case for Rust in Data Engineering
│   ├── 02-rust-core.md      # Ch 2 - Columnar Storage from Scratch in Rust
│   ├── 03-python-sdk.md     # Ch 3 - Bridging Rust and Python with ctypes
│   ├── 04-apache-arrow.md   # Ch 4 - Apache Arrow: Zero-Copy Interoperability
│   ├── 05-parallelism.md    # Ch 5 - Parallelism Without the GIL
│   ├── 06-async-io.md       # Ch 6 - Async I/O with Tokio
│   ├── 07-etl-pipeline.md   # Ch 7 - Building the ETL Pipeline
│   └── 10-jupyter-lab.md    # Ch 10 - Interactive Data Engineering (JupyterLab)
├── hyperframe_sdk/          # Python package students install
│   ├── setup.py
│   └── hyperframe/
│       ├── __init__.py
│       ├── wrapper.py       # ctypes FFI bindings
│       ├── frame.py         # DataFrame class
│       ├── series.py        # Series class
│       └── io.py            # read_csv, read_ndjson
├── examples/
│   ├── etl_pipeline.py      # Complete ETL example
│   └── benchmark.py         # Performance benchmarks
└── notebooks/
    ├── 01-getting-started.ipynb   # Interactive introduction
    ├── 02-etl-pipeline.ipynb      # Self-contained ETL demo (generates its own data)
    └── 02-etl-workflow.ipynb      # End-to-end workflow (requires a real CSV file)

Quick Start

Viewing the Course

The course is formatted for GitHub Pages with the "Just the Docs" theme. To view locally:

# Install Jekyll and the theme
gem install bundler
bundle install

# Start local server
bundle exec jekyll serve

Then open http://localhost:4000/dataengineering_rust_python/

Running the Examples

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/macOS

# Install dependencies (you'll need the hyperframe SDK)
pip install -e ../hyperframe_sdk/
pip install jupyterlab matplotlib pandas

# Run the ETL pipeline
python examples/etl_pipeline.py --input your_data.csv --output output.parquet

# Run benchmarks
python examples/benchmark.py --rows 100000

# Start Jupyter
jupyter lab notebooks/

What You'll Learn

  1. Why Rust + Python: Understanding the performance characteristics and use cases
  2. Rust Core Development: Building columnar data structures, compute kernels, and FFI exports
  3. Python SDK Design: Creating Pythonic wrappers with ctypes, memory management, error handling
  4. Apache Arrow: Zero-copy data interchange between Rust, Python, Pandas, and DuckDB
  5. Parallelism: Rayon work-stealing parallel compute that bypasses the GIL
  6. Async I/O: Concurrent file ingestion with Tokio
  7. ETL Pipelines: Building production-ready data pipelines with the hybrid engine
  8. Interactive Analysis: Using Jupyter notebooks for exploratory data analysis

Prerequisites

  • Intermediate Python programming
  • Basic understanding of data engineering concepts
  • Familiarity with command line and package management

Performance Highlights

The hybrid Rust+Python approach demonstrated in this course achieves:

Operation Speedup vs Pandas
CSV Load 5-7x faster
Filtering 8-10x faster
GroupBy Aggregation 5-8x faster
Hash Joins 7-10x faster
Memory Usage 60-65% reduction

Author

Alberto Cardenas — data engineer and systems architect.

License

This course material is provided for educational purposes.

Contributing

Contributions welcome! Please open an issue or submit a PR for:

  • Corrections or clarifications
  • Additional examples
  • Performance improvements
  • New chapters or topics

Releases

Packages

Contributors

Languages