Sub topic 14
Ecosystem, team skills, and deployment
This chapter assumes you have read the profiles of pandas, Polars, DuckDB, and Spark. It covers the non-performance factors that often decide which tool you can run in practice: the libraries around it, the skills of the people using it, and where the code has to run.
Ecosystem fit
A tool is more useful when the libraries you already depend on can read its data.
- pandas has the widest reach. scikit-learn, statsmodels, and most plotting libraries accept a pandas DataFrame directly, and many tutorials and internal examples assume it.
- Polars and DuckDB integrate with the rest of the stack mostly through Arrow. Conversion is usually a single call, but it is still a step you must add, and it can copy data.
- Spark has its own ecosystem: connectors for data lakes and warehouses, Structured Streaming, and MLlib. Most managed data platforms offer it as a built-in option.
If a downstream library accepts only pandas, you can still use another engine for the heavy work. Aggregate with that engine, then convert the small result to pandas at the end.
Team skills
The best tool on paper is the wrong one if nobody can maintain the code.
| Team strength | Tool that fits with least friction |
|---|---|
| Analysts who already write SQL | DuckDB |
| Python users who know pandas | pandas, then Polars for heavier jobs |
| Engineers comfortable with expression-style APIs | Polars |
| Data engineers who run clusters | Spark |
Polars expressions look different from pandas indexing, so expect a learning period. DuckDB lets a team reuse SQL it already has. Spark adds concepts such as partitions, shuffles, and executors that your team must understand to debug slow jobs.
Deployment
Where the code runs limits your options as much as the data size does.
- Laptop or notebook: pandas, Polars, and DuckDB install with
pipand need no server. - Single container or scheduled job: all three single-node tools fit in a small image. DuckDB and Polars have few dependencies, which keeps images light.
- Cluster or managed platform: Spark needs a driver and executors, plus configuration, monitoring, and version management. Many teams use a managed service to avoid running this themselves.
import duckdb
con = duckdb.connect()
total = con.sql("SELECT count(*) FROM 'sales.parquet'").fetchone()[0]
print(total)This runs in any Python process with pip install duckdb. The equivalent Spark job needs a session, and in production a cluster behind it.
Putting it together
The diagram shows the order in which these factors usually narrow the choice.
Exercise
Your team of SQL-fluent analysts runs a nightly job on one small container. The job aggregates a 5 GB Parquet file, and a downstream plotting library accepts only pandas DataFrames. Which tool would you pick for the aggregation, and how do you satisfy the plotting library?
Show answer
DuckDB fits. The team already knows SQL, it runs inside one container with a plain pip install, and it reads Parquet directly. Run the aggregation in DuckDB, then convert the small result with .df() and pass that pandas DataFrame to the plotting library.