Big Data Stores
IntroductionScaling RDBMS
Master-Slave:
All writes are written to the master. All reads performed against the replicated slave databases
Critical reads may be incorrect as writes may not have been propagated down
Large data sets can pose problems as the master needs to duplicate data to slaves
Vertical Partitioning:
Have tables related to a specific feature sit on their server
May have to rebalance or reshard if tables outgrow the server
Range-based Partitioning:
When a single table canno ...
Big Graph Analytics
GraphXUnifying Data-Parallel and Graph-Parallel Analytics
Graph Representation
Property Graphs
View a Graph as a Table
Distributed Graphs as Tables
Triplets View
Triplets Join the Vertices and Edges
Map Reduce Triplets
123SELECT t.dstId, reduceUDF(mapUDF(t)) AS sumFROM triplets AS t GROUPBY t.dstId
Example: Oldest Follower What is the age of the oldest follower for each user?
1234val oldestFollowerAge = graph.mapreduceTriplets( e => (e.dst.id, e.src.age), //Map ...
Graph-based Computing Platforms
Graph AnalyticsGraphs Representations
Adjacency Matrices
Represent a graph as an n x n square matrix M
n = |V|
Mij =1 means a link from node i to j
Advantages
Amenable to mathematical manipulation
Iteration over rows and columns corresponds to computations on outlinks and inlinks
Disadvantages
Lots of zeros for sparse matrices
Lots of wasted space
Adjacency Lists
Advantages
Much more compact representation
Easy to compute over outlinks
Disadvantages
Much more difficult to comp ...
Stream Processing - Spark Streaming
IntroductionSpark Streaming Overview
“Low Latency”, High-throughput and Fault Tolerant
Discretized Stream (DStream): Micro-batches of RDDs
Leverage Core Components from Spark
RDD data model and API
Data Partitioning and Shuffles
Task Scheduling
Monitoring/ Instrumentation
Scheduling and Resource Allocation
Discretized Stream ProcessingRun a streaming computation as a series of very small, deterministic batch jobs
Chop up the live stream into batches of X seconds
Spark treats each batch of da ...
Stream Processing - Apache Kafka
IntroductionMotivationGoal: To provide a High-Performance, Reliable Distributed Unified Logging Platform
High throughput to support high volume event feeds
Support real-time processing of these feeds to create new, derived feeds
Support large data backlogs to handle periodic ingestion from offline systems
Support low-latency delivery to handle more traditional messaging use cases
Guarantee fault-tolerance in the presence of machine failures
KafkaIt is a Distributed Unified Logging Platform
K ...
Stream Processing - Apache Storm
IntroductionHadoop
Strength:
Batch processing
simple programming model
Massively scalable
1000’s node cluster w/ commodity hardware
High throughout
Move computation to the data nodes
Highly available
Built-in failover
Weakness:
High Latency
Minutes or even hours
Poor support for Interactive Analysis
Inability to Rapidly Respond to Special/ Unexpected Events
Stream Processing
Stream Processing is an infrastructure for continuous (non-stopped, never-ending) data processing
Comput ...
Spark SQL
IntroductionEfficient In-Memory Storage
Simply caching Hive records as Java objects is inefficient due to high per-object overhead
Instead, Shark employs column-oriented storage using arrays of primitive types
Row-oriented storage is more suitable for real time searching (such as real-time transaction processing)
Column-oriented storage is more suitable for big data systems for anlyzing, like search the frequent objects within the whole dataset that requires to scan the whole column
Approac ...
Word Embedding
Word EmbeddingOne-hot encoding
Problems
High-dimension: Dimension of encoded data is equivalent to the number of different tokens within the dictionary
Sparse:
Lack of semantic meaning: we want the embedding of the token to represent something that we can understand. For example, King-Queen = Man-Woman. Ideally, we hope the minus of the embedding of “king” and “queen” is equivalent to the minus of the embedding of “man” and “woman” (the different between “king” and “queen” is the same as the d ...
Attention
AttentionNeighbor InformationWe can aggregate the neighbor information using the average value of the encoding neighbor tokens
f(x) = \frac{1}{n} \sum_{i=1}^n y_iWe can also consider the distance of target token against the neighbor (i.e., if the neighbor is very close to the token, then it has a higher weight), which is the idea of Attention
f(x) = \frac{1}{n} \sum_{i=1}^n \alpha(x, x_i) y_iwhere $\alpha(x, x_i)$ is related to similarity or distance
Attention Machanism
Hidden state of each wor ...
Spark and BDAS
Introduction
Motivation: Many of the previous cluster programming models are based on directed acyclic data flow from stable storage to stable storage, e.g. MapReduce, Dryad, Tez, SQL
Benefits of data flow: runtime can decide where to run tasks and can automatically recover from failures
However, although Acyclic data flow is a powerful abstraction, it is NOT efficient for applications that repeatedly reuse a Working-Set of data:
Iterative algorithms (machine learning)
Interactive data mining ...


