Ciprian-Octavian Truicȃ

Elena Apostol
email: elena.apostol@cs.pub.ro

Jérôme Darmont
email: jerome.darmont@univ-lyon2.fr

Ira Assent

TextBenDS: a generic Textual data Benchmark for Distributed Systems

Keywords: Benchmark, Distributed frameworks, Distributed DBMSs, Top-k keywords, Top-k documents, Weighting schemes

Extracting top-k keywords and documents using weighting schemes are popular techniques employed in text mining and machine learning for different analysis and retrieval tasks. The weights are usually computed in the data preprocessing step, as they are costly to update and keep track of all the modifications performed on the dataset. Furthermore, computation errors are introduced when analyzing only subsets of the dataset. Therefore, in a Big Data context, it is crucial to lower the runtime of computing weighting schemes, without hindering the analysis process and the accuracy of the machine learning algorithms. To address this requirement for the task of top-k keywords and documents, it is customary to design benchmarks that compare weighting schemes within various configurations of distributed frameworks and database management systems. Thus, we propose a generic document-oriented benchmark for storing textual data and constructing weighting schemes (TextBenDS). Our benchmark offers a generic data model designed with a multidimensional approach for storing text documents. We also propose using aggregation queries with various complexities and selectivities for constructing term weighting schemes, that are utilized in extracting top-k keywords and documents. We evaluate the computing performance of the queries on several distributed environments set within the Apache Hadoop ecosystem. Our experimental results provide interesting insights. As an example, MongoDB proves to have the best overall performance, while Spark's execution time remains almost the same, regardless of the weighting schemes.

Introduction

With the increase in generated textual data and the many challenges related to extracting knowledge and patterns from large amounts of textual documents, new methods that use dynamic text processing need to be employed. Among the techniques applied in several domains such as text and opinion mining, machine learning and information retrieval, top-k keywords and documents extraction are very frequently used [START_REF] Paltoglou | A study of information retrieval weighting schemes for sentiment analysis[END_REF][START_REF] Jones | A probabilistic model of information retrieval: development and comparative experiments: Part 1[END_REF][START_REF] Jones | A probabilistic model of information retrieval: development and comparative experiments: Part 2[END_REF].

Weighting keywords and extracting the top-k frequent terms from a corpus is successfully employed in document clustering [START_REF] Yin | Model-based clustering of short text streams[END_REF][START_REF] Wang | Shcoclust, a scalable similarity-based hierarchical co-clustering method and its application to textual collections[END_REF] where they are used as metrics to compute the inter-cluster distances. In topic modeling [START_REF] Krasnashchok | Improving topic quality by promoting named entities in topic modeling[END_REF][START_REF] Truica | Comparing different term weighting schemas for topic modeling[END_REF], term weighting schemes are used to measure the relevance of a word to a topic. For event detection [START_REF] Guille | Event detection, tracking, and visualization in twitter: a mention-anomaly-based approach[END_REF], term weights are used to measure the appearance of bursty topic in Online Social Networks. Trend discovery [START_REF] Bouakkaz | OLAP textual aggregation approach using the google similarity distance[END_REF][START_REF] Bringay | Towards an on-line analysis of tweets processing[END_REF][START_REF] Ravat | Top_keyword: an aggregation function for textual document olap[END_REF] employs Text Cubing and Online Analytical Processing (OLAP) [START_REF] Zhang | Topic cube: Topic modeling for OLAP on multidimensional text databases[END_REF][START_REF] Zhang | MiTexCube: MicroTextCluster cube for online analysis of text cells and its applications[END_REF] to construct term weighting schemes, which are used for analyzing the impact of products in Social Media. Sentiment analysis uses weighting schemes to vectorize textual data before detecting the polarity of each document [START_REF] Paltoglou | A study of information retrieval weighting schemes for sentiment analysis[END_REF].

Finding the top-k documents that are most similar to a query is one of the core tasks in information retrieval [START_REF] Hofmann | Probabilistic latent semantic indexing[END_REF] and natural language processing [START_REF] Lavrenko | Relevance-based language models[END_REF]. In information retrieval, ranking functions are used to score the similarity between a search query and a corpus of documents and return to the user the most relevant documents for their search. Ranking functions are also used in Natural Language Processing for the task of finding hidden semantic structures in textual data using techniques such as Latent Semantic Indexing [START_REF] Deerwester | Indexing by latent semantic analysis[END_REF].

Considering this context, choosing a processing framework is not easy. Thus, benchmarking is usually used to compare combinations of weighting schemes, computing strategies and physical implementations. However, most big data benchmarks focus on MapReduce operations and do not specifically target textual data [START_REF] Huang | The HiBench benchmark suite: Characterization of the MapReduce-based data analysis[END_REF][START_REF]Transaction Processing Performance Council (TPC): TPC Express Benchmark HS Standard Specification Version 1[END_REF][START_REF] Wang | BigDataBench: A big data benchmark suite from internet services[END_REF]. Moreover, the few benchmarks that do feature textual data [START_REF] Ferrarons | Primeball: a parallel processing framework benchmark for big data applications in the cloud[END_REF][START_REF] Gattiker | Big data text-oriented benchmark creation for Hadoop[END_REF] are still at the methodology or specification stages.

T 2 K 2 D 2 (Twitter Top-k Keywords and Documents multidimensional) benchmark [START_REF] Truicȃ | Benchmarking top-k keyword and top-k document processing with T 2 K 2 and T 2 K 2 D 2[END_REF] solves some of the current issues by compare the processing of different weighting schemes on various relational and NoSQL database management systems (DBMSs). However, one of the major drawbacks of this previous solution is the fact that is design to work on a single node, as opposed to a distributed environment, which limits its work with large sets of data. In this paper, we seamlessly expand and generalize T 2 K 2 D 2 to distributed systems to boost its scalability.

For our proposed benchmark solution (TextBenDS), we considered a series of objectives, as follows. We aim to dynamically compute the weighting score at the execution of each new request on the dataset, thus improving the classical information systems' approach and solving the reproducibility problems [START_REF] Lin | Toward reproducible baselines: The open-source ir reproducibility challenge[END_REF] of computing the weight one time [START_REF] Crane | A comparison of document-at-a-time and score-at-a-time query evaluation[END_REF][START_REF] Bellot | Report on inex 2013[END_REF]. Therefore, when weights are computed, we will take into account the varying size and content changes upon the dataset that happens with time [START_REF] Bifet | Sentiment knowledge discovery in twitter streaming data[END_REF].

Another objective is to redesign the schema to integrate new relationships to store metadata extracted during the preprocessing of the text, i.e., tags and name entities.

Finally, we are aiming at doing extensive experiments and successfully compare several big data processing solutions. For this paper we will consider the following distributed solutions: Hive -a distributed DBMS [START_REF] Thusoo | Hive: A warehousing solution over a map-reduce framework[END_REF], Spark -a distributed framework [START_REF] Zaharia | Apache spark: A unified engine for big data processing[END_REF] and MongoDB -a document-oriented DBMS.

As a general criterion, TextBenDS should be designed with Jim Gray's criteria for a "good" benchmark (relevance, portability, simplicity and scalability) [START_REF] Gray | The Benchmark Handbook for Database and Transaction Systems[END_REF] in mind.

