# Graph computation framework for SPARK

- Speaker: [Elior Malul](/wiki/speakers/elior-malul.md)
- Event: [Reversim Summit 2017](/wiki/years/2017.md)
- Video: https://www.youtube.com/watch?v=ariZeH1QUZA
- Transcript: [/transcripts/2017/39-ariZeH1QUZA.md](/transcripts/2017/39-ariZeH1QUZA.md)
- Language: Hebrew · Type: talk · Level: intermediate
- Topics: [Data Engineering](/wiki/topics/data-engineering.md), [Software Engineering](/wiki/topics/software-engineering.md), [Python](/wiki/topics/python.md), [Architecture](/wiki/topics/architecture.md)

> Written by an LLM from machine transcripts. It can contain errors. Check the transcript before you quote it.

## Summary

The speaker discusses the challenges of writing and maintaining complex data flows in Apache Spark using Python. To solve issues with non-linear code execution and lack of intuitive mental models in Spark, the speaker developed a custom graph computation framework. This framework wraps data flow logic into boxes and automatically generates a visual dependency graph. Ultimately, the framework simplifies debugging, improves code readability, and helps developers manage large-scale data processing pipelines more effectively.

## Key points

- [0:10](https://www.youtube.com/watch?v=ariZeH1QUZA&t=10s) The speaker started working as a data scientist at a startup, dealing with complex and hard-to-maintain data flows in Spark.
- [1:16](https://www.youtube.com/watch?v=ariZeH1QUZA&t=76s) The startup uses Spark for tasks like record linking, such as matching GitHub profiles with LinkedIn profiles across hundreds of millions of records.
- [2:22](https://www.youtube.com/watch?v=ariZeH1QUZA&t=142s) Spark is not intuitive because its code is non-linear, lacking the explicit execution models found in multi-threading or GPU programming environments.
- [3:27](https://www.youtube.com/watch?v=ariZeH1QUZA&t=207s) The speaker built a framework on top of Python that enforces clear rules for data flow in Spark by encapsulating logic inside functional boxes.
- [3:27](https://www.youtube.com/watch?v=ariZeH1QUZA&t=207s) The framework automatically generates a visual directed graph representing the data pipeline, which aids in documentation and understanding.
- [4:36](https://www.youtube.com/watch?v=ariZeH1QUZA&t=276s) Comparing standard linear Spark code with the framework reveals how the framework preserves causal relationships and simplifies debugging.

## Takeaways

- Use visual dependency graphs to make complex distributed data pipelines easier to understand and maintain.
- Encapsulate data transformation logic into modular components to avoid side-effect confusion in non-linear execution engines.
- Build abstractions over low-level distributed frameworks when native APIs lack intuitive mental models for your team.

## Questions this talk answers

- How can you make complex Apache Spark data flows more maintainable and easier to debug?
- What are the main differences between programming for standard Python and programming for distributed engines like Spark?
- How can you automatically generate and visualize data dependencies in a large-scale data processing pipeline?

## Technologies

Apache Spark, Python, GitHub, LinkedIn

## Tags

apache spark, data engineering, data pipelines, framework design, python, software architecture
