Detecting Duplicates over Sliding Windows with RAMEfficient Detached

  • Slides: 22
Download presentation
Detecting Duplicates over Sliding Windows with RAMEfficient Detached Counting Bloom Filter Arrays Jiansheng Wei†,

Detecting Duplicates over Sliding Windows with RAMEfficient Detached Counting Bloom Filter Arrays Jiansheng Wei†, Hong Jiang‡, Ke Zhou† , Dan Feng†, Hua Wang† †School of Computer, Huazhong University of Science and Technology, Wuhan, China Wuhan National Laboratory for Optoelectronics, Wuhan, China ‡Dept. of Computer Science and Engineering, University of Nebraska-Lincoln, NE, USA

Background and Motivation § Duplicate detection is an important technique for monitoring and analysing

Background and Motivation § Duplicate detection is an important technique for monitoring and analysing data streams. Ø Recent studies estimate that about 294 billion emails are sent per day all over the world in 2010 [1] and around 89. 1% of them are spam emails [2]. Ø If all the emails must be scanned for the purposes of anti-spam, antivirus or homeland security, it is important for the email server to quickly identify duplicates and analyse only unique emails. § Since the real-world data streams can be updated frequently and grow to very large sizes, it is impractical to trace and analyse all the elements in such data streams. [1] The Radicati Group, Inc. (2010) Email Statistics Report, 2010 -2014. [2] Symantec Corp. (2010) Message. Labs Intelligence: 2010 Annual Security Report. 2011 -7 -29 2

Background and Motivation § Existing approaches usually employ a decaying window model to evict

Background and Motivation § Existing approaches usually employ a decaying window model to evict stale items and record the most recent elements. Ø Landmark Window Model Ø Jumping Window Model Ø Sliding Window Model 2011 -7 -29 The challenge is how to design a membership representation scheme that supports fast search, insertion and deletion of time-ordered elements with low RAM consumption. 3

Background and Motivation § § To achieve high space efficiency and maintain high query

Background and Motivation § § To achieve high space efficiency and maintain high query performance, Bloom filters (BFs) have been widely used to represent membership of static data sets. A BF for representing a static set S = {e 1, e 2, …, en} of n elements consists of an array of m bits and a group of k independent hash functions h 1, …, hk with the range of {1, …, m}. Fig. 1 Insert elements into a Bloom filter. False positive: y is probably a member; No false negative: z is definitely not a member. Fig. 2 Query a Bloom filter. § 2011 -7 -29 A BF faces challenges when dealing with a dynamic set, i. e. , it does not support element deletion. 4

Outline § § 2011 -7 -29 Background and Motivation The DCBA Scheme Analysis and

Outline § § 2011 -7 -29 Background and Motivation The DCBA Scheme Analysis and Evaluation Conclusions 5

The DCBA Scheme § A detached counting Bloom filters array (DCBA) consists of an

The DCBA Scheme § A detached counting Bloom filters array (DCBA) consists of an array of detached counting Bloom filters (DCBFs) that are homogeneous and share the same hash functions. § A DCBF is a Bloom filter (BF) with each of its being associated with a counter, which functions as a timer to record the timestamp of the represented element. § All the timers of a DCBF are further grouped into a timer array (TA) to improve the access efficiency. 2011 -7 -29 6

The DCBA Scheme § A window with size N slides over a data stream,

The DCBA Scheme § A window with size N slides over a data stream, and all the monitored elements are represented by an array of g DCBFs with each having a capacity of N/(g− 1) elements. Fig. 3 Using DCBA to represent a sliding window in a single node. 2011 -7 -29 7

The DCBA Scheme § § The g DCBFs logically function as a circular FIFO

The DCBA Scheme § § The g DCBFs logically function as a circular FIFO queue. Fully-filled DCBFs will be retained for query only until its elements become stale, and the corresponding timer array (TA) that can consume a great amount of memory space may be optionally offloaded to hard disks or flash store to save RAM resources. Fig. 3 Using DCBA to represent a sliding window in a single node. 2011 -7 -29 8

The DCBA Scheme § A DCBA can also be split and maintained by r

The DCBA Scheme § A DCBA can also be split and maintained by r nodes, where each node holds a group of g DCBFs. All the r×g DCBFs logically function as a circular FIFO queue, and there is a filling DCBF and a decaying DCBF to accommodate fresh elements and evict stale elements respectively. Fig. 4 Using DCBA to represent a sliding window in a decentralized (clustered) system. 2011 -7 -29 9

The DCBA Scheme § § § Bits belonging to different BFs but with the

The DCBA Scheme § § § Bits belonging to different BFs but with the same offset are mapped and stored in the same bit vector so that they can be read or written simultaneously in a single memory access. Considering that k hash functions are used and shared among the DCBFs, the memory access complexity of querying an item will be O(k) rather than O(k×g). If a positive is produced by the decaying BF, the associated decaying TA will be queried to check whether the item has already expired. Fig. 5 The in-memory structure of a DCBA. 2011 -7 -29 10

The DCBA Scheme § The bit width d of each timer is fundamentally determined

The DCBA Scheme § The bit width d of each timer is fundamentally determined by the capacity of the DCBA. Suppose that the capacity of a DCBA is N, each DCBF will be designed to hold N/(g− 1) elements, and each timer will contain d=�log 2 N/(g− 1)� bits to count from 0 to N/(g− 1)− 1, where 0 denotes the oldest timestamp. Ø E. g. , if a DCBF is designed to accommodate 1 M (220) elements, then each constructing timer will consume 20 bits to count from 0 to 220− 1. Fig. 5 The in-memory structure of a DCBA. 2011 -7 -29 11