The remainder of this paper is organized as follows. In Section 2, we present a survey on existing big data and, more specifically, text processing-oriented benchmarks, also specifying what our solution brings in addition to the ones presented in this section. In Section 3, we describe the general specifications of TextBenDS, focusing in particular on the employed data and workload models and on the applied performance metrics. A detailed description of our distributed implementation can be found in Section 4. Here we describe our queries, the chosen weighting schemes, as well as the multidimensional implementation for the three selected distributed systems. In Section 5, we present the set of experiments for both top-k keywords and documents. We provide an analysis and comparison of the results for each distributed system. Finally, in Section 6, we conclude the paper and provide new research perspectives.

Related Works

In this section we present an overview of the state of the art related to our contribution. We briefly analyze and compare some of the most relevant parallel text analysis and processing benchmarks from the big data domain.

Although there are many big data benchmarks that are mostly are data-centric, these solutions focus either on structured data, volume or on MapReduce-based applications, rather than on unstructured or variety. Furthermore, to the best of our knowledge, none deal with directly processing textual data. In these benchmarks, text is used as it is, without further processing or computing different measures, weights, or ranking functions.

For instance, the quasi-standard TPCxHS benchmark models a simple application and features, in addition to classical throughput and response time metrics, availability and energy metrics [START_REF]Transaction Processing Performance Council (TPC): TPC Express Benchmark HS Standard Specification Version 1[END_REF]. BigBench [START_REF] Ghazal | Bigbench: Towards an industry standard benchmark for big data analytics[END_REF] is the first benchmark that added semi-structured and unstructured data to TPC-DS [START_REF][END_REF] and was extended to work on Hadoop and Hive by implementing queries using HiveQL [START_REF] Chowdhury | A bigbench implementation in the hadoop ecosystem[END_REF]. Another improvement to this benchmark, that added additional queries, is BigBench V2 [START_REF] Ghazal | Bigbench v2: The new and improved bigbench[END_REF]. Although, the BigBench benchmark, and its extensions, are developed to work with multidimensional models and semistructured and unstructured date, their models do not take into account textual data and complex aggregation queries, e.g. queries that compute word weights dynamically or score documents using ranking functions.

Similarly to BigBench, HiBench [START_REF] Huang | The HiBench benchmark suite: Characterization of the MapReduce-based data analysis[END_REF] is a micro-benchmark developed specifically to stress test the capabilities of Hadoop (both MapReduce and HDFS). Using a set of predefined Hadoop programs, ranging from data sorting to clustering, HiBench is measuring metrics such as response time, HDFS bandwidth consumption and data access patterns. Another Big Data benchmark is MRBS [START_REF] Sangroya | Mrbs: Towards dependability benchmarking for hadoop mapreduce[END_REF]. This solution provides workloads of five different domains with the focus on evaluating the dependability of MapReduce systems.

SparkBench [START_REF] Agrawal | Sparkbench -a spark performance testing suite[END_REF][START_REF] Li | Sparkbench: A comprehensive benchmarking suite for in memory data analytic platform spark[END_REF] is a micro-benchmark suite developed specifically to stress test the capabilities of Spark on Machine Learning and Graph Computation tasks, rather that text preprocessing and computing weighting schemes. Moreover, Facebook developed LinkBench [START_REF] Armstrong | Linkbench: A database benchmark based on the facebook social graph[END_REF] to emulate social graph workload on top of databases such as MySQL.

BigDataBench [START_REF] Wang | BigDataBench: A big data benchmark suite from internet services[END_REF] features application scenarios from search engines, i.e., the application on Wikipedia entries of operators such as Grep or WordCount. Yet, although BigDataBench is open source, it is quite complex and difficult to extend, especially to test the computation efficiency of term weighting schemes.

BigFUN [START_REF] Pirzadeh | Bigfun: A performance study of big data management system functionality[END_REF] is a benchmark that uses a synthetic semi-structured social network data in JSON format and it focuses exclusively on micro-operations. The workload consists of queries with various operations such as simple retrieves, range scans, aggregations, joins, as well as inserts and updates.

By comparison with our solution, all the benchmarks presented above are not used for processing textual data and computing weighting schemes.

There are other types of benchmarks that evaluate parallel text processing in Big Data, cloud applications. However, there are only two available solutions that consist of only specifications without any physical implementation.

The first one is actually a methodology for designing text-oriented benchmarks in Hadoop [START_REF] Gattiker | Big data text-oriented benchmark creation for Hadoop[END_REF]. It provides both guidelines and solutions for data preparation and workload definition. Yet, as text analysis benchmarks, its metrics measure the accuracy of analytics results, while the objective of our solution is to evaluate the aggregation operations and the computing performance.

The second one is PRIMEBALL [START_REF] Ferrarons | Primeball: a parallel processing framework benchmark for big data applications in the cloud[END_REF]. It features a fictitious news site hosted in the cloud that is to be managed by the framework under analysis, together with several objective use cases and measures for evaluating system performance . One of its metrics notably involves searching a single word in the corpus. However, PRIMEBALL remains only a specification as of today.

There are also various dedicated text analysis benchmarks that exploit different types of corpora (news articles, movie reviews, books, tweets, synthetic texts...) [START_REF] O'shea | Benchmarking short text semantic similarity[END_REF][START_REF] Lewis | Rcv1: A new benchmark collection for text categorization research[END_REF][START_REF] Partalas | Lshtc: A benchmark for large-scale text classification[END_REF][START_REF] Kılınç | Ttc-3600: A new benchmark dataset for turkish text categorization[END_REF][START_REF] Wang | Textgen: a realistic text data content generation method for modern storage system benchmarks[END_REF]. In terms of metrics, except TextGen [START_REF] Wang | Textgen: a realistic text data content generation method for modern storage system benchmarks[END_REF] that specifically addresses the performance of word-based compressors, all these benchmarks focus on algorithm accuracy. Either term weights are known before the algorithm is applied, or their computation is incorporated with preprocessing. Furthermore, none of these benchmarks propose adequate data sampling methods based on analysis requirements.

BDGS [START_REF] Ming | Bdgs: A scalable big data generator suite in big data benchmarking[END_REF] is a benchmark that generates synthetic big data datasets preserving the 4V Big Data properties. BDGS covers three representative data types (structured, semistructured and unstructured) and three data sources (text, graph, and table data). Although, BDGS generates textual data, the workloads only employ simple computations such as sort, grep and word count. There are other benchmarks that focus on the same workloads [START_REF] Jia | Characterizing and subsetting big data workloads[END_REF]. The evaluation of complex computation, such as term weighting schemes, are not taken into account by any of these benchmarks.

FakeNewsNet [START_REF] Shu | Fakenewsnet: A data repository with news content, social context and dynamic information for studying fake news on social media[END_REF] is a text repository of news content, social context and dynamic information for benchmarking fake news detection, diffusion, and mitigation. The features it presents are linguistic, user profile data, and social network context. The benchmark does not propose any data sampling methods or weighting scheme computation of terms or documents. Furthermore, aggregation methods can be used to combine different features representations into a weighted form and optimize the feature weights by using weighting schemes in the case of textual data [START_REF] Shu | Fake news detection on social media: A data mining perspective[END_REF].

