CS5412 / LECTURE 7 THE PUZZLE OF “ALWAYS SHARDED” IOT DATA AND COMPUTING
Ken Birman Spring, 2020
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 1
CS5412 / LECTURE 7 Ken Birman THE PUZZLE OF ALWAYS SHARDED Spring, - - PowerPoint PPT Presentation
CS5412 / LECTURE 7 Ken Birman THE PUZZLE OF ALWAYS SHARDED Spring, 2020 IOT DATA AND COMPUTING HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 1 TODAY: BRINGING TWO IDEAS TOGETHER Suppose our data is sharded, and needs to stay sharded.
Ken Birman Spring, 2020
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 1
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 2
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 3
4 HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP
5
Machine learning typically lives here, at the back
GFS
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP
Machine learning typically lives here, at the back
GFS
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 6
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 7
Divide the set of knowledge tasks into groups. Don’t ask one server to do everything. Instead build distinct servers for each category of knowledge tasks. So we would want
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 8
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 9
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 10
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 11
Huge numbers of functions – this can be handled with function services that launch containers as needed. The functions are stateless. So the model scales. Huge numbers of µServices: We had a hybrid cloud and can repurpose its App
The µServices are currently hard to build. Solutions like Derecho could help. We need a scalable style of machine learning in the µServices layer. This is hard Huge numbers of functions – this can be handled with function services that launch containers as needed. The functions are stateless. So the model scales. Huge numbers of µServices: We had a hybrid cloud and can repurpose its App
The µServices are currently hard to build. Solutions like Derecho could help. We need a scalable style of machine learning in the µServices layer. This is hard
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 12
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 13
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 14
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 15
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 16
The developer thinks of everything in terms of collections of tuples.
this key could be a file name, a GPS location, a hotel name… Hadoop has many tools to help you transform your data into this form. Modern programming languages embed collections into C++, C#, Python, Java, etc.
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 17
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 18
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 19
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 20
var studentsGroupByStandard = from s in studentList group s by s.StandardID into sg
select new { sg.Key, sg }; foreach (var group in studentsGroupByStandard) { Console.WriteLine("StandardID {0}:", group.Key); group.sg.ToList().ForEach(st => Console.WriteLine(st.StudentName )); }
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 21
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 22
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 23
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 24
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 25
Leader This is called a “map” operation Shuffle Full Shuffle is an n x n pattern: every shard sends data to every other shard! This avoids ever having all our work concentrated on any single process. Places where our raw data resides, or our IoT data was saved (1) At each of those locations, a small fragment of code runs (probably in Python or C#) and transforms our raw data into a collection of tuples. (2) Now we can select interesting tuples and designate some value as a key. Each is “sent” to the corresponding server in DHT style (3) On arrival, we group the incoming tuples that have the same key and combine them. This is a “reduce” step, and yields one tuple per key.
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 26
turn that one point into a box ([10:58.850, 10:59.150], [69.4, 69.7])
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 27
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 28
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 29
Leader The reduce step is where we take the three values and merge them to find the overlap region, which now becomes our new “clean” sensor output Once-per-second Sensor
(group-id=1899, sensor-id=6619, time_range=[…], value_range=[….])
Tuple Function DHT-put Shuffle
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 30
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 31
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 32
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 33
Vast numbers of data sources Functions used to handle simple events and absorb load Heavily sharded edge µ-services do real-time knowledge acquisition and decision making using ML computational models
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 34
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 35
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 36
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 37
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 38
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 39
Schedule the vet! GPU GPU
KEN BIRMAN (KEN@CS.CORNELL.EDU) 40
Photo upload Key-hash Sharded, replicated blob store Done! Event meta-data IoT Hub Function Key-hash Sharded knowledge store Hoof crack, p=.78 GPU-accelerated computation Rough terrain, p=.03
router
Hoof crack, p=.78 2-node shard
N1 N2 replica N3 N4
Function Svc
Thick line denotes “large objects”
HTTP://WWW.CS.CORNELL.EDU/COURSES/CS5412/2020SP 41