StackShareStackShare
Follow on
StackShare

Discover and share technology stacks from companies around the world.

Follow on

© 2025 StackShare. All rights reserved.

Product

  • Stacks
  • Tools
  • Feed

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
  1. Stackups
  2. Application & Data
  3. Databases
  4. Big Data Tools
  5. Apache Flink vs Apache Spark

Apache Flink vs Apache Spark

OverviewDecisionsComparisonAlternatives

Overview

Apache Spark
Apache Spark
Stacks3.1K
Followers3.5K
Votes140
GitHub Stars42.2K
Forks28.9K
Apache Flink
Apache Flink
Stacks534
Followers879
Votes38
GitHub Stars25.4K
Forks13.7K

Apache Flink vs Apache Spark: What are the differences?

Introduction

Apache Flink and Apache Spark are both powerful distributed processing frameworks that are widely used for big data processing and analytics. While they share some similarities, there are key differences between the two.

  1. Processing Model: Apache Flink follows a true streaming model, where data is processed as it arrives in real-time. This provides low latency and ensures that processing is continuous and uninterrupted. On the other hand, Apache Spark operates on a micro-batch processing model, where data is processed in small batches, introducing slight latency. This makes Flink more suitable for applications requiring real-time data processing.

  2. Fault Tolerance: Flink and Spark both provide fault tolerance mechanisms, but they differ in their approaches. Flink uses a mechanism called "lightweight snapshots", where only the necessary information is stored periodically to recover from failures. This enables fast recovery times and low overhead. Spark, on the other hand, uses Resilient Distributed Datasets (RDDs) to achieve fault tolerance. RDDs store the lineage of each dataset, allowing for recomputation in case of failures. This approach introduces a higher overhead.

  3. Iterative Processing: Apache Flink was designed with iterative processing in mind, making it more efficient for machine learning and graph algorithms. Flink can keep data in memory between iterations, reducing the need for data serialization and deserialization. Spark also supports iterative processing, but it relies on RDDs, which have higher overhead and can be slower for iterative workloads.

  4. Data Processing APIs: Flink and Spark provide different APIs for data processing. Flink offers a unified API that supports both batch and stream processing, making it more convenient for developers. Spark, on the other hand, has separate APIs for batch (RDD-based) and stream (DStream-based) processing. Flink's unified API allows for easier code reuse and better integration across different processing modes.

  5. Memory Management: Flink and Spark use different memory management techniques. Flink has a managed memory model, where memory is allocated in fine-grained blocks and managed by the runtime. This allows Flink to efficiently manage memory and avoid out-of-memory errors. Spark, on the other hand, relies on Java's garbage collector for memory management, which can introduce longer pauses during processing.

  6. State Management: Apache Flink provides built-in support for managing state, allowing for efficient handling of streaming data with complex dependencies. Flink's state management can handle data that spans multiple events, making it suitable for applications such as event time processing. Spark, on the other hand, does not provide built-in state management capabilities, requiring developers to implement custom solutions for state handling.

In summary, Apache Flink excels in true streaming, fault tolerance, iterative processing, unified API, memory management, and state management, making it a great choice for real-time data processing. Apache Spark, on the other hand, is more suitable for batch processing, offers RDD-based fault tolerance, and has a larger ecosystem of tools and libraries.

Share your Stack

Help developers discover the tools you use. Get visibility for your team's tech choices and contribute to the community's knowledge.

View Docs
CLI (Node.js)
or
Manual

Advice on Apache Spark, Apache Flink

Krishna Chaitanya
Krishna Chaitanya

Head of Technology at Adonmo

Jun 27, 2021

Review

For such a more realtime-focused, data-centered application like an exchange, it's not the frontend or backend that matter much. In fact for that, they can do away with any of the popular frameworks like React/Vue/Angular for the frontend and Go/Python for the backend. For example uniswap's frontend (although much simpler than binance) is built in React. The main interesting part here would be how they are able to handle updating data so quickly. In my opinion, they might be heavily reliant on realtime processing systems like Kafka+Kafka Streams, Apache Flink or Apache Spark Stream or similar. For more processing heavy but not so real-time processing, they might be relying on OLAP and/or warehousing tools like Cassandra/Redshift. They could have also optimized few high frequent queries using NoSQL stores like mongodb (for persistance) and in-memory cache like Redis (for further perfomance boost to get millisecond latencies).

53.8k views53.8k
Comments
Nilesh
Nilesh

Technical Architect at Self Employed

Jul 8, 2020

Needs adviceonElasticsearchElasticsearchKafkaKafka

We have a Kafka topic having events of type A and type B. We need to perform an inner join on both type of events using some common field (primary-key). The joined events to be inserted in Elasticsearch.

In usual cases, type A and type B events (with same key) observed to be close upto 15 minutes. But in some cases they may be far from each other, lets say 6 hours. Sometimes event of either of the types never come.

