Reentrancy and Scoping in Rule Engines for Cloud-Based Applications
Total Page:16
File Type:pdf, Size:1020Kb
Dissertation submitted in fulfilment of the requirement for the degree of Doctor of Philosophy in Science REENTRANCY AND SCOPING IN RULE ENGINES FOR CLOUD-BASED APPLICATIONS KENNEDY KAMBONA June 2018 Promotor: Prof. Dr. Wolfgang De Meuter Faculty of Science and Bio-Engineering Sciences Dissertation submitted in fulfilment of the requirement for the degree of Doctor of Philosophy in Sciences Reentrancy & Scoping in Rule Engines for Cloud-based Applications Kennedy Kambona Promotor: Prof. Dr. Wolfgang De Meuter Jury: Prof. Dr. Viviane Jonckers, Vrije Universiteit Brussel, Belgium (chair) Prof. Dr. Katrien Beuls, Vrije Universiteit Brussel, Belgium (secretary) Prof. Dr. Bart Jansen, Vrije Universiteit Brussel, Belgium Prof. Dr. Joeri De Koster, Vrije Universiteit Brussel, Belgium Prof. Dr. Slinger Jansen, Utrecht University, The Netherlands Prof. Dr. Stijn Vansummeren, Université Libre de Bruxelles, Belgium Prof. Dr. Wolfgang De Meuter, Vrije Universiteit Brussel, Belgium (promotor) All rights reserved. No parts of this book may be reproduced in any form by print, photoprint, microfilm, electronic or any other means without prior written consent from the author. © June 2018. Abstract Modern software systems are increasingly being deployed to the Cloud, leading to the rising adoption of systems that are predominantly online. An example of these are multi-tenant systems: Cloud-based applications that are shared by and instantiated for a multitude of tenants. Characteristically, such applications are often connected to different heterogeneous clients that are reactively uploading events and data, and are thus required to share the knowledge among the various tenants they support. Rather than hardcoding all this shared knowledge and ontologies in plain code, the knowledge can be easily programmed in the form of rules that orchestrate server-side logic, e.g., as business rules. In such situations, a rule engine is well-suited to accommodate the knowledge for clients of such reactive knowledge-driven applications. Unfortunately, existing rule engines (and the rule-based languages they implement) were not conceptually designed to support and to cope with the knowledge and rules for multiple tenants at the same time. More specifically, they are unsuitable to support such heterogeneous systems because one has to manually hardcode the modularity and own- ership of the knowledge for the various applications and clients, which quickly becomes complex and fallible. They further lack suitable semantics that developers can use to ex- ploit collective or community knowledge that may apply to the data contributed by the various heterogeneous sources. This dissertation presents Serena, a framework that provides scope-based reasoning in rule-based systems operating in heterogeneous environments. The solution exploits the fact that much of the community knowledge significant when performing reasoning and deductions can be structured in a hierarchy of scopes (that orchestrate which rules should be applicable to which incoming data). Serena augments an event-driven server with a Rete-based rule engine. Serena is distinct from existing rule-based systems due the notion of reentrancy and scoping that are efficiently ingrained at the heart of its inference engine. Serena further eases the encoding of reactive event patterns by clients in the form of scoped rules. Rule designers can utilise scoped rules to detect patterns in real-time data and to realise grouping structures in reactive knowledge-driven applications backed by a common rule-based system. Samenvatting Moderne softwaresystemen worden steeds vaker beschikbaar gesteld via de Cloud, waar ze online functioneren. Een voorbeeld van zulke systemen zijn multi-tenant systemen. Dit zijn Cloud-gebaseerde toepassingen die gedeeld en genstantieerd worden door meerdere gebruikersgroepen, zogenaamde “tenants”. Karakteristiek aan zulke toepassingen is dat ze veelal verbonden zijn met meerdere heterogene gebruikers. Deze gebruikers sturen events en data op reactieve wijze naar de multi-tenant toepassing. De toepassing moet deze informatie waar nodig delen met de verschillende tenants, of juist gescheiden houden. In plaats van al deze gedeelde kennis en ontologien manueel vast te leggen in code, kan deze kennis eenvoudig geprogrammeerd worden in de vorm van declaratieve regels, zoals “business rules”. Met een regelgebaseerd systeem kan de server de kennis van de gebruikers dan op reactieve wijze verwerken. Bestaande regelgebaseerde systemen (en de regelgebaseerde programmeertalen die ze implementeren) zijn echter niet ontworpen voor de noden van multi-tenancy. Meer bepaald missen bestaande systemen ondersteuning voor concepten uit heterogene systemen, waar- door manueel gencodeerd moet worden welke data bij welke toepassing of tenant hoort. Dit wordt snel complex en vergroot de kans op fouten in de regels. Bovendien ontbreken zulke systemen ook een gepaste semantiek voor het uitbuiten van “community knowledge”: kennis die ook relevant is voor andere tenants buiten de bron van de data. Deze thesis introduceert Serena: een framework waarmee regelgebaseerde systemen kunnen redeneren over “scopes” in heterogene omgevingen. De voorgestelde oplossing is gestoeld op het feit dat de relevante kennis van de community voorgesteld kan worden als een hirarchie van scopes (die aangeven welke regels van toepassing zijn op bepaalde invoer). Serena voegt aan een traditionele event-gedreven server een regelgebaseerd systeem toe dat het Rete-algoritme gebruikt. Serena onderscheidt zich van bestaande regelgebaseerde systemen doordat reentrancy en scoping ingebakken zijn in de kern van de inference engine. Daarenboven maakt Serena het eenvoudiger om de reactieve voorwaarden van de gebruikers uit te drukken als regels met scopes. Ontwerpers van regels kunnen regels met scopes gebruiken om patronen te detecteren in real-time data en groepen te creren in reactieve event-gedreven toepassingen die gemplementeerd zijn met behulp van een gezamenlijk regelgebaseerd systeem. Acknowledgements The Indian tale of the The Blind Men and the Elephant as it applies to community knowl- edge likewise encompasses my dissertation; as it would not be possible without the assis- tance, dedication and perseverance of a community surrounding my research life. I would first like to express my gratitude and appreciation tomy promotor Prof. Dr. Wolfgang De Meuter for his mentorship and guidance throughout the research period. In the same breath, I appreciate the insightful and candid feedback from my thesis committee about this work. Next in line to receive my sincere thanks are the people who have par- ticipated in some capacity to this research: Dr. Lode Hoste, Prof. Dr. Elisa Gonzalez-Boix, Dr. Ellie D’Hondt, Dr. Jorge Vallejos, and my officemate for years, Florian Myter. Tomy research sidekicks Thierry Renaux, Simon Van de Water and Humberto Rodriguez Avila, thanks for all the in-depth discussions inundated with the word Rete. And to my readers Simon and Nils (and later, Isaac), thanks being my extra set of eyes in this text. I am also very grateful to everyone in the Software Languages and Engineering Lab (both current and ex-Softies) for providing me with valuable contributions, criticisms and other feedback. The SOFT lab embodies the most intellectually-thriving environment I have yet encountered – the conference trips, game days, barbecues, and other events were pretty fun. Our halls might be silent, but in the slack altercations abound. To me, SOFT is this home away from home, I will therefore be forever honoured to be a part of the family. To the four people that have most shaped my life, my mother Margaret and father Alexander, sisters Nancy and Maureen Kambona (in order of nascency), cousin Dr. Moturi: this document is yours as much as it is mine. The same applies to other friends and family, to a lesser extent. Finally, I would like to thank my life partner Jacky for all the support (and distractions in equal proportions). Yes, your time to reach this point is fast approaching, and I will be by your side when it does. If you are still searching for your name here, your contributions were more important to me than you realise. Just wait for a less serious book ;) and you will most certainly be there. Kushukuru haikudhuru. Asanteni. Contents 1 Introduction 1 1.1 Research Context ................................. 2 1.1.1 Community Knowledge in Heterogeneous Environments ....... 3 1.1.2 Reactive Web Applications ....................... 3 1.1.3 Reactive Knowledge-driven Applications ................ 4 1.2 Problem Statement ................................ 5 1.3 Overview ..................................... 7 1.3.1 Dynamic Rule Architecture ....................... 7 1.3.2 Scoped Rule-based Language ...................... 8 1.3.3 Reentrant Rule Engine .......................... 8 1.4 Approach & Methodology ............................ 9 1.5 Contributions ................................... 10 1.6 Supporting Publications ............................. 11 1.6.1 Primary Publications .......................... 11 1.6.2 Secondary Publications ......................... 12 1.7 Outline ...................................... 12 2 Reactive Knowledge-driven Applications 15 2.1 Introduction .................................... 15 2.1.1 The Rise of the Dynamic Web ..................... 16 2.1.2 Foundations of Cloud-based Heterogeneity ............... 18 2.2 Trends in the Dynamic Web ........................... 19 2.2.1 The Web and Big Data ........................