Massively Parallel XML Twig Filtering Using Dynamic Programming on FPGAs Roger Moussalli, Mariam Salloum, Walid Najjar, Vassilis J. Tsotras University of California Riverside, California 92521, USA (rmous,msalloum,najjar,tsotras)@cs.ucr.edu Abstract— In recent years, XML-based Publish-Subscribe Sys- tems have become popular due to the increased demand of timely event-notification. Users (or subscribers) pose complex profiles on the structure and content of the published messages. If a profile matches the message, the message is forwarded to the interested subscriber. As the amount of published content continues to grow, current software-based systems will not scale. We thus propose a novel architecture to exploit parallelism of twig matching on FPGAs. This approach yields up to three orders of magnitude higher throughput when compared to conventional approaches bound by the sequential aspect of software computing. This paper, presents a novel method for performing unordered holistic twig matching on FPGAs without any false positives, and whose throughput is independent of the complexity of the user queries or the characteristics of the input XML stream. Furthermore, we present experimental comparison of different granularities of twig matching, namely path-based (root-to-leaf) and pair-based (parent-child or ancestor-descendant). We provide comprehensive experiments that compare the throughput, area utilization and the accuracy of matching (percent of false positives) of our holistic, path-based and pair-based FPGA approaches. I. I NTRODUCTION With the recent advent of social networking and blogging services, the Publish/Subscribe (or simply pub-sub) paradigm is being utilized for timely event-notification. A pub-sub system is an asynchronous event-based dissemination system which consists of three components: publishers, who feed a stream of messages into the system, subscribers, who post their interests (also called profiles), and an infrastructure for matching profiles with published messages and forwarding the messages to the interested subscriber. Pub-sub systems have evolved from simple topic-based [1], to content-based systems [2], [3], [4], to recent XML-based systems [5], [6], [7], [8], [9], [10]. Given the adoption of XML as the standard format for data exchange, in this paper we focus on XML-based pub- sub systems. In XML-based pub-sub, messages are encoded as XML documents and profiles are expressed using XML query languages, such as XPath [11]. Such systems take advantage of the powerful querying that XML query languages offer, since profiles describe requests on structure as well as content. Many software approaches have been presented to solve the XML filtering problem [5], [6], [7], [8], [9], [10]. These memory-bound approaches, however, suffer from the Von Neumann bottleneck and are unable to handle a large volume of input streams. On the other hand, Field Programmable Gate Arrays (FPGAs) have been shown to be particularly suited for stream processing applications and do not suffer from the memory bottleneck faced by software implementations [12], [13], [14]. In [13] we presented a proof-of-concept approach for the use of FPGAs for the XML filtering problem that ex- pressed path queries using regular expressions and built a NFA in hardware to facilitate the query matching. The proposed approach, however, does not account for recursive elements in XML documents or wildcards(‘*’) in the XPath expressions. In [14] we presented a new approach for matching complex path profiles that supports the /child:: axis and /descendant-or-self:: axis 1 , wildcard (‘*’) node tests and accounts for recursive elements in the XML document. This approach proved very efficient for matching path profiles, but is unable to match profiles expressed as a twig structure. In this paper, we present a new approach for processing twigs on FPGAs in a holistic manner. In addition, we provide experimental comparison between the different granularities of twig matching, namely, holistic twig matching, path matching, and pair matching all within the FPGA framework. The main contributions of this paper can be summarized as follows: • We present a novel dynamic programming approach for holistic twig matching on FPGAs without false positives. Our solution is based on mapping profiles into custom Push and Pop stacks in hardware. • We present a comparison between the different granu- larities of twig matching, namely holistic twig matching, root-to-leaf path matching and parent-child or ancestor- descendant pair matching, on FPGAs. • We present a thorough experimental evaluation of throughput and area utilization of the three FPGA-based proposed approaches. We then evaluate the throughput gain and area utilization of the various approaches against the accuracy of matching (percentage of false positives returned). • We finally present additional evaluation of the FPGA- based approaches against the state of the art software counterparts, namely FiST and YFilter. Our methods offer up to three orders of magnitude improvement. 1 In the rest of the paper we shall use ‘/’ and ‘//’ as shorthand to denote the /child:: axis and /descendant-or-self:: axis, respectively.