Fireship · @fireship
Apache Spark in 100 Seconds
Uploaded November 19, 2024 · Length 3:20
Summary
Apache Spark explained in 100 seconds: an open-source data analytics engine for big data processing and machine learning.
- apache spark
- big data analytics
- machine learning
- data processing
- distributed computing
Transcript preview
The first 2 minutes of the transcript. Select a timestamp to watch that moment on YouTube.
- 0:00
Apache spark an open- Source data
- 0:02
analytics engine that can process
- 0:04
massive streams of data from multiple
- 0:06
sources like an octopus juggling
- 0:08
chainsaws it was created in 2009 by mate
- 0:11
zaharia at UC Berkeley's amp lab around
- 0:13
this time the amount of data being
- 0:15
collected on the internet was exploding
- 0:17
from megabytes to pedabytes making it
- 0:19
impossible to analyze on a single
- 0:21
machine but there was already a clever
- 0:22
programming model called map reduce you
- 0:24
map data into key value pairs Shuffle
- 0:26
and sort them into groups by key then
- 0:28
reduce each group to to compute a final
- 0:30
result this allowed large data sets to
- 0:32
be distributed across multiple machines
- 0:35
but there was still a huge bottleneck
- 0:36
caused by dis iio aache spark fixed this
- 0:39
by doing most of its work in memory
- 0:40
instead of reading from disk which can
- 0:42
be up to 100 times faster and that's a
- 0:44
game Cher for big data analytics and
- 0:46
machine learning it's used by Amazon to
- 0:48
analyze e-commerce data by NASA's jet
- 0:51
propulsion lab to analyze deep space
- 0:53
along with 80% of Fortune 500 companies
- 0:55
to process all their data despite its
- 0:57
reputation for distributed big data
- 0:59
processing you can easily run Apache
- 1:01
spark locally on your own machine it's
- 1:03
written in Java and runs on the jvm but
- 1:05
its apis can be used with wrappers for
- 1:07
python SQL and many other languages to
- 1:10
get started install it then let's
- 1:12
imagine we have a CSV file with four
- 1:14
columns for City population latitude and
- 1:17
longitude and our boss wants us to find
- 1:18
the city with the biggest population
- 1:20
between the tropics the first step is to
- 1:22
initialize a session and then load the
- 1:24
data into memory the spark will take the
- 1:26
spreadsheet and create a data frame
- 1:28
which turns the columns and rows into a
- 1:29
collection of objects they can be
- 1:31
processed across distributed nodes from
- 1:33
here we can apply transformations to the
- 1:35
data frame by chaining method calls like
- 1:37
in this case we want to filter the data
- 1:39
frame to exclude cities outside of the
- 1:41
tropics that transformation will happen
- 1:43
in memory then we can order the results
- 1:45
by population and finally use first to
- 1:47
grab the largest tropical City to the
- 1:49
city of Mexico City pretty cool and if
- 1:52
you're working with a SQL database you
- 1:53
can easily use that data directly
- 1:55
instead of the data frame API and when
- 1:57
working with massive data sets it Sparks
- 1:59
cluster manager or tools like kubernetes


