Real-time Log Query Interface for large datasets using Apache Spark

Sandeep Sandha, Xin Xu, Yue Xin, Zhehan LiarXiv 2017

Abstract

Researchers analyzing mobile network protocols often encounter a "black box" problem where massive amounts of low-level cellular data are collected but remain difficult to access efficiently. This paper introduces a high-performance, web-based log query interface that replaces traditional, slow relational database workflows with a distributed Apache Spark backend. By utilizing a persistent "warm" Spark shell and in-memory caching, the system achieves sub-second query response times for datasets that previously required minutes to process, representing a nearly 100x performance improvement.

Introduction

The collection of mobile network logs, facilitated by tools like MobileInsight, has opened new avenues for cellular protocol research. However, the sheer volume of this data—often exceeding 245 GB—creates a significant bottleneck. Traditional methods requiring SSH access and raw SQL execution on relational databases like MySQL are both inaccessible to non-experts and prohibitively slow for large-scale aggregations. There is a clear need for a "friendly" interface that provides the speed of distributed computing without the overhead of cluster management.

System Architecture

The proposed system architecture is organized into three distinct layers to balance usability with high-performance data processing:

  1. Web Frontend: A user-friendly interface built with HTML5 and jQuery. It allows researchers to select from query templates or write custom SQL, abstracting away the complexities of terminal navigation.
  2. Core Service (Java Server): This layer acts as a secure middleman, validating user queries to prevent SQL injection and managing communication between the frontend and the backend data servers.
  3. Spark Server: The computational engine responsible for executing queries across a distributed cluster.
System Architecture Overview

Distributed Query Engine

The core innovation of this interface is the implementation of a persistent, interactive Spark shell within the Spark Server. Unlike standard Spark jobs that incur significant startup latency for resource allocation and executor initialization, this "warm" shell remains active to handle incoming queries immediately.

Spark Cluster and Master-Slave Architecture

The system leverages Spark SQL and DataFrames to distribute workloads across multiple slave nodes. Crucially, the implementation employs in-memory caching, keeping the dataset in RAM across the cluster to eliminate slow disk reads during repeated queries.

Performance Evaluation

The system was evaluated using a 6 GB subset of MobileInsight logs. The performance of the Spark-based cluster (with caching) was compared against a traditional single-node MySQL setup across various query types.

Query Type MySQL (Single Node) Spark (Cluster + Cache)
Count (6GB table) 60.0 seconds 0.64 seconds
Join (Complex) 65.0 seconds 0.99 seconds

The results demonstrate a 65x to 93x speedup for complex operations. While MySQL maintains a slight edge for trivial queries on very small tables (e.g., 2 MB) due to minimal coordination overhead, the Spark-based system is vastly superior for the "big data" scales typical of network research.

Conclusion

The developed interface successfully democratizes access to large-scale network logs by hiding the complexities of Spark master/slave configurations and Scala scripting behind a simple web interface. Future work will focus on supporting real-time data ingestion from multiple devices and optimizing cache management strategies to ensure data freshness without compromising the sub-second response times achieved in this study.

Summary updated

BibTeX
@misc{sandha2017real,
  author = {Sandeep Sandha and Xin Xu and Yue Xin and Zhehan Li},
  title = {{Real-time Log Query Interface for large datasets using Apache Spark}},
  year = {2017},
  eprint = {1709.08001},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1709.08001},
}
Figure