Thus, the existing text analysis benchmarks do not evaluate weighting schemes construction efficiency. This is why we introduced T 2 K 2 [START_REF] Truicȃ | T 2 K 2 : The twitter top-k keywords benchmark[END_REF], a top-k keywords and documents benchmark, and its decision support-oriented evolution T 2 K 2 D 2 [START_REF] Truicȃ | Benchmarking top-k keyword and top-k document processing with T 2 K 2 and T 2 K 2 D 2[END_REF]. Both benchmarks feature a real tweet dataset use case and queries with various complexities and selectivities. They help evaluate weighting schemes and database implementations in terms of computing performance. Yet, these solutions are not tailored for distributed computing.

As a conclusion to this section, our benchmark (TextBenDS) addresses the following shortcomings that exist in the current literature: i) proposes a number of aggregation queries to compute term weighting schemes and document ranking functions;

ii) tests the computation efficiency of term weighting schemes; iii) offers adequate data sampling methods for analysis; iv) works with structured, semi-structured, and unstructured data in the form of textual data; v) enables analysis based on gender, location, and time to extract general linguistic and social context features.

TextBenDS Specifications

In this section, we describe TextBenDS's data, workload models and performance metrics; and expand the work done in the original paper [START_REF] Truicȃ | Benchmarking top-k keyword and top-k document processing with T 2 K 2 and T 2 K 2 D 2[END_REF]. This new design creates a generic benchmark that handles not only Twitter datasets, but any kind of textual corpus.

Generic Data Model

For TextBenDS, we remodeled the T 2 K 2 D 2 multidimensional schema to incorporate new information about the textual documents, thus changing the logical model from a star schema to a snowflake schema. We kept the central fact tables that stores information about the documents, but added new entities to store the tags and named entities. TextBenDS's multidimensional snowflake schema is presented in Figure 1. The models' entities are briefly presented below.

-DocumentFacts is the central fact entity and contains the number of co-occurrence f t,d and term frequency T F(t, d) for a lemma in a document. The information stored in this table is used for computing the weighting schemes and the ranking functions for extracting the top-k keywords and documents. -DocumentDimension is the document dimension table, containing each document's unique identifier and the original and processed text, i.e., original text (RawText), clean text (CleanText) and lemma text(LemmaText). After the top-k documents search process is finished, the information in this entity is used to better visualize the results. -WordDimension stores the word's lemma and its unique identifier. The information stored in this entity is a central part of the two tasks at hand. It is used to correlate the top ranking terms with the weighting for the the task of top-k keywords. When searching for documents that match specific search queries, a filtering process is applied on the word attribute to select only the documents that contain the search terms before computing the scores for the ranking functions. -TimeDimension stores the full date and also its hierarchy composed of minute, hour, day, month and year. By filtering this dimension, analysts can apply the roll-up and drill-down operations to better understand the textual data from a time perspective and create different text cubes. Likewise, time series analysis can be applied here, in order to better [understand|interpret] the information. -AuthorDimension stores information about an author's unique identifier, gender, age, firstname, and lastname. By adding constraints on this dimension, analysts can select targeted genders and age ranges for the data mining process. -LocationDimension stores the geo-location coordinates for each document. This information is used in filtering to extract only areas of interest for the analysis process. -NamedEntityDimension stores named entities that extracted after corpus preprocessing.

These entities consist of real-world actors, such as persons, locations, organizations, products, etc. By adding filtering constraints on this entity, the analysis process can target named entities of interest, thus improving the decision making process offered by business intelligence techniques. -TagDimension stores the labels for documents, i.e. tags. These tags can be original documents' labels or metadata extracted through preprocessing, such as social media tags. Social media tags include hashtags and mentioning tags, which consists of citing other users' screen names in tweets (using the syntax @username). Hashtags can be used in filtering the dataset based on user interests, while mentioning tags are useful in data mining and graph mining for detecting leaders and followers and to construct the interactive graphs.

For each dimension, we chose members that best represent a generic model of textual data. However, the model can be adapted to specific datasets, maybe containing other kinds of textual information. The workload model for top-k keywords follows three major analysis directions by subsampling the corpus using filters on gender, time, and location. Also, we further the analysis by extracting top-k documents and subsampling the dataset by adding filters on the WordDimesion entity. The workload model uses OLAP queries to extract information from the multidimensional data model.

We use gender-based filters to extract two sets of features. The first set consist of general linguistic-based features. Using these features, analysts can detect different patterns in writing styles and construct gender-based vocabularies. The second set contains social context features and it's specific to social media datasets. The analysis process based on these features extracts information about gender-based events and objects of interest, as well as psychological profiles and social engagements between authors of the same or of different genders.

We use time-based filters to detect changes that appear over time in the vocabulary, thus extracting topics and events. The analysis of groups behaviour and the changes it suffers over time can further improve if these filters are associated with the gender-based and locationbased filters. Furthermore, when using OLAP operations such as roll-up and drill-down, we can better understand the social context and linguistic based features.

Location-based filters can be used to extract different writing styles and the use of specific vocabularies that may contain regionalisms, archaisms, or idioms. In some cases, these filters ca track events specific to geographic locations, or regional social behaviors such as traditions, fairs, or festivals.

Keyword search filters extract the top-k documents that are similar to the terms in the search query. These filters target specific subjects of interest for the analysis process. These filters, correlated with the other types of filters, can create a better view for understanding the user opinions regarding products or events, by applying OLAP operations on different dimensions.

The filter categories we discussed above are represented in our model by four constrains, c 1 to c 4 . These constrains are adapted to the models entities and attributes names and are as follows.

c 1 is AutorDimension.Gender = pGender with pGender the gender of the author.

c 2 is TimeDimension.Date ∈ [pStartDate, pEndDate], where pStartDate < pEndDate two given dates.

-c 3 is LocationDimension.X ∈ [ pStartX, pEndX] and LocationDimension.Y ∈ [pStartY, pEndY],
where pStartX < pEndX and pStartY < pEndY are the geo-location coordinates. c 4 is WordDimension.Word = pTerms where pTerms ∈ {t | t ∈ vocabulary } with vocabulary the set of words contained in the corpus.

There are many constrains combinations for the filter categories discussed above. But, we consider that the most representative constrains for detecting the vocabulary, user behavior, social context, events and opinions are the following: i) for top-k keywordsc 1 ,

c 1 ∧ c 2 , c 1 ∧ c 3 , and c 1 ∧ c 2 ∧ c 3 , and ii) for top-k documents -c 1 ∧ c 4 , c 1 ∧ c 2 ∧ c 4 , c 1 ∧ c 3 ∧ c 4 , and c 1 ∧ c 2 ∧ c 3 ∧ c 4 .
Eventually, let us emphasize that, in our workload model, filter values are given at execution time and the scores for extracting the top-k keywords and documents are computed in near-real-time. Our model can handle dataset modifications since weights are computed dynamically, therefore removing possible computation errors. This is an improvement over current information retrieval systems that compute weights only once, when the information is loaded in the database, thus incorporating errors if the ranking the data is modified throught inserts, updates or deletes.

TextBenDS Distributed Implementation

In this section, we describe the weighting schemes employed by TextBenDS, as well as the physical multidimensional implementation for Hive and Spark and its translation to the JSON format for MongoDB. Moreover, we present TextBenDS queries and discuss their implementation using HiveQL, Spark SQL and Dataframes and the JavaScript MapReduce implementation for MongoDB.

Weighting Schemes

A weighting scheme is used in Information Retrieval and Text mining as a statistical measure to evaluate how important a term is to a document in a collection or corpus. The importance increases proportionally to the number of times a term appears in the document but is offset by the frequency of the term in the corpus.