In all cases, we should be able to find joined events instantly after they are joined and not-joined events within 15 minutes.

576k views576k
Comments

Detailed Comparison

Apache Spark
Apache Spark
Apache Flink
Apache Flink

Spark is a fast and general processing engine compatible with Hadoop data. It can run in Hadoop clusters through YARN or Spark's standalone mode, and it can process data in HDFS, HBase, Cassandra, Hive, and any Hadoop InputFormat. It is designed to perform both batch processing (similar to MapReduce) and new workloads like streaming, interactive queries, and machine learning.

Apache Flink is an open source system for fast and versatile data analytics in clusters. Flink supports batch and streaming analytics, in one system. Analytical programs can be written in concise and elegant APIs in Java and Scala.

Run programs up to 100x faster than Hadoop MapReduce in memory, or 10x faster on disk;Write applications quickly in Java, Scala or Python;Combine SQL, streaming, and complex analytics;Spark runs on Hadoop, Mesos, standalone, or in the cloud. It can access diverse data sources including HDFS, Cassandra, HBase, S3
Hybrid batch/streaming runtime that supports batch processing and data streaming programs.;Custom memory management to guarantee efficient, adaptive, and highly robust switching between in-memory and data processing out-of-core algorithms.;Flexible and expressive windowing semantics for data stream programs;Built-in program optimizer that chooses the proper runtime operations for each program;Custom type analysis and serialization stack for high performance
Statistics
GitHub Stars
42.2K
GitHub Stars
25.4K
GitHub Forks
28.9K
GitHub Forks
13.7K
Stacks
3.1K
Stacks
534
Followers
3.5K
Followers
879
Votes
140
Votes
38
Pros & Cons
Pros
  • 61
    Open-source
  • 48
    Fast and Flexible
  • 8
    One platform for every big data problem
  • 8
    Great for distributed SQL like applications
  • 6
    Easy to install and to use
Cons
  • 4
    Speed
Pros
  • 16
    Unified batch and stream processing
  • 8
    Out-of-the box connector to kinesis,s3,hdfs
  • 8
    Easy to use streaming apis
  • 4
    Open Source
  • 2
    Low latency
Integrations
No integrations available
YARN Hadoop
YARN Hadoop
Hadoop
Hadoop
HBase
HBase
Kafka
Kafka

What are some alternatives to Apache Spark, Apache Flink?

Presto

Presto

Distributed SQL Query Engine for Big Data

Amazon Athena

Amazon Athena

Amazon Athena is an interactive query service that makes it easy to analyze data in Amazon S3 using standard SQL. Athena is serverless, so there is no infrastructure to manage, and you pay only for the queries that you run.

lakeFS

lakeFS

It is an open-source data version control system for data lakes. It provides a “Git for data” platform enabling you to implement best practices from software engineering on your data lake, including branching and merging, CI/CD, and production-like dev/test environments.

Druid

Druid

Druid is a distributed, column-oriented, real-time analytics data store that is commonly used to power exploratory dashboards in multi-tenant environments. Druid excels as a data warehousing solution for fast aggregate queries on petabyte sized data sets. Druid supports a variety of flexible filters, exact calculations, approximate algorithms, and other useful calculations.

Apache Kylin

Apache Kylin

Apache Kylin™ is an open source Distributed Analytics Engine designed to provide SQL interface and multi-dimensional analysis (OLAP) on Hadoop/Spark supporting extremely large datasets, originally contributed from eBay Inc.

Splunk

Splunk

It provides the leading platform for Operational Intelligence. Customers use it to search, monitor, analyze and visualize machine data.

Apache Impala

Apache Impala

Impala is a modern, open source, MPP SQL query engine for Apache Hadoop. Impala is shipped by Cloudera, MapR, and Amazon. With Impala, you can query data, whether stored in HDFS or Apache HBase – including SELECT, JOIN, and aggregate functions – in real time.

Vertica

Vertica

It provides a best-in-class, unified analytics platform that will forever be independent from underlying infrastructure.

Azure Synapse

Azure Synapse

It is an analytics service that brings together enterprise data warehousing and Big Data analytics. It gives you the freedom to query data on your terms, using either serverless on-demand or provisioned resources—at scale. It brings these two worlds together with a unified experience to ingest, prepare, manage, and serve data for immediate BI and machine learning needs.

Apache Kudu

Apache Kudu

A new addition to the open source Apache Hadoop ecosystem, Kudu completes Hadoop's storage layer to enable fast analytics on fast data.

Related Comparisons

Bootstrap
Materialize

Bootstrap vs Materialize

Laravel
Django

Django vs Laravel vs Node.js

Bootstrap
Foundation

Bootstrap vs Foundation vs Material UI

Node.js
Spring Boot

Node.js vs Spring-Boot

Liquibase
Flyway

Flyway vs Liquibase