Shared dictionary compression in publish/subscribe systems

Christoph Doblander, Tanuj Ghinaiya, Kaiwen Zhang, Hans-Arno JacobsenDEBS 2016 · DOI

TL;DR

This paper introduces Shared Dictionary Compression (SDC) for publish/subscribe (pub/sub) systems to significantly reduce bandwidth usage, especially crucial for mobile environments. They propose a novel "sampling broker" architecture and an adaptive algorithm to manage dictionaries efficiently, demonstrating substantial bandwidth savings over traditional compression methods like Deflate.

What Problem Does This Paper Address?

Publish/subscribe (pub/sub) systems are widely used for efficient data dissemination, particularly for mobile applications receiving notifications. However, the bandwidth consumed by these notifications can be substantial, especially in metered mobile data plans or areas with limited connectivity. While general compression techniques like GZip or Deflate offer some savings, they don't fully exploit the inherent redundancy between successive messages in pub/sub. This paper tackles the challenge of further reducing this bandwidth overhead by employing Shared Dictionary Compression (SDC) within the pub/sub framework, a technique that has shown promise in other domains but hasn't been specifically adapted for pub/sub.

Methods

The core of the proposed solution, dubbed Simple SDC for pub/sub (SSPS), involves several key innovations:

  • Sampling Brokers (SBs): A new class of brokers responsible for generating and maintaining dictionaries. These SBs subscribe to topics, accumulate notifications in a ring buffer, and use a hash function to create a dictionary from this data.
  • Caching Service (CS): A fault-tolerant mechanism to store dictionaries, allowing new subscribers and publishers to acquire them efficiently.
  • Adaptive Dictionary Maintenance: An algorithm that dynamically decides when to create a new dictionary or prolong the life of an existing one. It estimates the potential bandwidth reduction (BR) and calculates an amortization time to ensure the cost of spreading a new dictionary is justified. This algorithm also adapts parameters like dictionary size multiplier and buffer size for future dictionary creation.
  • Shared Dictionary Compression (SDC): The underlying compression technique. Unlike sliding-window methods (like Deflate) that exploit redundancy within a fixed window, SDC leverages common patterns across a larger set of messages by creating a dictionary. This dictionary is then used to represent recurring data segments with shorter codes. The paper uses the FemtoZip library for SDC implementation.

Datasets

The paper evaluates their approach using several real-world datasets to capture varying degrees of redundancy:

  • DEBS 2015 Grand Challenge dataset: Contains taxi trip records from NYC, used to simulate a mobile application scenario. This dataset was converted into CSV, JSON, XML, and Google Protobuf formats to study the impact of different data representations.
  • Twitter dataset: Acquired from the Twitter API, including both tweet content and metadata. This dataset is characterized by highly variable text.
  • NYC Open Data Portal (Air Quality dataset): Represents an IoT dataset with numerous sensor readings.
  • European Power Exchange (EPEX) dataset: Extracted from energy spot market auctions, containing mostly numbers and repetitive information.

No new benchmarks were introduced; instead, existing datasets were utilized to evaluate the proposed SDC approach against Deflate.

Key Insights and Ideas

  • SDC's Advantage in Pub/Sub: The paper convincingly argues that SDC can achieve significantly higher bandwidth savings than traditional methods like Deflate because pub/sub often exhibits more consistent redundancy across messages (e.g., repeated metadata in sensor data or common phrases in social media) than what's found within a small sliding window.
  • The "Sampling Broker" Concept: Introducing dedicated brokers for dictionary management is a practical and effective way to offload the computational burden of SDC from publishers and subscribers, making it more feasible for resource-constrained devices.
  • Adaptive Maintenance is Crucial: The adaptive algorithm is key to balancing the overhead of dictionary creation and dissemination against the bandwidth savings. It prevents unnecessary dictionary updates and ensures that SDC is only applied when it's truly beneficial.
  • Format Independence: A surprising finding is that SDC shows similar bandwidth savings across different data formats (JSON, XML, Protobuf) for datasets like DEBS15. This is attributed to the shared schema and attribute combinations being promoted to the dictionary, making the choice of format less critical for compression efficiency.

Key Results

  • Significant Bandwidth Reduction: The paper demonstrates substantial bandwidth savings, with SDC achieving up to 88% reduction on the DEBS15-XML dataset, compared to 53.3% for Deflate. Other datasets also show considerable improvements, often exceeding 20-40% additional savings over Deflate.
  • Amortized Overhead: While SDC introduces overhead for dictionary creation and dissemination, the adaptive algorithm and the nature of pub/sub data allow this overhead to be amortized over many compressed messages, leading to a net bandwidth gain.
  • Computational Trade-off: Compression time scales linearly with dictionary size, while decompression is constant time. The adaptive algorithm aims to find a sweet spot that maximizes bandwidth savings without incurring prohibitive computational costs.
  • Latency Improvements: In a real-world MQTT experiment on a 2G network, the SDC approach showed significant reductions in end-to-end latency, particularly in higher percentiles, which is critical for responsive mobile applications.
  • Throughput Gains: The paper shows that sending compressed messages with SDC can be up to 40% faster than sending uncompressed messages, even when accounting for dictionary transmission.

Limitations and Future Work

  • Dedicated Sampling Brokers: The current SSPS design relies on dedicated sampling brokers. The authors acknowledge that this is a simplistic assumption for dynamic cloud environments and suggests future work could explore more distributed or integrated approaches.
  • Fixed Rate Assumption: The current adaptive algorithm uses pessimistic assumptions about amortization time due to variations in data rates. Future work could explore publishing new dictionaries when the rate is low.
  • Content-Based Pub/Sub: For content-based pub/sub, maintaining multiple active dictionaries per topic might be beneficial, depending on subscription predicates.
  • Scheduling and Optimization: In large-scale systems, scheduling dictionary sampling and optimizing for mobile subscribers are areas for further research.
  • Iterative Sampling: The current batch-mode dictionary sampling could be improved with incremental algorithms to reduce load spikes.
  • Database Integration: The authors suggest combining SDC with databases, potentially reusing dictionaries for compression and query optimization.
  • Overlay Bandwidth: An alternative approach could focus on reducing bandwidth between brokers rather than end-to-end, which might be beneficial for data center replication.

Summary updated

BibTeX
@inproceedings{doblander2016shared,
  author = {Christoph Doblander and Tanuj Ghinaiya and Kaiwen Zhang and Hans-Arno Jacobsen},
  title = {{Shared dictionary compression in publish/subscribe systems}},
  booktitle = {DEBS},
  year = {2016},
  doi = {10.1145/2933267.2933308},
}

Loading related content...

Figure