[CS61C FA20] Lecture 36.2 - MapReduce, Spark: Request-Level and Data-Level Parallelism — Transcript
Full transcript
- 0:00and welcome back our next video is going
- 0:03to talk about request level and data
- 0:04level parallelism
- 0:06you've seen this picture before we've we
- 0:08keep revisiting it as we
- 0:10continue to share the wonders of
- 0:12parallelism in all its different
- 0:13manifestations
- 0:15today we're going to talk about two
- 0:16elements one is the top most parallelism
- 0:18which is parallel requests top level
- 0:20idea that i'm going to search for cats
- 0:22on a computer and how that works at the
- 0:24top level we're also going to talk about
- 0:26a model of computation called mapreduce
- 0:29in which if i kind of think
- 0:30functionally about my data i can think
- 0:32of it by saying
- 0:34i've got a array of a million numbers
- 0:37i wouldn't mind being able to just say
- 0:40add them all up however square them all
- 0:42and then add them all up and i can think
- 0:44of that
- 0:45the abstraction allows us to be able to
- 0:47deal with it from the programmatic
- 0:48standpoint to just say square them all
- 0:52done no loop square them all so i'm
- 0:55thinking about
- 0:56doing of some more than one data at a
- 0:59time and up until now
- 1:00you've thought about well that just
- 1:01means semdi that means you're operating
- 1:02on four vectors
- 1:03four float you know a vector that's
- 1:05wider maybe four floats wide and you say
- 1:07add
- 1:08that with another vector at the same
- 1:10time that's what we used to think about
- 1:11that box
- 1:12but now we're going to think about that
- 1:13box in an abstraction point of view
- 1:15that that computation of squaring a
- 1:18million numbers
- 1:19could happen by me farming that out to a
- 1:21million computers
- 1:22or a million cores there's some models
- 1:24where you have a million cores on one
- 1:26computer
- 1:27i farm it out somehow it gets
- 1:30each one of these guys grabs a number is
- 1:33it a core is it a computer who cares
- 1:35each element each worker element will
- 1:36grab the number square it and return it
- 1:38instantly
- 1:39and it all somehow magically comes back
- 1:40to it so you can still think this this
- 1:42kind of new abstraction allows you to
- 1:44think in that model
- 1:45where i was adding four i just said add
- 1:48four vectors so i
- 1:49even though i have four floats and i'm
- 1:50adding to another to another flow i'm
- 1:51just adding a vector to another vector
- 1:53and it's really four floats being added
- 1:54all at once that's really wonderful
- 1:56the same idea in the abstraction idea of
- 1:59working with parallel data pretty neat
- 2:00so
- 2:00we're going to talk about some very
- 2:01powerful abstractions in this series of
- 2:03lectures
- 2:05so what's request level parallelism if
- 2:07you've ever thought about what web
- 2:08servers have to handle
- 2:09this is request level parallelism um
- 2:11just hundreds or thousands of requests a
- 2:13second and when that
- 2:15that number exceeds what the machine can
- 2:17handle it becomes a distributed
- 2:19a ddos attack it becomes an attack that
- 2:21the system is now
- 2:22pinned just trying to breathe and trying
- 2:24to move around and just enough
- 2:26enough denial of service uh requests you
- 2:29can make a denial of service
- 2:30attack and distribute this with a lot of
- 2:32computers all focusing on one server
- 2:34by making it try to deal with that so
- 2:36when it's in this comfort zone that's
- 2:37what we're talking about but you can
- 2:38exceed that to get to this and you'll
- 2:40learn about this in 161 a denial of
- 2:42service attack
- 2:43so imagine you're a server and your job
- 2:46is to just
- 2:46you know react to requests and you can
- 2:48make it by the way it's really fun to
- 2:50make your own web server
- 2:50i encourage you to think about that make
- 2:52a web server that serves some
- 2:53interesting data maybe you have a
- 2:54some sensor that's doing something fun
- 2:56or taking a picture or doing something i
- 2:57don't know
- 2:58measuring something in your house how
- 2:59much a plant grows and make a server
- 3:01that'll be able to respond to an attack
- 3:03onto it
- 3:03respond to request and give the data
- 3:05here's how big the plant has grown today
- 3:06or
- 3:07here's what my camera is seeing play
- 3:08with that it's fun to explore that now
- 3:10that you're all kind of becoming more
- 3:11more fluent computer scientist and
- 3:12and hackers and simpsons play with that
- 3:14it'd be fun to do
- 3:16so each of these requests is largely
- 3:18independent if you were to release your
- 3:19plant growing
- 3:20uh data service to the world you might
- 3:23have people all around the world
- 3:24and even for you know from the space
- 3:27station
- 3:28hitting your server asking for i want to
- 3:30know how tall that plant is right
- 3:32now kind of exciting but one of the
- 3:35elements of this is all these requests
- 3:36are mostly independent
- 3:37and maybe it's you know one person you
- 3:39know hitting it a lot because they want
- 3:41to
- 3:41chart a graph and so they're hitting it
- 3:42maybe your service also lets you query
- 3:44past growth values and so you've you've
- 3:46made a little table and so you're able
- 3:48to get the current growth value maybe
- 3:49past ones so maybe someone's going
- 3:51sweeping through all the valid dates and
- 3:53kind of hitting years a lot but most of
- 3:54the time they're largely independent
- 3:57most of the time these are reading from
- 3:59large databases or large data
- 4:01data centers some some way you're
- 4:03collecting and serving data again you'll
- 4:05learn this in cs186
- 4:06if you ever wanted to learn about how to
- 4:07build one of these uh officially but you
- 4:09can
- 4:10probably roll your own pretty easily as
- 4:12well
- 4:13they rarely involve it it says strictly
- 4:15uh read write data sharing or
- 4:17synchronization across requests so
- 4:18mostly these are just
- 4:19lots of lots of these requests happening
- 4:21at once and mostly their reads mostly
- 4:23their read sometimes they're rights but
- 4:24mostly their reads
- 4:26if you're handling a piazza who handles
- 4:28piazza think about all the services you
- 4:30use that are
- 4:31read write you know facebook piazza i'm
- 4:33editing something and i want it to be
- 4:34stored and seen be seen around the world
- 4:36um that cloud software which we'll learn
- 4:40a little bit about how the how how cloud
- 4:42warehouse scale computing works another
- 4:44lecture
- 4:44um certainly there are if you have new
- 4:47web services you're not just read-only
- 4:48you're
- 4:49able to interact in a social media way
- 4:50so that's important too and obviously
- 4:51there are rights there as well
- 4:54the competition is easily partitioned
- 4:55within a request and across different
- 4:57requests so
- 4:58these things you know each one can be an
- 5:00atomic request now
- 5:01a person says type this new in and hit
- 5:02edit and by the way you might have seen
- 5:04this
- 5:04before where two people are editing the
- 5:06same piazza post and they'll say oh
- 5:07there's a conflict because both of you
- 5:09are trying to hit the same thing there's
- 5:10got to be a way to handle these
- 5:11in a way a race condition who's who gets
- 5:13to write it first and piazza does a nice
- 5:15way
- 5:15that has a night just a nice job so it's
- 5:17been bringing it already if ever there's
- 5:19a question on an exam
- 5:20and many of the tas try to answer the
- 5:21question i'll get that i've gotten that
- 5:22several times this semester
- 5:24so this software still has to be able to
- 5:25resilient to that kind of a thing as
- 5:26well
- 5:28here's an example of google's query
- 5:30serving architecture
- 5:31you hit the google uh web server and the
- 5:34first thing it does is do a spell
- 5:36checker and grab some ads
- 5:38i mean the ads are the most important
- 5:39thing from google's point of view
- 5:40because that's where the monetization is
- 5:42you search for i want to find the best
- 5:44shoes in berkeley
- 5:45well you bet bet your bet your bottom
- 5:48dollar that somebody
- 5:49who sells shoes around berkeley is
- 5:52is it would be incentivized to pay
- 5:55google so that
- 5:56their possible research you know return
- 5:59uh um or the link to their to their
- 6:02company
- 6:03shows up very early uh and there's a
- 6:05there's a whole way that i if i if i
- 6:06really need to
- 6:07you know my my funders have told me i
- 6:09need to ramp up my sales because of
- 6:12something
- 6:12and so i'm gonna pay google a little bit
- 6:14more money so it's more prominent or it
- 6:15comes up in
- 6:16even you know farther away searches even
- 6:18how about sneakers well i've never had
- 6:20to pay to get into the sneakers there so
- 6:21ad serving is
- 6:22really important there it first has to
- 6:24go and look up its index it's already
- 6:26built
- 6:26by the way many people naively think
- 6:28that when you type something it then
- 6:30starts to search the web it doesn't at
- 6:31all it's been crawling the web
- 6:32continuously
- 6:33building a huge index a huge
- 6:37index database um and so it knows where
- 6:40the documents might live this index
- 6:42servers
- 6:42by the way notice that they're in
- 6:43parallel this this is drawn that way to
- 6:45indicate
- 6:46that there are a lot of these guys um
- 6:48there's no way that this is hitting one
- 6:50really fast machine this is hitting a
- 6:52lot of machines and they're coming back
- 6:53and it's being
- 6:54aggregated so kind of the interesting
- 6:56part is what's happening here how is it
- 6:58being aggregated
- 6:59through those all requests coming back
- 7:01in so here's your
- 7:03page and i got okay great and i'm going
- 7:04to grab a document and click on this and
- 7:06i might the document might get fred from
- 7:07there as well and returned as well
- 7:09so exciting that google certainly has an
- 7:11architecture that has
- 7:12a front page it's doing spell checking
- 7:15it's serving it sad that's a really big
- 7:17deal
- 7:17um bringing up its index to find out
- 7:19what the what the list is of your
- 7:21of your possible links to there as well
- 7:23as documents that's being stored and
- 7:24being
- 7:25informed to feed the index servers as
- 7:28well
- 7:30data level parallelism you've seen a
- 7:31little bit before there's data in memory
- 7:33you've got a little bit you've got an
- 7:34array and i want to be able to
- 7:36attack this with um all the cores i have
- 7:39to attack and so that's very very common
- 7:42what you haven't seen so much of that
- 7:43we're going to introduce in these series
- 7:44of lectures is data across many disks
- 7:46i've got this massive we call this big
- 7:48data i've got this so big data's so big
- 7:49i can't fit it in memory i have to fit
- 7:51in a disc i can read a portion into
- 7:52memory and work with it but that's the
- 7:53biggest i can do it
- 7:54so how would you be able to even if the
- 7:56not just in one disk
- 7:58one big let's say raid disk you don't
- 8:00know what rate is yet but one big
- 8:02set of disks on my computer that looks
- 8:04as maybe one virtual disk but actually
- 8:06as many disks as an abstraction
- 8:08but no it's so big that it can't even
- 8:09fit in one disk it has to fit on many
- 8:11disks and maybe those things live in the
- 8:13disks live in the cloud so that's called
- 8:15cloud storage
- 8:16how would you boy it would be nice it'd
- 8:18be sure nice if we had an abstraction to
- 8:20be able to
- 8:20type some commands and have it be able
- 8:22to work over those disks
- 8:24that's we're going to teach in these
- 8:25next series of lectures matt produces
- 8:26this wonderfully powerful idea
- 8:29um an abstraction a software
- 8:31infrastructure and open source software
- 8:32infrastructure now thankfully
- 8:34that we can all play with all experiment
- 8:35with that lets you work across many many
- 8:37disks
- 8:38it's a file to file model it's very very
- 8:40exciting
- 8:41so today's lecture and series of
- 8:43lectures is about
- 8:44mapreduce and an implementation of that
- 8:47which is really
- 8:47quite clever called spark as well so
- 8:49we'll see the next couple of lectures
- 8:50and we'll see you there
About this transcript
This page contains the full transcript of [CS61C FA20] Lecture 36.2 - MapReduce, Spark: Request-Level and Data-Level Parallelism by CS 61C Departmental, generated from the public captions YouTube serves with the video. The transcript has 1,992 words across 322 segments, with the original timestamps preserved so you can click any line to jump to that moment in the embedded player.
What you can do with it
Use the transcript to take notes, quote the speaker, build a study guide, generate a summary with ChatGPT or Claude via the YouTube Summary tool, or export it as a timed subtitle file with YouTube to SRT. You can also re-open it in the transcriber to translate the transcript into 100+ languages.
Free YouTube transcript tool
YouTube2Text is a free YouTube transcript generator — no signup, no daily limit. Paste any YouTube link and get the full transcript instantly, with timestamps, click-to-jump, translation to 100+ languages, AI prompts for ChatGPT, Claude, and Gemini, and exports to TXT, SRT, VTT, or Markdown.