We employ two weighting scheme techniques. The first is the term frequency-inverse document frequency (TF-IDF) weighting scheme. It is often used as a central tool for scoring and ranking terms in a document.

Given a corpus of documents D = {d 1 , d 2 , ..., d N }, where N = |D| is the total number of documents in the dataset and n the number of documents where some term t appears. The TF-IDF weight is computed by multiplying the augmented term frequency

T F(t, d) = K + (1 -K) • ft,d max t ∈d ( f t ,d ) ) by the inverse document frequency IDF(t, D) = 1 + log N n , i.e., T FIDF(t, d, D) = T F(t, d) • IDF(t, D).
The augmented form of T F prevents a bias towards long documents when the free parameter K is set to 0.5 [START_REF] Paltoglou | A study of information retrieval weighting schemes for sentiment analysis[END_REF]. It uses the number of cooccurrences f t,d of a word in a document, normalized with the frequency of the most frequent term t , i.e., max t ∈d ( f t ,d ).

The second technique is Okapi BM25, a probabilistic weighting scheme for scoring and ranking documents. It is often used in Information Retrieval and Text mining because it incorporates the document length and the average document length in the corpus to eliminate bias towards long documents.

The Okapi BM25 weight is given in Equation ( 1), where ||d|| is d's length (i.e., the number of terms appearing in d), and avg d ∈D (||d ||) is the average document length used to remove bias towards long documents. The values of free parameters k 1 and b are usually chosen, in absence of advanced optimization, as k 1 ∈ [1.2, 2.0] and b = 0.75 [START_REF] Manning | Introduction to information retrieval[END_REF][START_REF] Jones | A probabilistic model of information retrieval: development and comparative experiments: Part 1[END_REF][START_REF] Jones | A probabilistic model of information retrieval: development and comparative experiments: Part 2[END_REF].

BM25(t, d, D) = T FIDF(t, d, D) • (k 1 + 1) T F(t, d) + k 1 • (1 -b + b • ||d|| avg d ∈D (||d ||) ) (1)
To extract top-k keywords, the overall relevance of a term t for a given corpus D is computed as the sum of all the TF-IDF (Equation ( 2)) or Okapi BM25 (Equation (3)) weights for that term.

S T K _T FIDF(t, D) = di∈D T FIDF(t, d i , D) (2)
S T K _BM25(t, D) = di∈D BM25(t, d i , D) (3)
TF-IDF and Okapi BM25 can be adapted to rank a set of documents based on the search query's terms appearing in each document. Given a search query Q = {q 1 , q 2 , ..., q m }, where m = |Q| is the number of terms contained in the query, a document d is scored by either summing all the TF-DIF (Equation ( 4)) or the Okapi BM25 (Equation ( 5)) scores for the query terms in the document.

S T D _T FIDF(Q, d, D) = qi∈Q T FIDF(q i , d, D) (4)
S T D _BM25(Q, d, D) = qi∈Q BM25(q i , d, D) (5)

Database Implementation

The conceptual multidimensional snowflake schema described in Section 3 can be directly translated into the database schema presented in Figure 2. This database schema is used in both Spark framework and Hive data warehouse.

Fig. 2: TextBenDS logical snowflake schema However, for MongoDB, we need to adjust it to a JSON representation. Thus, when translating the multidimensional snowflake schema into the MongoDB collection, each dimension becomes a nested document inside the same record. Figure 3 presents a document representation.

Query Description

To highlight the performance of the tested distributed data processing and analysis solutions, it is necessary to define a set of complex queries that use aggregation operations and efficiency of computing term weighting schemes. For TextBenDS, we defined two sets of queries. The first set looks for the top-k keywords using the two weighting schemes presented in Equations 2 and 3, while the second set of queries computes a document ranking scores and extract the top-k documents that are most similar to a search query using the functions based on TF-IDF and Okapi BM25 presented in Equations 4 and 5.

Top-k Keywords Queries Set

In the following paragraphs, we describe the queries from the first set that we used in TextBenDS.

Query Q 1 (Equation 6) computes the top-k keywords for a given gender that is filtered using the constraint c 1 . This query traverses the DocumentFacts, DocumentDimension, WordDimension, and AuthorDimension entities and uses two JOIN constraints between them: i) c 5 is the JOIN constraint between the DocumentFacts and the WordDimension Fig. 3: MongoDB document entities and ii) c 6 is the JOIN constraint between the DocumentFacts and the AuthorDimension entities. To limit the query to extract only the top-k results we use the constraint c tk . This query is the basis for all the other top-k keywords queries. 7) is a direct modification of Q 1 that filters the results by gender for a given time window. Besides the DocumentFacts, DocumentDimension, WordDimension, and AuthorDimension entities, Q 2 also traverses the TimeDimension by adding the JOIN constraint c 7 between DocumentFacts and TimeDimension entities. The filtering constraint on the TimeDimension is c 2 . 8) is also a direct modification of Q 1 , but this time the results are filtered by gender for a given geographic area. Q 2 traverses the LocationDimension by adding the JOIN constraint c 8 between DocumentFacts and LocationDimension entities.

Q 1 = σ ctk (γ L (π WordDimension.Word, fw (σ c1 (DocumentFacts c5 WordDimension c6 AuthorDimension)))) (6) Query Q 2 (Equation
Q 2 = σ ctk (γ L (π WordDimension.Word, fw (σ c1∧c2 (DocumentFacts c5 WordDimension c6 AuthorDimension c7 T imeDimension)))) (7) Query Q 3 (Equation
The other three entities from Q 1 with their respective JOIN constraint remain the same. For filtering the results for a given geographic area, the query uses the constraint c 3 .

Q 3 = σ ctk (γ L (π WordDimension.Word, fw (σ c1∧c3 (DocumentFacts c5 WordDimension c6 AuthorDimension c8 LocationDimension)))) (8)
Finally, Q 4 (Equation 9) is used to determine the top-k keywords for authors who have a given gender for a time window and a geographic area. This query traverses the DocumentFacts, DocumentDimension, WordDimension, AuthorDimension, TimeDimension, and LocationDimension entities. The constrains c 5 to c 8 are uses to JOIN the DocumentFacts with each dimension entity. Constraints c 1 to c 3 are employed to filter the results for a given gender, a time window given by two dates, and a geographic area given by the geo-location coordinates.

Q 4 = σ ctk (γ L (π WordDimension.Word, fw (σ c1∧c2∧c3 (DocumentFacts c5 WordDimension c6 AuthorDimension c7 T imeDimension c8 LocationDimension)))) (9)
In all four queries, f w is used to compute the weighting scheme using nested aggregation queries. To compute TF-IDF, we need to determine: i) the term frequency, ii) N the total number of documents in the corpus, and iii) n the number of documents where a term appears. The term-frequency is already known, as it is present in the DocumentFacts and can be extracted as follows T F(t, d) = DocumentFacts.T F. A nested query with the count aggregation function is used to compute N. This query takes into account the filters present in each of the four queries. To compute n, we just count how many times each a word appears given the constraints of each query

Q 1 to Q 4 .
For Okapi BM25, besides what we compute for the TF-IDF weighting, i.e. n, N, and T F(t, d), we also need the length of each document DL. To calculate the DL, a nested query is used to filter the data using the constrains of each query Q 1 to Q 4 . Then we use the aggregation function sum with the GROUP BY clause on the document's unique identifier. This function computes the document length by adding the number of appearances of each word in the document.

