• No results found

This chapter presents and evaluates the storage layer of our scalable architecture for social media data analysis. In particular, we leverage the HBase system as the storage substrate, and extend it with a customizable indexing framework to support novel text index structures for handling the special queries of social media data. To the best of our knowledge, IndexedHBase is a first in developing a fully customizable indexing framework on a distributed NoSQL database. Performance evaluation with real data and queries from Truthy demonstrates that data loading and query evaluation strategies based on our customized index structures are significantly more efficient than implementations using current state-of-the-art distributed text indexing techniques. Our experimentation with IndexedHBase leads to serveral interesting conclusions of general significance.

77

First of all, parallelization and indexing are key factors in addressing the challenges brought by the sheer data size and special queries of social media data analysis. In particular, parallelization should be explored through every stage of data processing, including loading, indexing, and query evaluation. Also index structures should be flexible and customizable, rather than static, to effectively take advantage of the special characteristics of the data and achieve the best query evaluation performance at the cost of less storage and computation overhead. In order to achieve this, a general customizable indexing framework is necessary. Finally, to deal with the large size of intermediate data and results involved in the query evaluation process, complete and reliable parallel processing frameworks such as Hadoop MapReduce are needed. Lightweight frameworks like Riak MapReduce are not capable of handling queries involving analysis of large datasets.

78

Chapter 3

Batch Analysis Module – an Integrated Analysis Stack based on

YARN

79

3.1 Overview

As discussed in Section 1.3.2, a social media data analysis workflow usually consists of multiple stages, and each stage may apply a diversity of algorithms that demonstrate different computation and communication patterns. To achieve efficient execution of the whole integrated workflow, two more issues beyond the queries must be addressed.

First of all, each individual algorithm needs be implemented in an efficient way using a proper processing framework that is good at handling its computation and communication pattern. To illustrate, for algorithms that process small intermediate datasets with a low level of computational complexity, a sequential implementation may be enough. Algorithms that complete a single-pass processing over a large dataset need parallelization through a framework like Hadoop MapReduce [18]. More sophisticated algorithms that need to carry out iterative computation and collective communication can use an iterative MapReduce framework such as Twister [60] or Spark [166]. Finally, for algorithms designed to process high-throughput streaming data, stream processing frameworks such as Storm [25] are the most suitable for the parallelization.

Moreover, the analysis architecture must be able to dynamically switch to different processing frameworks to execute different analysis algorithms and finish the end-to-end analysis workflow.

Targeting these issues, we extend IndexedHBase to an integrated analysis architecture (Figure 1- 8) based on YARN [154], which is designed for accommodating tasks from various processing frameworks in a distributed environment with shared computing and storage resources. This chapter describes the batch analysis module of this architecture, and Figure 3-1 illustrates the internal interactions between the components in the batch analysis module and the storage layer.

80

The user application can define an analysis workflow in the form of a workflow driver script. This script invokes the query-and-analyze interface of the query and analysis engine to execute queries and analysis tasks. The engine converts these requests into jobs on different parallel processing frameworks, and dynamically employs different frameworks to complete the queries and analysis algorithms. During runtime, analysis algorithms may use either the data table records selected by the queries or the index table records as input.

Figure 3-1. Internal interaction between batch analysis module and storage layer

Based on this architecture, we develop the following set of analysis algorithms that are generally useful in the analysis workflows of many research scenarios:

A related hashtag mining algorithm using Hadoop MapReduce. For a given seed hashtag (e.g. #ncaa), it finds all related hashtags that co-occur frequently with the seed hashtag during a specific time window. This algorithm is useful in all scenarios where the social event of concern

81

can be identified by a set of related hashtags. It mainly relies on index tables to do mining, and only accesses a limited number of data table records according to the seed hashtag.

A meme daily frequency generation algorithm using Hadoop MapReduce. Given a time window, this algorithm generates the daily frequencies of all hashtags during that time. It is useful for many research purposes, such as generation of meme evolution timelines [41] and analysis of meme lifetime distribution [159].It completely relies on parallel scans of index tables.

A domain name entropy computation algorithm using Hadoop MapReduce. Given a time window, this algorithm collects the URLs posted by each user during that time, generates the distribution of domain names in these URLs for each user, and computes the entropy of the distribution. This algorithm is useful for projects related to analysis of user interest allocation or comparison between social networks and search engines.

A graph layout algorithm (known as “Fruchterman-Reingold algorithm”) using the Twister iterative MapReduce framework. Given a graph in the form of a set of nodes and edges, this algorithm generates a nice layout of all the nodes on a canvas, so that nodes connected with edges are positioned close to each other, and non-connected nodes tend to be apart. This algorithm is useful in many workflows involving visualization of social network structures, such as the one presented in [44]. Since it is computation intensive, a well-parallized implementation can achieve near-linear scalability.

A summary of these algorithms is given in Table 3-1. In this chapter, we describe the implementation of these algorithms and analyze their performance by comparing them to their sequential or raw data scanning counterparts. In addition we use several of them to reproduce a

82

workflow from a previous publication about political polarization [44] and demonstrate efficient execution of the whole workflow.

Table 3-1. Summary of analysis algorithms

Algorithm Key feature Time complexity

Related hashtag mining

Mostly relies on index; only accesses a small portion of original data.

O(H*M + N). M is the number of tweets containing the seed hashtag in the given time window. H is the toal number of co-occuring hashtags. N is the total number of index entries associated with the co-occuring hashtags.

Meme daily frequency generation

Totally based on parallel scan of customized index.

O(N). N is the total number of index entries associated with all the hashtags in the given time window.

Domain name entropy computation

Totally based on parallel scan of customized index.

O(N). N is the total number of index entries associated with all the URLs in the given time window.

Graph layout First parallel implementation on iterative MapReduce; near-linear scalability.

O(M*N2). M is the number of iterations. N is the number

of vertices in the graph.