9bNine Bits

How Apache Spark Works, and How It Fits with HDFS and HBase

Apache Spark is a distributed engine that processes data in memory across a cluster of machines, built as a faster alternative to Hadoop's original MapReduce. It organizes work into a DAG of stages that run in parallel on executors, typically reads its data from HDFS, and can exchange data with HBase when a pipeline needs fast key-based lookups alongside batch analytics.
How Apache Spark Works, and How It Fits with HDFS and HBase

 

RDD (Resilient Distributed Datasets) was designed based on a thesis which was published at NSDI (USENIX Symposium on Networked Systems Design & Implementation) under the sponsorship of USENIX in 2012. In the case of frequently recycling data among applications such as ‘Iterative machine learning’ or ‘multiple ad-hoc queries’, Data has been utilized only by storage just like the distributed file system. ‘Disc I/O’ and ‘setting up in series’ are much ineffective for the system. To solve this problem, the concept of RDD appeared for generally applicable recycling-Data due to ‘Pregel & Haloop’ are limited to specific conditions.

 

Each word means by below

 

  • Resilient : Data is able to be restored as RDD stores Lineage when Data has lost on memory or error has occurred in a node.
  • Distributed : Data is stored to several nodes in a cluster.
  • Dataset : The first data can be produced from files or by programming.

 

RDD which Spark consists of is a group of unchanged data stored throughout several distributed nodes and so it’s the only way to change data to create new RDD.

 

 

RDD Operations

 

 

Transformation

  • The attribute of RDD data is unchangeable, so existing RDD should be filtered out or converted to make new RDD which comes with new Data. These operations above are called ‘Transformations’

 

Actions

  • The operation is to put the result on storage or to get desired data.

 

There are queries for each operation as referred to hereinafter.

 

 

RDD Lazy Execution

RDD data is unable to be used or converted before the process for the ‘Actions’ as referred above. It’s hereby called ‘Lazy Execution’.

Here is an example summarized as follows ; After reading American poem of ‘A Thousand Winds’, capitalize all the letters and get all the sentences included in ‘I am’

 

1. Read and save “a_thousand_winds.txt’ stored in HDFS

2. Make new RDD converted all the letters in the poem into capitalization.

3. Make another RDD consist of sentences included in “I AM”

4. the result comes out

While processing ④ / “collect()”, ‘ ① ~ ③ ‘ proceed in numerical order.

Scala Spark Shell regarding REPL(Read-eval-print loop) was used for the example above.

For the next time, ‘Persistence of RDD’ and ‘programming of Spark’ will be mentioned about.

 

 

[Reference] Matei Zaharia(2012), “Resilient Distributed Datasets :A Fault-Tolerant Abstraction for In-Memory Cluster Computing”

 

 

Tags: HDFS , NSDI , RDD , recycling-Data , Spark , Transformation

Common questions

Does Spark replace Hadoop?

No. Spark replaces Hadoop's MapReduce execution engine, but it commonly still relies on HDFS for storage and on YARN or Kubernetes for cluster resource management.

What is the difference between an RDD and a DataFrame in Spark?

An RDD is a low-level, schema-less collection of records with manual control over operations. A DataFrame adds a schema and is processed through Spark's query optimizer, which usually makes it faster and easier to write for typical analytics work.

Why would a pipeline use both Spark and HBase?

Spark is suited to batch and iterative processing over large files, while HBase is suited to fast lookups or updates of individual rows by key. Pipelines that need both patterns often run Spark jobs over HDFS data and use HBase connectors for the row-level access.

Can Spark run without HDFS?

Yes. Spark can read from local disk, object storage such as S3, relational databases, or message systems. HDFS is a common storage choice, especially when locality-aware scheduling matters, but it is not a requirement.

Sources

  1. Apache Spark Documentation
  2. Apache Hadoop Documentation (HDFS Architecture)
  3. Apache HBase Reference Guide

About this page

Last reviewed October 30, 2026 by the Nine Bits editors. Read our editorial policy or report an error.