skip to main content
10.1145/3293883.3295719acmconferencesArticle/Chapter ViewAbstractPublication PagesppoppConference Proceedingsconference-collections
research-article

A specialized B-tree for concurrent datalog evaluation

Published:16 February 2019Publication History

ABSTRACT

Modern Datalog engines are employed in industrial applications such as graph-databases, networks, and static program analysis. To cope with vast amount of data, Datalog engines must employ parallel execution strategies, for which specialized concurrent data structures are of paramount importance.

In this paper, we introduce a specialized B-tree data structure for an open-source Datalog compiler written in C++. Our data structure has been specialized for Datalog workloads running on shared-memory multi-core computers. It features (1) an optimistic locking protocol for scalability, (2) is highly tuned, and (3) uses the notion of "hints" to re-use the results of previously performed tree traversals to exploit data ordering properties exhibited by Datalog evaluation. In parallel micro-benchmarks, the new data structure achieves up to 59× higher performance than state-of-the-art industrial standards, while integrated into a Datalog engine it accounts for 3× higher, overall system performance.

References

  1. Serge Abiteboul, Richard Hull, and Victor Vianu (Eds.). 1995. Foundations of Databases: The Logical Level (1st ed.). Addison-Wesley Longman Publishing Co., Inc. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Nicholas Allen, Padmanabhan Krishnan, and Bernhard Scholz. 2015. Combining Type-analysis with Points-to Analysis for Analyzing Java Library Source-code. In Proceedings of the 4th ACM SIGPLAN International Workshop on State Of the Art in Program Analysis (SOAP 2015). ACM, New York, NY, USA, 13--18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Tony Antoniadis, Konstantinos Triantafyllou, and Yannis Smaragdakis. 2017. Porting Doop to Souffle: A Tale of Inter-engine Portability for Datalog-based Analyses. In Proceedings of the 6th ACM SIGPLAN International Workshop on State Of the Art in Program Analysis (SOAP 2017). ACM, New York, NY, USA, 25--30. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Maya Arbel and Hagit Attiya. 2014. Concurrent Updates with RCU: Search Tree As an Example. In Proceedings of the 2014 ACM Symposium on Principles of Distributed Computing (PODC '14). ACM, New York, NY, USA, 196--205. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Dmitry Basin, Edward Bortnikov, Anastasia Braginsky, Guy Golan-Gueta, Eshcar Hillel, Idit Keidar, and Moshe Sulamy. 2017. KiWi: A Key-Value Map for Scalable Real-Time Analytics. SIGPLAN Not. 52, 8 (Jan. 2017), 357--369. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. R. Bayer and E. M. Mccreight. 1972. Organization and Maintenance of Large Ordered Indexes. Acta Inf. 1, 3 (Sept. 1972), 173--189. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Hans-J Boehm. 2012. Can seqlocks get along with programming language memory models?. In Proceedings of the 2012 ACM SIGPLAN Workshop on Memory Systems Performance and Correctness. ACM, 12--20. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Anastasia Braginsky and Erez Petrank. 2012. A Lock-free B+Tree. In Proceedings of the Twenty-fourth Annual ACM Symposium on Parallelism in Algorithms and Architectures (SPAA '12). ACM, New York, NY, USA, 58--67. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Martin Bravenboer and Yannis Smaragdakis. 2009. Exception analysis and points-to analysis: better together. In Proceedings of the eighteenth international symposium on Software testing and analysis (ISSTA '09). ACM, New York, NY, USA, 1--12. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Martin Bravenboer and Yannis Smaragdakis. 2009. Strictly Declarative Specification of Sophisticated Points-to Analyses. SIGPLAN Not. 44, 10 (2009), 243--262. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Nathan G. Bronson, Jared Casper, Hassan Chafi, and Kunle Olukotun. 2010. A Practical Concurrent Binary Search Tree. SIGPLAN Not. 45, 5 (Jan. 2010), 257--268. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Trevor Brown. 2014. B-slack Trees: Space Efficient B-Trees. In Algorithm Theory - SWAT 2014, R. Ravi and Inge Li Gørtz (Eds.). Springer International Publishing, Cham, 122--133.Google ScholarGoogle Scholar
  13. Trevor Brown and Joanna Helga. 2011. Non-blocking K-ary Search Trees. In Proceedings of the 15th International Conference on Principles of Distributed Systems (OPODIS'11). Springer-Verlag, Berlin, Heidelberg, 207--221. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Cohen and O. Wolfson. 1989. Why a Single Parallelization Strategy is Not Enough in Knowledge Bases. In Proceedings of the Eighth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS '89). ACM, New York, NY, USA, 200--216. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Tyler Crain, Vincent Gramoli, and Michel Raynal. 2012. A Speculation-friendly Binary Search Tree. In Proceedings of the 17th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '12). ACM, New York, NY, USA, 161--170. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. The Souffle Developers. {n. d.}. Souffle - A Datalog Engine. http://www.github.com/souffle-lang/souffle. ({n. d.}). Accessed: 2019-01-05.Google ScholarGoogle Scholar
  17. Dana Drachsler, Martin Vechev, and Eran Yahav. 2014. Practical Concurrent Binary Search Trees via Logical Ordering. SIGPLAN Not. 49, 8 (Feb. 2014), 343--356. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Ari Fogel, Stanley Fung, Luis Pedrosa, Meg Walraed-Sullivan, Ramesh Govindan, Ratul Mahajan, and Todd Millstein. 2015. A General Approach to Network Configuration Analysis. In Proceedings of the 12th USENIX Conference on Networked Systems Design and Implementation (NSDI'15). USENIX Association, Berkeley, CA, USA, 469--483. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Sumit Ganguly, Avi Silberschatz, and Shalom Tsur. 1990. A Framework for the Parallel Processing of Datalog Queries. In Proceedings of the 1990 ACM SIGMOD International Conference on Management of Data (SIGMOD '90). ACM, New York, NY, USA, 143--152. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Google. {n. d.}. B-Tree Containers from Google. https://isocpp.org/blog/2013/02/b-tree-containers-from-google. ({n. d.}). Accessed: 2017-02-14.Google ScholarGoogle Scholar
  21. Goetz Graefe. 2010. A survey of B-tree locking techniques. ACM Transactions on Database Systems (TODS) 35, 3 (2010), 16. Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Todd J. Green, Shan Shan Huang, Boon Thau Loo, and Wenchao Zhou. 2013. Datalog and Recursive Query Processing. Foundations and Trends in Databases 5, 2 (2013), 105--195. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Behnaz Hassanshahi, Raghavendra Kagalavadi Ramesh, Padmanabhan Krishnan, Bernhard Scholz, and Yi Lu. 2017. An Efficient Tunable Selective Points-to Analysis for Large Codebases. In Proceedings of the 6th ACM SIGPLAN International Workshop on State Of the Art in Program Analysis (SOAP 2017). ACM, New York, NY, USA, 13--18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. John L. Hennessy and David A. Patterson. 2011. Computer Architecture, Fifth Edition: A Quantitative Approach (5th ed.). Morgan Kaufmann Publishers Inc., San Francisco, CA, USA. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Krystof Hoder, Nikolaj Bjørner, and Leonardo Mendonça de Moura. 2011. μZ - An Efficient Engine for Fixed Points with Constraints. In Proceedings of the International Conference on Computer Aided Verification, Vol. LNCS 6806. Springer, 457--462. Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Shane V. Howley and Jeremy Jones. 2012. A Non-blocking Internal Binary Search Tree. In Proceedings of the Twenty-fourth Annual ACM Symposium on Parallelism in Algorithms and Architectures (SPAA '12). ACM, New York, NY, USA, 161--171. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. G. Hulin. 1989. Parallel Processing of Recursive Queries in Distributed Architectures. In Proceedings of the 15th International Conference on Very Large Data Bases (VLDB '89). Morgan Kaufmann Publishers Inc., San Francisco, CA, USA, 87--96. Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Herbert Jordan, Bernhard Scholz, and Pavle Subotić. 2016. Souffle: On Synthesis of Program Analyzers. In International Conference on Computer Aided Verification.Google ScholarGoogle Scholar
  29. Herbert Jordan, Bernhard Scholz, and Pavle Subotic. 2017. Optimal On The Fly Index Selection in Polynomial Time. CoRR abs/1709.03685 (2017). arXiv:1709.03685 http://arxiv.org/abs/1709.03685Google ScholarGoogle Scholar
  30. Tomas Karnagel, Roman Dementiev, Ravi Rajwar, Konrad Lai, Thomas Legler, Benjamin Schlegel, and Wolfgang Lehner. 2014. Improving in-memory database index performance with Intel® Transactional Synchronization Extensions. In High Performance Computer Architecture (HPCA), 2014 IEEE 20th International Symposium on. IEEE, 476--487.Google ScholarGoogle ScholarCross RefCross Ref
  31. H. T. Kung and John T. Robinson. 1981. On Optimistic Methods for Concurrency Control. ACM Trans. Database Syst. 6, 2 (June 1981), 213--226. Google ScholarGoogle ScholarDigital LibraryDigital Library
  32. Christoph Lameter. 2005. Effective synchronization on Linux/NUMA systems. In Gelato Conference, Vol. 2005.Google ScholarGoogle Scholar
  33. Philip L. Lehman and s. Bing Yao. 1981. Efficient Locking for Concurrent Operations on B-trees. ACM Trans. Database Syst. 6, 4 (Dec. 1981), 650--670. Google ScholarGoogle ScholarDigital LibraryDigital Library
  34. Justin J. Levandoski, David B. Lomet, and Sudipta Sengupta. 2013. The Bw-Tree: A B-tree for New Hardware Platforms. In Proceedings of the 2013 IEEE International Conference on Data Engineering (ICDE 2013) (ICDE '13). IEEE Computer Society, Washington, DC, USA, 302--313. Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. V. Benjamin Livshits and Monica S. Lam. 2005. Finding Security Vulnerabilities in Java Applications with Static Analysis. In Proceedings of the 14th Conference on USENIX Security Symposium - Volume 14 (SSYM'05). USENIX Association, Berkeley, CA, USA, 18--18. Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Yandong Mao, Eddie Kohler, and Robert Tappan Morris. 2012. Cache Craftiness for Fast Multicore Key-value Storage. In Proceedings of the 7th ACM European Conference on Computer Systems (EuroSys '12). ACM, New York, NY, USA, 183--196. Google ScholarGoogle ScholarDigital LibraryDigital Library
  37. Carlos Alberto Martınez-Angeles, Inês Dutra, Vıtor Santos Costa, and Jorge Buenabad-Chávez. 2014. A datalog engine for gpus. Declarative Programming and Knowledge Management (2014), 152--168.Google ScholarGoogle Scholar
  38. Daniel A Menascé and Tatuo Nakanishi. 1982. Optimistic versus pessimistic concurrency control mechanisms in database management systems. Information systems 7, 1 (1982), 13--27.Google ScholarGoogle Scholar
  39. Aravind Natarajan and Neeraj Mittal. 2014. Fast Concurrent Lock-free Binary Search Trees. In Proceedings of the 19th ACM SIGPLAN Symposium on Principles and Practice of Parallel Programming (PPoPP '14). ACM, New York, NY, USA, 317--328. Google ScholarGoogle ScholarDigital LibraryDigital Library
  40. Rotem Oshman and Nir Shavit. 2013. The SkipTrie: Low-depth Concurrent Search Without Rebalancing. In Proceedings of the 2013 ACM Symposium on Principles of Distributed Computing (PODC '13). ACM, New York, NY, USA, 23--32. Google ScholarGoogle ScholarDigital LibraryDigital Library
  41. Aleksandar Prokopec, Nathan Grasso Bronson, Phil Bagwell, and Martin Odersky. 2012. Concurrent Tries with Efficient Non-blocking Snapshots. SIGPLAN Not. 47, 8 (Feb. 2012), 151--160. Google ScholarGoogle ScholarDigital LibraryDigital Library
  42. James Reinders. 2007. Intel threading building blocks: outfitting C++ for multi-core processor parallelism. "O'Reilly Media, Inc.". Google ScholarGoogle ScholarDigital LibraryDigital Library
  43. Thomas W. Reps. 1995. Demand Interprocedural Program Analysis Using Logic Databases. Springer US, Boston, MA, 163--196.Google ScholarGoogle Scholar
  44. Bernhard Scholz, Herbert Jordan, Pavle Subotić, and Till Westmann. 2016. On Fast Large-scale Program Analysis in Datalog. In Proceedings of the 25th International Conference on Compiler Construction (CC 2016). ACM, New York, NY, USA, 196--206. Google ScholarGoogle ScholarDigital LibraryDigital Library
  45. Bernhard Scholz, Kostyantyn Vorobyov, Padmanabhan Krishnan, and Till Westmann. 2015. A Datalog Source-to-Source Translator for Static Program Analysis: An Experience Report. In 24th Australasian Software Engineering Conference, ASWEC 2015, Adelaide, SA, Australia, September 28 - October 1, 2015. IEEE Computer Society, 28--37. Google ScholarGoogle ScholarDigital LibraryDigital Library
  46. Jürgen Seib and Georg Lausen. 1991. Parallelizing Datalog Programs by Generalized Pivoting. In Proceedings of the Tenth ACM SIGACT-SIGMOD-SIGART Symposium on Principles of Database Systems (PODS '91). ACM, New York, NY, USA, 241--251. Google ScholarGoogle ScholarDigital LibraryDigital Library
  47. Jiwon Seo, Jongsoo Park, Jaeho Shin, and Monica S. Lam. 2013. Distributed Socialite: A Datalog-based Language for Large-scale Graph Analysis. Proc. VLDB Endow. 6, 14 (Sept. 2013), 1906--1917. Google ScholarGoogle ScholarDigital LibraryDigital Library
  48. Jason Sewall, Jatin Chhugani, Changkyu Kim, Nadathur Satish, and Pradeep Dubey. 2011. PALM: Parallel Architecture-Friendly Latch-Free Modifications to B+ Trees on Many-Core Processors. PVLDB 4 (08 2011), 795--806.Google ScholarGoogle Scholar
  49. Marianne Shaw, Paraschos Koutris, Bill Howe, and Dan Suciu. 2012. Optimizing Large-scale Semi-Naïve Datalog Evaluation in Hadoop. In Proceedings of the Second International Conference on Datalog in Academia and Industry (Datalog 2.0'12). Springer-Verlag, Berlin, Heidelberg, 165--176. Google ScholarGoogle ScholarDigital LibraryDigital Library
  50. Alexander Shkapsky, Kai Zeng, and Carlo Zaniolo. 2013. Graph Queries in a Next-generation Datalog System. Proc. VLDB Endow. 6, 12 (Aug. 2013), 1258--1261. Google ScholarGoogle ScholarDigital LibraryDigital Library
  51. Julian Shun and Guy E. Blelloch. 2014. Phase-concurrent Hash Tables for Determinism. In Proceedings of the 26th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA '14). ACM, New York, NY, USA, 96--107. Google ScholarGoogle ScholarDigital LibraryDigital Library
  52. J. Whaley, D. Avots, M. Carbin, and M. S. Lam. 2005. Using Datalog with binary decision diagrams for program analysis. In APLAS. 97--118. Google ScholarGoogle ScholarDigital LibraryDigital Library
  53. Ouri Wolfson and Aya Ozeri. 1990. A New Paradigm for Parallel and Distributed Rule-processing. SIGMOD Rec. 19, 2 (May 1990), 133--142. Google ScholarGoogle ScholarDigital LibraryDigital Library
  54. Ouri Wolfson and Avi Silberschatz. 1988. Distributed Processing of Logic Programs. SIGMOD Rec. 17, 3 (June 1988), 329--336. Google ScholarGoogle ScholarDigital LibraryDigital Library
  55. Mohan Yang, Alexander Shkapsky, and Carlo Zaniolo. 2017. Scaling up the performance of more powerful Datalog systems on multicore machines. VLDB J. 26, 2 (2017), 229--248. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. A specialized B-tree for concurrent datalog evaluation

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in
      • Published in

        cover image ACM Conferences
        PPoPP '19: Proceedings of the 24th Symposium on Principles and Practice of Parallel Programming
        February 2019
        472 pages
        ISBN:9781450362252
        DOI:10.1145/3293883

        Copyright © 2019 ACM

        Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

        Publisher

        Association for Computing Machinery

        New York, NY, United States

        Publication History

        • Published: 16 February 2019

        Permissions

        Request permissions about this article.

        Request Permissions

        Check for updates

        Qualifiers

        • research-article

        Acceptance Rates

        PPoPP '19 Paper Acceptance Rate29of152submissions,19%Overall Acceptance Rate230of1,014submissions,23%

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader