# Introduction

在 hadoop architecture 學習紀錄中介紹過了 Hadoop、Yarn 跟 MapReduce，接下來來介紹一個應用在分散式儲存系統上的一套工具，SPARK。

Apache Spark 是一個迅速的分散式運算系統，眾所皆知的幾個特點是 :

## Speed **:**

Spark 所有的運算都是 **In Memory** 的，其速度甚至可以達到 MapReduce 的百倍以上，也比一般讀寫硬碟的速度高十倍有餘。

所以相對而言，也非常吃記憶體，使用 Spark 時的記憶體規劃是很重要的喔。

## Ease of Use :

Spark 本身是用 Scala 開發的，但也提供 high-level APIs 支援 Java 、 Scala、Python、R 等多種語言。

## Generality :

Spark 同時也支持圖形介面與多項工具的應用，包括 :

Spark SQL : 可以下 SQL 指令及對結構化資料做處理。

MLlib : 這個套件主要提供豐富的機器學習功能。

GraphX : graph處理。

Spark Streaming : 對串流資料的處理。

## Runs Everywhere :

他可以在很多環境上執行，可以在Yarn、Mesos、K8S、Cloud(EC2)，或是 standalone。

**＊本文以 pyspark 為範例。**

**＊版本為 spark-2.2.1**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lin-guan-ting.gitbook.io/apache-spark/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
