Fireship · @fireship

Apache Spark in 100 Seconds

Uploaded November 19, 2024 · Length 3:20

Apache Spark in 100 Seconds

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.

  1. 0:00

    Apache spark an open- Source data

  2. 0:02

    analytics engine that can process

  3. 0:04

    massive streams of data from multiple

  4. 0:06

    sources like an octopus juggling

  5. 0:08

    chainsaws it was created in 2009 by mate

  6. 0:11

    zaharia at UC Berkeley's amp lab around

  7. 0:13

    this time the amount of data being

  8. 0:15

    collected on the internet was exploding

  9. 0:17

    from megabytes to pedabytes making it

  10. 0:19

    impossible to analyze on a single

  11. 0:21

    machine but there was already a clever

  12. 0:22

    programming model called map reduce you

  13. 0:24

    map data into key value pairs Shuffle

  14. 0:26

    and sort them into groups by key then

  15. 0:28

    reduce each group to to compute a final

  16. 0:30

    result this allowed large data sets to

  17. 0:32

    be distributed across multiple machines

  18. 0:35

    but there was still a huge bottleneck

  19. 0:36

    caused by dis iio aache spark fixed this

  20. 0:39

    by doing most of its work in memory

  21. 0:40

    instead of reading from disk which can

  22. 0:42

    be up to 100 times faster and that's a

  23. 0:44

    game Cher for big data analytics and

  24. 0:46

    machine learning it's used by Amazon to

  25. 0:48

    analyze e-commerce data by NASA's jet

  26. 0:51

    propulsion lab to analyze deep space

  27. 0:53

    along with 80% of Fortune 500 companies

  28. 0:55

    to process all their data despite its

  29. 0:57

    reputation for distributed big data

  30. 0:59

    processing you can easily run Apache

  31. 1:01

    spark locally on your own machine it's

  32. 1:03

    written in Java and runs on the jvm but

  33. 1:05

    its apis can be used with wrappers for

  34. 1:07

    python SQL and many other languages to

  35. 1:10

    get started install it then let's

  36. 1:12

    imagine we have a CSV file with four

  37. 1:14

    columns for City population latitude and

  38. 1:17

    longitude and our boss wants us to find

  39. 1:18

    the city with the biggest population

  40. 1:20

    between the tropics the first step is to

  41. 1:22

    initialize a session and then load the

  42. 1:24

    data into memory the spark will take the

  43. 1:26

    spreadsheet and create a data frame

  44. 1:28

    which turns the columns and rows into a

  45. 1:29

    collection of objects they can be

  46. 1:31

    processed across distributed nodes from

  47. 1:33

    here we can apply transformations to the

  48. 1:35

    data frame by chaining method calls like

  49. 1:37

    in this case we want to filter the data

  50. 1:39

    frame to exclude cities outside of the

  51. 1:41

    tropics that transformation will happen

  52. 1:43

    in memory then we can order the results

  53. 1:45

    by population and finally use first to

  54. 1:47

    grab the largest tropical City to the

  55. 1:49

    city of Mexico City pretty cool and if

  56. 1:52

    you're working with a SQL database you

  57. 1:53

    can easily use that data directly

  58. 1:55

    instead of the data frame API and when

  59. 1:57

    working with massive data sets it Sparks

  60. 1:59

    cluster manager or tools like kubernetes