# Spark alternatives in Clojure

**URL:** <https://clojureverse.org/t/spark-alternatives-in-clojure/9926>\
**Category:** Beginners\
**Created:** [April 6, 2023, 1:24pm UTC](https://clojureverse.org/t/spark-alternatives-in-clojure/9926 "2023-04-06T13:24:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![cesarmarinhorj](https://clojureverse.org/user_avatar/clojureverse.org/cesarmarinhorj/32/4951_2.png) [@cesarmarinhorj](https://clojureverse.org/u/cesarmarinhorj)\
**Post date:** [April 6, 2023, 1:24pm UTC](https://clojureverse.org/t/spark-alternatives-in-clojure/9926/1 "2023-04-06T13:24:53Z")

</div>

After all this time learning (and enjoying) functional programming with Clojure, and after knowing that exists Spark for “Data Mining”, there are Clojure alternatives? cause seems the same thing, as it is made in Scala, could be same thing in Clojure.

Anything that is been used, as a Spark alternative?

Thanks!

---

<div class="post-metadata">

**Author:** ![maxweber](https://clojureverse.org/user_avatar/clojureverse.org/maxweber/32/2271_2.png) [@maxweber](https://clojureverse.org/u/maxweber)\
**Post date:** [April 6, 2023, 7:19pm UTC](https://clojureverse.org/t/spark-alternatives-in-clojure/9926/2 "2023-04-06T19:19:07Z")

</div>

> **[GitHub - ngrunwald/datasplash: Clojure API for a more dynamic Google Dataflow](https://github.com/ngrunwald/datasplash)**
>
> Clojure API for a more dynamic Google Dataflow. Contribute to ngrunwald/datasplash development by creating an account on GitHub.

is one option, a Clojure library for Google Cloud Dataflow / Apache beam.

Like Spark, Google Cloud Dataflow is rather complex to use. Therefore I often just use one big cloud instance to do all the data processing in plain Clojure. Recently more and more Clojure libs for data science are published, like this one:

> **[GitHub - scicloj/tablecloth: Dataset manipulation library built on the top of...](https://github.com/scicloj/tablecloth)**
>
> Dataset manipulation library built on the top of tech.ml.dataset - GitHub - scicloj/tablecloth: Dataset manipulation library built on the top of tech.ml.dataset

Here a talk with a tutorial: [re:Clojure 2021 workshop: Wrangling datasets with Tablecloth by Mey Beisaron - YouTube](https://youtu.be/VD17eB6vVto)

---

<div class="post-metadata">

**Author:** ![daslu](https://clojureverse.org/user_avatar/clojureverse.org/daslu/32/4173_2.png) [@daslu](https://clojureverse.org/u/daslu)\
**Post date:** [April 6, 2023, 9:22pm UTC](https://clojureverse.org/t/spark-alternatives-in-clojure/9926/3 "2023-04-06T21:22:42Z")

</div>

Also worth mentioning, in addition to @maxweber’s great recommendations:

- [Geni](https://github.com/zero-one-group/geni) - dataframes in Clojure based on wrapping Apache Spark

- [Clojask](https://clojure-finance.github.io/clojask-website/) - a dataframe library for larger-than-memory datasets, implemented in Clojure

---

<div class="post-metadata">

**Author:** ![zcaudate1](https://clojureverse.org/user_avatar/clojureverse.org/zcaudate1/32/5459_2.png) [@zcaudate1](https://clojureverse.org/u/zcaudate1)\
**Post date:** [April 7, 2023, 12:54am UTC](https://clojureverse.org/t/spark-alternatives-in-clojure/9926/4 "2023-04-07T00:54:19Z")

</div>

there’s [https://www.dask.org](https://www.dask.org). the library can be used with libpython.

---

<div class="post-metadata">

**Author:** ![gregoltsov](https://clojureverse.org/user_avatar/clojureverse.org/gregoltsov/32/1125_2.png) [@gregoltsov](https://clojureverse.org/u/gregoltsov)\
**Post date:** [April 8, 2023, 11:03am UTC](https://clojureverse.org/t/spark-alternatives-in-clojure/9926/5 "2023-04-08T11:03:07Z")

</div>

I think one way to look at this is to ask yourself what you want to use “Spark-like” for. From my experience, people tend to consider Spark when they have one of these needs:

1. Processing data that’s larger than RAM available - aka medium-sized to “big data”.
2. Streaming processing
3. Working with Data Lake files - like Parquet on S3.
4. A decent DataFrame-based processing.

So depending which particular use case you care about, there are already several options possible. 2, 3 and 4 have been addressed by several people above.

And, personally, for 1 and 3 I would urge you to reconsider needing Spark at all. It is a very heavy tool that in most cases is not needed when the data is medium-sized. Modern SQL tools like [DuckDB](https://duckdb.org/) allow working with serious data sizes (gigabytes+) and all you need is an existing tool like HoneySQL or [next-jdbc](https://github.com/seancorfield/next-jdbc).

---

<div class="post-metadata">

**Author:** ![cesarmarinhorj](https://clojureverse.org/user_avatar/clojureverse.org/cesarmarinhorj/32/4951_2.png) [@cesarmarinhorj](https://clojureverse.org/u/cesarmarinhorj)\
**Post date:** [April 8, 2023, 1:43pm UTC](https://clojureverse.org/t/spark-alternatives-in-clojure/9926/6 "2023-04-08T13:43:24Z")

</div>

Thanks! DusckDB seems amazing.  
Agree that Spark maybe is a oversized tool for the job. thanks!

---

<div class="post-metadata">

**Author:** ![daslu](https://clojureverse.org/user_avatar/clojureverse.org/daslu/32/4173_2.png) [@daslu](https://clojureverse.org/u/daslu)\
**Post date:** [April 9, 2023, 6:18am UTC](https://clojureverse.org/t/spark-alternatives-in-clojure/9926/7 "2023-04-09T06:18:42Z")

</div>

BTW DuckDB has an integration layer with [tech.ml.dataset](https://github.com/techascent/tech.ml.dataset) called [tmducken](https://github.com/cnuernber/tmducken), so it should also probably work nicely with Tablecloth mentioned above.

---

<div class="post-metadata">

**Author:** ![system](https://clojureverse.org/uploads/default/original/2X/5/51079bf9e4b7d9466242c06cf1e43b9f8bd6da14.png) [@system](https://clojureverse.org/u/system)\
**Post date:** [October 8, 2023, 6:18pm UTC](https://clojureverse.org/t/spark-alternatives-in-clojure/9926/8 "2023-10-08T18:18:56Z")

</div>

Closed on October 8, 2023, 6:18pm UTC

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.