To determine the weights of each word, regardless of the weighting scheme, we use the aggregation operator γ L , where L = (F, G). The list of aggregation functions is given by L, while the set of attributes in the GROUP BY clause is given by G. The list of aggregation functions is F = {sum( f w )}, where the sum is the aggregation function that computes S T K _T FIDF(t, D) (Equation ( 2)). The set of attributes in the GROUP BY clause is G = {WordDimension.Word}.

Top-k Documents Queries Set

In top-k documents queries (in addition to top-k keywords queries), we add constraint c 4 to select the documents that contain the search terms in list Q.

Top-k documents query Q 1 (Equation 10) uses the same filters as top-k keywords Q 1 . In addition, we add another filter to retrieve only the documents matching a given search query Q. The search query filtering constraint is c 4 . Thus, query Q 1 determines the top-k documents for authors who have a given gender for a search query Q. 11) determines the top-k documents for a search query after filtering the records using constraints on the gender and a time window.

Q 1 = σ ctk (γ L (π DocumentFacts.ID_Document, fw (σ c1∧c4 (DocumentFacts c5 WordDimension c6 AuthorDimension)))) (10) Query Q 2 (Equation
Q 2 = σ ctk (γ L (π DocumentFacts.ID_Document, fw (σ c1∧c2∧c4 (DocumentFacts c5 WordDimension c6 AuthorDimension c7 T imeDimension)))) (11)
Query Q 3 (Equation 11) filters the results by the authors' gender and the geographic area, after using the terms in the search query to extract the relevant top-k documents.

Q 3 = σ ctk (γ L (π DocumentFacts.ID_Document, fw (σ c1∧c3∧c4 (DocumentFacts c5 WordDimension c6 AuthorDimension c8 LocationDimension)))) (12)
Finally, as in the case of the last top-k keywords query, query Q 4 (Equation 13) filters the results by the author's gender, a time window, and a geographic area and then extracts the top-k documents relevant to the search query.

Q 4 = σ ctk (γ L (π DocumentFacts.ID_Document, fw (σ c1∧c2∧c3∧c4 (DocumentFacts c5 WordDimension c6 AuthorDimension c7 T imeDimension c8 LocationDimension)))) (13)
The f w function is computed exactly as in the case of the top-k keywords queries, i.e. using nested aggregation queries. But, the aggregation operator γ L is different from the one in the top-k keywords, i.e., the grouping is done using the document unique identifier (G = {DocumentFacts.ID_Document}) and the list of aggregation function F = {sum( f w )}. To compute the hierarchy of documents with TF-IDF, we use the following formula sum( f w ) = S T D _T FIDF(Q, d, D) (Equation ( 4)), while for Okapi BM25 sum( f w ) = S T D _BM25(Q, d, D) (Equation ( 5)). Q represents the list of search terms, in both functions described above.

For Hive, we have implemented the queries using HiveQL (Hive Query Language) a SQL-live query language that uses implicitly MapReduce or Tez [START_REF] Saha | Apache tez: A unifying framework for modeling and building data processing applications[END_REF]. For Spark, the queries were implemented using Spark SQL together with Spark Dataframes [START_REF] Armbrust | Spark sql: Relational data processing in spark[END_REF]. For MongoDB, we implemented the queries using the native JavaScript language API using the MapReduce (MR) framework for all the queries. In the case of the top-k keywords queries that use the TF-IDF weighting scheme, we take advantage of the native database aggregation framework, i.e., the aggregation pipeline (AP).

Experiments

In this section, we first present TextBenDS's performance metrics and execution protocol. Second, we present the hardware architecture and the software configuration used for our benchmarking experiment. Third, we discuss the dataset, as well as the query complexity and selectivity. Forth, we present a comparison by data management distributed system and weighting scheme. Finally, we compare the runtime of these data management distributed system implementations w.r.t. the scale factor (S F) and weighting schemes.

Performance Metrics and Execution Protocol

For TextBenDS, we use as metric only the query response time. We note the response time for each query as t(Q i ) and t(Q i ) ∀i ∈ [START_REF] Agrawal | Sparkbench -a spark performance testing suite[END_REF][START_REF] Bellot | Report on inex 2013[END_REF]. All queries Q 1 to Q 4 and Q 1 to Q 4 are executed 10 times for both top-k keywords and top-k documents, which is sufficient according to the central limit theorem. Average response times and standard deviations are computed for t(Q i ) and t(Q i ). All executions are warm runs, i.e., either caching mechanisms must be deactivated, or a cold run of Q 1 to Q 4 and Q 1 to Q 4 must be executed once (but not taken into account in the benchmark's results) to fill in the cache. Queries must be written in the native scripting language of the target database system and executed directly inside said system using the command line interpreter.

Experimental conditions

All tests run on a cluster with 6 nodes running Ubuntu 16.04 x64, each with 1 Intel Core i7-4790S CPU with 8 cores at 3.20GHz, 16 GB RAM and 500GB HDD. The Hadoop ecosystem is running on Ambari and has the following configuration for the 6 nodes: 1 node acts as HDFS Name Node and Secondary Name Node, YARN Resource Manager, YARN Application Manager, the Hive Services and the Spark Driver and 5 nodes, each acting as HDFS Data Nodes and YARN Node Managers. YARN, Hive, Spark, Tez, and MapReduce Clients are installed on all the nodes.

The HDFS [START_REF] Shvachko | The hadoop distributed file system[END_REF] Name Node is a master node that stores the directory tree of the file system, file metadata, and the locations of each file in the cluster. The Secondary Name Node is a master node that performs housekeeping tasks and checkpointing on behalf of the Name Node. The HDFS Data Node is a worker node that stores and manages HDFS blocks on the local disk.

The YARN Resource Manager [START_REF] Vavilapalli | Apache hadoop yarn: Yet another resource negotiator[END_REF] is a master node that allocates and monitors available cluster resources (e.g., physical assets like memory and processor cores) to applications as well as handling scheduling of jobs on the cluster. The YARN Resource Manager is a master node that coordinates a particular application being run on the cluster as scheduled by the Resource Manager. The YARN Node Manager is a worker node that runs and manages processing tasks on an individual node as well as reports the health and status of tasks as they are running.

The Hive Services deal with the client interactions with Hive. The main component of Hive Sevices is the Hive Driver which processes all the requests from different applications to the Hive Metastore and The Hive File System for further processing. The Hive Metastore is the central repository of Apache Hive metadata. The Hive File System communicates with the Hive Storage which usually is built on top of HDFS.

The Hive Clients provide different drivers for communication with different types of applications. We use Tez as the Hive query execution engine. Tez [START_REF] Saha | Apache tez: A unifying framework for modeling and building data processing applications[END_REF] is an extensible framework for building high performance batch and interactive data processing applications coordinated by YARN that improves the MapReduce [START_REF] Dean | Mapreduce: Simplified data processing on large clusters[END_REF] paradigm by dramatically enhancing its speed, while maintaining MapReduce's ability to scale to petabytes of data.

The Spark Driver is the master node for the application and uses the Task Scheduler to launches task via cluster manager, i.e. YARN, and Directed Acyclic Graph (DAG) Scheduler used to divide operators into stages of tasks. The Spark Clients are the worker nodes.

For the MongoDB tests, we used the same cluster infrastructure with the following specifications: 1 node with the MongoDB Configuration Server and MongoDB Shard Server (mongos) and 5 nodes with MongoDB shards. The MongoDB Configuration Server stores the metadata for a sharded cluster. This metadata reflects state and organization for all data and components within the sharded cluster. The MongoDB Shard Server is a routing service for the MongoDB shard configurations. It processes queries from the application layer, and determines the location of this data in the sharded cluster, in order to complete these operations.

The number of Spark executors was fixed to 16 with one vnode and 3GB memory each for the Spark experiments. Moreover, we use the Spark SQL and Dataframes libraries for the Spark experiments together with the Scala programming language. The Hive Server Heap Size and the Hive Metastore Heap Size are both set to 2GB each, while the Hive Client Heap Size is set to 1G. Each reducer can process 1GB of data at a time. The dataset is stored on HDFS for both Hive and Spark experiments under the ORC format.

The code of all Hive queries and Scala code for the Spark experiments, together with benchmarking results, are available on Github 1The query parameterization is provided in Table 1.

Dataset

The experiments are done on a 2 500 000 tweets corpus. The initial corpus is split into 5 different datasets equally balanced between the number of tweets for gender, location, and date. These datasets contain 500 000, 1 000 000, 1 500 000, 2 000 000, and 2 500 000 tweets, respectively. They allow scaling experiments and are associated to a scale factor (S F) parameter, where S F ∈ {0.5, 1, 1.5, 2, 2.5}.

Query selectivity

Selectivity, i.e., the amount of retrieved data (n(Q)) w.r.t. the total amount of data available (N), depends on the number of attributes in the WHERE and GROUP BY clauses. The selectivity formula used for a query Q is S (Q) = 1 -n(Q) N . TextBenDS's queries traverse the DocumentFacts, WordDimnesion, and AuthorDimension relationships.

All queries filter by gender, to determine the trending words for female (F) and male (M) users. Starting from Q 1 , subsequent queries Q 2 to Q 4 are built by decreasing selectivity (Table 2). Moreover, by adding a constraint on the location in Q 3 and Q 4 , the query complexity also changes. Table 3 presents the selectivity for the top-k documents. Compared to top-k keywords, the selectivity for queries Q 1 to Q 4 decreases even more by adding a condition on the words attribute for all the queries. Table 3: Top-k documents selectivity for 3 search terms

Table 2: Top-k keywords query selectivity

SF Q 1 (M) Q 1 (F) Q 2 (M) Q 2 (F) Q 3 (M) Q 3 (F) Q 4 (M) Q 4 (F) 0.
SF Q 1 (M) Q 1 (F) Q 2 (M) Q 2 (F) Q 3 (M) Q 3 (F) Q 4 (M) Q 4 (F) 0.

Query complexity

Complexity relates to the number of traversals involved in the query. Query complexity depends on the number of relationship and entity traversals. Independently from any weighting scheme, all the queries traverse the DocumentFacts, DocumentDimension, WordDimension, AuthorDimension in order to determine the top-k keywords and documents. Regardless of the query, we will call these traversals the "main part" of the query Q M .

To compute the top-k keywords using TF-IDF, we need a new query, Q nD , that determines the number of documents. This query is used in the projection section of each query. The base of Q nD traverses DocumentFacts and AuthorDimension and is used in the projection section of Q M . To compute the top-k keywords using Okapi BM25, another query is added, Q DL , which determines the document length. This query traverses the

Q 1 Both Q M × × TF-IDF Q nD × × Okapi BM25 Q DL × × Q 2 Both Q M × TF-IDF Q nD × Okapi BM25 Q DL × Q 3 Both Q M × TF-IDF Q nD × Okapi BM25 Q DL × Q 4 Both Q M TF-IDF Q nD Okapi BM25 Q DL
DocumentFacts and AuthorDimension and it needs to be traversed in Q M . Table 4 presents the dimensions traversed and the nested queries required to compute the top-k keywords. Table 5 present the queries complexity for the top-k keywords. The complexity of each query adds to that of Q 1 the number of traversals presented in Table 4. As expected, Q 4 has the highest complexity. As Q D L is also traversed in Q M when using Okapi BM25, there is a difference of 1 between the two weighting schemes.

Table 5: Query complexity for top-k keywords

Q 1 Q 2 Q 3 Q 4 TF-IDF 3 5 5 7 Okapi BM25 4 6 6 8
To compute the top-k documents, in addition to the top-k keywords queries, Q nD for TF-IDF and Q DL for Okapi BM25, we use the Q nW query that computes the number of words for each document. This query is needed for both weighting schemes and traverses the DocumentFacts and AuthorDimension. The relationship obtained by Q nW query is traversed in the main part of each Q M query. Q nD query is used in the projection section of each query in order to determine the top-k documents using TF-IDF, whereas if we want to determine the top-k documents using Okapi BM25, Q DL query needs to be traversed in Q M . Table 6 presents the dimensions traversed and the nested queries required to compute the top-k documents.

When using TF-IDF with Q 1 query, only the results obtained by Q nW need to also be traversed in Q M . Q D L, beside computing the length of each document, is also used to count the number of documents in the projection section of Q M .

For the Okapi BM25, both Q nW and Q D L are traversed in Q M , thus increasing the complexity by 1. For Q 2 and Q 3 the TimeDimension and LocationDimension relationships need to be traversed in Q M , Q nW , and Q D L, thus increasing the complexity of Q 1 by 3. For Q 4 both the TimeDimension and LocationDimension relationships need to be traversed in Q M , Q nW , and Q D L, thus increasing the complexity of Q 1 by 6.

The queries complexity for top-k documents is presented in Table 7.

Q 1 Both Q M × × Both Q nW × × TF-IDF Q nD × × Okapi BM25 Q DL × × Q 2 Both Q M × Both Q nW × TF-IDF Q nD × Okapi BM25 Q DL × Q 3 Both Q M × Both Q nW × TF-IDF Q nD × Okapi BM25 Q DL × Q 4 Both Q M Both Q nW TF-IDF Q nD Okapi BM25 Q DL Table 7: Query complexity for top-k documents Q 1 Q 2 Q 3 Q 4 TF-IDF 5

Weighting Scheme Comparison

Figure 4 presents a performance comparison depending on the deployed distributed data management system and weighting scheme for retrieving top-k keywords w.r.t. scale factor S F. Whereas Figure 5 presents a similar performance comparison for top-k documents. These comparisons use only MongoDB's MR query implementation for both top-k keywords and documents, as there is no AP implementation that uses Okapi BM25.

In the following paragraphs we analyze the results for each of the proposed distributed platforms.

Hive

For Hive, computing the top-k keywords with TF-IDF is faster than computing them with Okapi BM25 (Figure 4a) with a factor between 1.2x and 1.4x. This is applicable for all queries, regardless of S F. The difference in performance between the weighting schemes are almost the same for each query w.r.t. S F. The biggest difference in runtime between TF-IDF and Okapi BM25 is for query Q 1 , while the smallest is obtained for query Q 4 because of its higher selectivity. The difference in performance between the two weighting schemes is directly impacted by the query selectivity, complexity and the S F. Moreover, this difference is also impacted by the computational complexity of the weighting schemes.

For calculating the top-k documents, TF-IDF runtime is smaller than Okapi BM25 (Figure 5a). As in the case of top-k keywords, the gap between the two weighting schemes increases with S F, which directly impacts each query's selectivity. The biggest gap in runtime between TF-IDF and Okapi BM25 can be observed in the case of Q 1 and Q 3 queries, while the smallest is obtained for Q 2 and Q 4 queries. In conclusion, the performance

Spark

For the Spark environment, computing top-k keywords with TF-IDF in comparison with Okapi BM25 is faster (Figure 4b), although the differences in runtime performance are even lower than the Hive setup. The performance is directly influenced by the framework and by how fast the resources are allocated to the worker nodes by the YARN resource manager. Thus, resource allocation latency also increases the standard deviation measured for each experiment.

The same pattern is obtained when calculating the top-k documents. It must be mentioned that in this case, using TF-IDF is faster than using Okapi BM25 with a factor of approximately 1.1x (Figure 5b). Likewise, all queries have almost the same runtime differences, regardless of S F, complexity and selectivity. This is a direct impact of the application containers created by YARN, as they are created at the beginning of the application execution and the resources are fully allocated before running any job. Furthermore, Spark optimizes the computation through the Directed Acyclic Graph (DAG) execution engine that uses lazy evaluation for each tasks.

TF-IDF (Q 1 -male) TF-IDF (Q 1 -female) Okapi BM25 (Q 1 -male) Okapi BM25 (Q 1 -female) TF-IDF (Q 2 -male) TF-IDF (Q 2 -female) Okapi BM25 (Q 2 -male) Okapi BM25 (Q 2 -female) TF-IDF (Q 3 -male) TF-IDF (Q 3 -female) Okapi BM25 (Q 3 -male) Okapi BM25 (Q 3 -female) TF-IDF (Q 4 -male) TF-IDF (Q 4 -female) Okapi BM25 (Q 4 -male) Okapi BM25 (Q 4 -female) (

MongoDB

The last proposed scenario uses MongoDB and MapReduce as distributed platform.

When computing the top-k keywords, the runtime increases with a factor between 2x and 3x for Okapi BM25 as opposed to TF-IDF. The largest performance gap is obtained for Q 1 and Q 3 queries, while the smallest is obtained for Q 2 and Q 4 queries. These performance outcomes are directly influenced by the intermediate "Sort and Shuffle" phase of the MapReduce algorithm. In this step all the results from all the Map functions are sorted and concatenated by key and sent to the Reducer functions to be aggregated. During this step, the shuffler component redistribute data based on the output keys which introduces additional computations, thus increasing the runtime.

When computing top-k documents with MongoDB, the runtime gap between the two schemes is greatly reduced. Although, the difference in execution times is small for the same S F when computing top-k documents with TF-IDF than Okapi BM25. These results are directly influenced by i) the queries' selectivity, i.e. the number of results returned by the tok documents queries is small compared to top-k keywords, and ii) MongoDB's schemaless and flexible data model, i.e., JOIN operations and labels with no information are eliminates using this model.

Database Implementation Comparison

The following set of experiments analysis the time performance of the different database implementations w.r.t. S F and weighting schemes for the top-k keywords and documents queries. Hive has the overall worst runtime for all queries. In comparison, Spark has a constant execution time regardless of S F. Whereas, with the increases of S F, the runtime gap decreases between Spark and Hive by a factor between 2x and 1.8x for all queries. This runtime gap can be explained by the fact that Hive uses Tez as query execution engine while Spark uses direct in-memory data processing. Tez is built on Hadoop MapReduce and relies extensively on HDFS, thus with the number of I/O operations the execution time increases. Spark's runtime performance is directly influenced by the chosen planning policy of the YARN resource manager, and implicitly by how the resources are allocated for each task.

The MongoDB distributed setup has the overall best runtime when using the TF-IDF weighting scheme for top-k keywords. For data aggregation, MongoDB provides a native aggregation framework, i.e, Aggregation Pipeline (AP), or the general framework MapReduce (MP). MP functionality offers more flexibility than the AP framework, but AP is optimized to work with data processing pipelines to increase query runtime performance. Thus, the best performance is obtained when using the MongoDB with AP. Whereas, when using MongoDB with MR, the time performance decreases by a factor of 2 for Q 2 and Q 4 queries (Figures 6b and6d) and by a factor of 3 for Q 1 and Q 3 queries (Figures 6a and6c).

Although MongoDB MR has a better execution time than Spark's, the gap disappears for query Q 1 and a larger S F (Figure 6a). This trend may be a consequence of the resource allocation policies used by the two systems.

Top-k keywords using Okapi BM25

Figure 7 presents a comparison of the obtained results for each query when computing the top-k keywords with Okapi BM25.

For the MongoDB setup we use only the MR framework, as the Okapi BM25 implementation for the AP framework is not possible due to the complexity of implementing the nested queries used by the weighting function.

Hive has the worst performance for Q 2 , Q 3 and Q 4 queries. Likewise, the performance slightly decreases for Q 2 (Figure 7b) and Q 4 (Figure 7d) queries, with the increase of S F.

For this set of experiments, Spark's runtime remains again constant. MongoDB obtains the overall best performance for Q 2 (Figure 7b) and Q 4 (Figure 7d) queries. For these two queries, the execution time is decreased by a factor of 2x in comparison with Spark and by a factor of 4x in comparison with Hive. Moreover, for these two queries the runtime is almost constant when changing the S F factor. As for Q 1 query, the runtime worsens with the increase of S F (Figure 7a) to the point where it is lower than the performance of Hive. Ultimately, for Q 3 query with a small S F, MongoDB has the best execution time, but with increasing the S F factor, the performance gets worse to the point that is outperformed by the Spark runtime. These results are a direct influence by the horizontal sharding policies used for distributing the data between the nodes. We used as Sharding Key the unique record identifier, thus on some shards the distribution of data for the constrains is higher that on other shards. This distribution directly influences the workload on each node and ultimately the overall query performance.

Top-k documents using TF-IDF

The results obtained when computing the top-k documents with TF-IDF are presented in Figure 8.

Hive has the overall worst runtime between the tested systems. The decrease of performance while increasing the S F factor follows the same pattern for all queries. Likewise, by increasing S F, the execution time decreases by a factor of 2x in comparison with Spark.

Spark's runtime is again almost constant for all queries.

In comparison with the other systems, MongoDB has the best overall runtime, as well as maintaining a constant execution time. Moreover, with the increase of S F, the execution time decreases by a factor of 4x in comparison with Spark and by a factor of 8x in comparison with Hive. As in the previous set of tests (Subsection 5.5.2), this is a direct impact of the sharding policies. The same runtime patterns emerge when computing the top-k documents with Okapi BM25 as in the case of using the TF-IDF weighting scheme. The results are presented in Figure 9.

Hive has again the overall worst performance. The execution time decreases by a factor of 2x in comparison with Spark while increasing S F for all queries.

Likewise, we obtain the same pattern for Spark's runtime. The overall execution time is almost constant regardless of S F. This constant performance is due to the initialization step of the Spark Context. Moreover, the resource allocation done by YARN also influence the runtime performance.

The best overall performance is again achieved by MongoDB. Moreover, we observe that with increasing S F, the execution time is almost constant for all queries. This constant performance is influenced by the distribution of the data on shards and how the MapReduce tasks handles them.

Conclusion

In this paper, we present our distributed benchmark solution for any type of textual data -TextBenDS. Our benchmark tests the computation efficiency of term weighting schemes. These weights are computed using data sampling methods and aggregation queries. Data sampling enables analysis based on gender, location, and time to extract general linguistic and social context features, while aggregation queries compute dynamically the weighting The experiments done on different distributed systems prove that TextBenDS is adequate for structured, semi-structured, and unstructured textual data. Furthermore, our solution proves its portability, scalability, and relevance by its design.

We proved that our solution is portable, as it works on multiple distributed systems. For this purpose, we compare the performance of several such systems, e.g. Hive -a distributed DBMS, Spark -a distributed framework using a relational approach, and MongoDB -a document-oriented DBMS. TextBenDS tests employ two different weighting schemes (TF-IDF and Okapi BM25) for processing top-k keywords and documents.

To demonstrate the scalability of our solution, we introduced S F, the scaling factor that introduces an incremental growth in the data volume for our experiments. The queries complexity together with S F produces a linear increase in runtime for Hive and MongoDB, while Sparks displays a constant execution time.

Another important property of TextBenDS is its relevance in performance analysis and text mining. This is proven by the fact that our solution analysis the runtime performance for ranking keywords and documents, techniques widely used in various text analystics and retrieval tasks.

As expected, computing the top-k keywords with TF-IDF is generally faster than with Okapi BM25, regardless of the deployed distributed system. However, the difference in performance between TF-IDF and Okapi BM25 diverge from one system to another. When using Hive, this performance gap between the two weighting schemes is between 1.2x and 1.4x. Instead, for Spark the gap is diminishing up to a factor of 1.1x or less. This is largely due to how fast the resources are allocated to the worker nodes by the Spark's resource manager. However, the largest performance gap for computing the top-k keywords In this case the runtime increases with a factor between 2x and 3x. We deduced that these performance outcomes are directly influenced by the intermediate "Sort and Shuffle" phase of the MapReduce algorithm.

For the next set of experiments, focused on computing the top-k documents, the performance gap between TF-IDF and Okapi BM25 is decreasing for all of the deployed distributed systems. The smallest difference is found in running with Spark and MongoDB, where the runtime gap reaches a factor of 1.1x, and even 1x.

As an analysis of the overall performance of the three distributed systems, it resulted that the best outcomes are obtained in some cases by MongoDB with MapReduce, and in other cases by Spark.

Although we evaluate TextBenDS on social media data, our benchmark is generic and can be used on any textual data enhanced with metadata extracted through preprocessing and Natural Language Processing techniques, e.g., part-of speech tagging, lemmatization, hashtag extraction, etc.

As future work, we plan to improve the scalability of our solution by designing sampling strategies and aggregation queries. The sampling methods will include constraints on tags and named entities while boosting the performance by lowering the query selectivity and complexity. Furthermore, we plan to expand TextBenDS's dataset significantly to achieve a big data-scale volume. Moreover, we considered in this paper TF-IDF and Okapi BM25 for machine learning tasks. The next version of our benchmark should include other weighting schemes, such as KL-divergence [START_REF] Raiber | Kullback-leibler divergence revisited[END_REF], to further improve the relevance of our solution.

Fig. 1 :

 1 Fig. 1: TextBenDS conceptual data model

Fig. 4 :

 4 Fig. 4: Top-k keywords: TF-IDF vs. Okapi BM25 comparison

Fig. 5 :

 5 Fig. 5: Top-k documents: TF-IDF vs. Okapi BM25 comparison

5. 5 . 1

 51 Figure 6 presents the results' comparison for each query when computing the top-k keywords with TF-IDF.Hive has the overall worst runtime for all queries. In comparison, Spark has a constant execution time regardless of S F. Whereas, with the increases of S F, the runtime gap decreases between Spark and Hive by a factor between 2x and 1.8x for all queries. This runtime gap can be explained by the fact that Hive uses Tez as query execution engine while Spark uses direct in-memory data processing. Tez is built on Hadoop MapReduce and relies extensively on HDFS, thus with the number of I/O operations the execution time increases. Spark's runtime performance is directly influenced by the chosen planning policy of the YARN resource manager, and implicitly by how the resources are allocated for each task.The MongoDB distributed setup has the overall best runtime when using the TF-IDF weighting scheme for top-k keywords. For data aggregation, MongoDB provides a native aggregation framework, i.e, Aggregation Pipeline (AP), or the general framework MapReduce (MP). MP functionality offers more flexibility than the AP framework, but AP is optimized to work with data processing pipelines to increase query runtime performance. Thus, the best performance is obtained when using the MongoDB with AP. Whereas, when using MongoDB with MR, the time performance decreases by a factor of 2 for Q 2 and Q 4 queries (Figures6b and 6d) and by a factor of 3 for Q 1 and Q 3 queries (Figures6a and 6c).Although MongoDB MR has a better execution time than Spark's, the gap disappears for query Q 1 and a larger S F (Figure6a). This trend may be a consequence of the resource allocation policies used by the two systems.

Fig. 6 :

 6 Fig. 6: TF-IDF: Top-k keywords query comparison

Fig. 7 :

 7 Fig. 7: Okapi BM25: Top-k keywords query comparison

  schemes and ranking functions. The experiments done on different distributed systems prove that TextBenDS is adequate for structured, semi-structured, and unstructured textual data. Furthermore, our solution proves its portability, scalability, and relevance by its design.We proved that our solution is portable, as it works on multiple distributed systems. For this purpose, we compare the performance of several such systems, e.g. Hive -a distributed DBMS, Spark -a distributed framework using a relational approach, and MongoDB -a document-oriented DBMS. TextBenDS tests employ two different weighting schemes (TF-IDF and Okapi BM25) for processing top-k keywords and documents.To demonstrate the scalability of our solution, we introduced S F, the scaling factor that introduces an incremental growth in the data volume for our experiments. The queries complexity together with S F produces a linear increase in runtime for Hive and MongoDB, while Sparks displays a constant execution time.Another important property of TextBenDS is its relevance in performance analysis and text mining. This is proven by the fact that our solution analysis the runtime performance for ranking keywords and documents, techniques widely used in various text analystics and retrieval tasks.As expected, computing the top-k keywords with TF-IDF is generally faster than with Okapi BM25, regardless of the deployed distributed system. However, the difference in performance between TF-IDF and Okapi BM25 diverge from one system to another. When using Hive, this performance gap between the two weighting schemes is between 1.2x and 1.4x. Instead, for Spark the gap is diminishing up to a factor of 1.1x or less. This is largely due to how fast the resources are allocated to the worker nodes by the Spark's resource manager. However, the largest performance gap for computing the top-k keywords

Fig. 9 :

 9 Fig. 9: Okapi BM25: Top-k documents query comparison

Table 1 :

 1 Query parameter values

	Parameter	Value
	pGender	{male, f emale}
	pStartDate	2015-09-17 00:00:00
	peEndDate	2015-09-18 00:00:00
	pStartX	20
	pEndX	40
	pStartY	-100
	pEndY	100
	pWords	{think, today, f riday}

Table 4 :

 4 Top-k keywords dimension traversals

	Query	Weighting Scheme	Nested Queries	Traversed Relationships TimeDimension LocationDimension

Table 6 :

 6 Top-k documents dimension traversals

	Query	Weighting Scheme	Nested Queries	Traversed Relationships TimeDimension LocationDimension

Source code https://github.com/cipriantruica/T2K2D2_Hadoop