The DCBA Scheme § The DCBA scheme maintains a base timer that counts from

The DCBA Scheme § The DCBA scheme maintains a base timer that counts from 0 to N/(g− 1)− 1 in a circular manner to generate timestamps for the monitored elements. § To insert an element x, k bits in the filling BF will be chosen and set to 1 according to the hash functions hi(x) (1≤i≤k), and the k associated timers in the filling TA will be set to the value of the base timer. § The base timer will be incremented by 1 after an insert operation. § An element in the decaying DCBF will be considered expired once its timestamp becomes smaller than the base timer Fig. 5 The in-memory structure of a DCBA. 2011 -7 -29 12

The DCBA Scheme § Since a representing bit as well as its associated timer

The DCBA Scheme § Since a representing bit as well as its associated timer can be shared by multiple elements in a DCBF, we determine the timestamp of an element according to a count-min policy. Ø The minimal value t among all the k timers corresponding to an element x will be considered as its timestamp. § The probability that all the k timers corresponding to x are occasionally shared and set by other elements with larger timestamps than x is very small and can be constrained by restricting the target error rate of each DCBF. base timer Fig. 5 The in-memory structure of a DCBA. 2011 -7 -29 13

Outline § § 2011 -7 -29 Background and Motivation The DCBA Scheme Analysis and

Outline § § 2011 -7 -29 Background and Motivation The DCBA Scheme Analysis and Evaluation Conclusions 14

Analysis and Evaluation § RAM Consumption Ø If the overall false positive rate of

Analysis and Evaluation § RAM Consumption Ø If the overall false positive rate of the DCBA is constrained to εDCBA, the error rate threshold of each DCBF should be εDCBF=1−(1−εDCBA)1/g. Ø The optimal number of hush functions can be derived as k. DCBF=�log 2(1/εDCBF)�. Ø The total space requirement of a DCBA is expressed as m. DCBA-total=g×(d+1)×�log 2 e×k. DCBF×N/(g− 1)�. Ø Since the DCBA scheme allows up to g− 2 TAs to be offloaded to disks, the minimal RAM consumption of a DCBA is therefore m. DCBA-RAM=(g +2 d)×�log 2 e×k. DCBF×N/(g− 1)�. 2011 -7 -29 15

Analysis and Evaluation § RAM Consumption (a) Representing a sliding window with size 64

Analysis and Evaluation § RAM Consumption (a) Representing a sliding window with size 64 M (1 M=220). (b) Representing a sliding window with size 1, 024 M (1 M=220). Fig. 6 Memory consumption of a DCBA. 2011 -7 -29 16

Analysis and Evaluation § We have collected a sequence of 2, 026, 005, 927

Analysis and Evaluation § We have collected a sequence of 2, 026, 005, 927 chunk fingerprints that contains 83, 733, 597 unique elements, which provides a real-world data set for measuring the performance and query accuracy of the DCBA scheme. § The experimental server that maintains a DCBA for monitoring the chunk fingerprint stream over a sliding window is configured as follows: Ø a 32 -bit Windows operating system Ø a quad-core CPU running at 2 GHz Ø 4× 2 GB RAM Ø 16× 1 TB hard disks organized as a RAID-5 partition Ø 2 gigabit network interface cards. 2011 -7 -29 17

Analysis and Evaluation § Query Performance (a) Representing a sliding window with an error

Analysis and Evaluation § Query Performance (a) Representing a sliding window with an error rate threshold of 1/27. (b) Representing a sliding window with an error rate threshold of 1/214. Fig. 7 Average query performance of a DCBA. 2011 -7 -29 18

Analysis and Evaluation § Query Accuracy (a) Representing a sliding window with an error

Analysis and Evaluation § Query Accuracy (a) Representing a sliding window with an error rate threshold of 1/27. (b) Representing a sliding window with an error rate threshold of 1/214. Fig. 8 False positive rate of a DCBA. 2011 -7 -29 19

Outline § § 2011 -7 -29 Background and Motivation The DCBA Scheme Analysis and

Outline § § 2011 -7 -29 Background and Motivation The DCBA Scheme Analysis and Evaluation Conclusions 20

Conclusion § This paper proposes a Detached Counting Bloom filter Array (DCBA) scheme to

Conclusion § This paper proposes a Detached Counting Bloom filter Array (DCBA) scheme to address the problem of detecting duplicates in data streams over sliding windows. Ø Ø High query performance High space efficiency Scalability Easy to be synchronized § Mathematical analysis and experimental results show that Ø a DCBA can achieve a high query performance that is comparable to the state- of-the-art timing Bloom filter approach in the same environment with a much lower RAM overhead than the latter. Ø the actual error rate of a DCBA can be well constrained at or below its predefined threshold. § In general, a DCBA outperforms existing schemes and is more flexible in representing massive stream elements in sliding windows. 2011 -7 -29 21

Thanks! Questions? Acknowledgment This work is supported in part by the National Basic Research

Thanks! Questions? Acknowledgment This work is supported in part by the National Basic Research Program (973 Program) of China under Grant No. 2011 CB 302305, the National High Technology Research and Development Program (863 Program) of China under Grant No. 2009 AA 01 A 402, and the US NSF under Grants NSF-IIS 0916859, NSF-CCF-0937993 and NSF-CNS-1016609. The authors are grateful to the anonymous reviewers for their valuable comments and suggestions. 2011 -7 -29 22