Using Cloud Computing with RETE Algorithms in a Platform as a Service (PaaS) for Business Systems Development

Richard Poblete 1, David de la Fuente 2, and Margarita Alonso 3 1Department of Business Administration, Cantabria University, Santander, Spain [email protected] 2Department of Business Administration, Oviedo University, Gijón, Asturias, Spain [email protected] 1Department of Business Administration, Cantabria University, Santander, Spain [email protected]

this technology is the Virtualization and its model of operative Abstract - Given that companies operate in an environment of business is varied and can include: Pay per Use Models; Free continuous evolution it requires information systems to have Models; Fee for Service Models and Free Use Models, greater adaptation, flexibility, scalability and reliability of sharing utilities. incorporation of these changes. Cloud Computing can be regarded as a paradigm and key element of recent computing in business management solutions. A business solution arises 1.1 Cloud Computing in the cloud; this solution includes both the environmental Cloud Computing is defined by the way in which the dynamics and the changes needed in the business logic service provider and the consumer of that service are related. assuring speed of response, efficiency in the solution and In this context it is very common that the consumers are not maintenance of the application. This article shows a design the owners of the infrastructure, they do not incur CAPEX 1, model of Saas applications based on a platform (PaaS) which since they are under a modality of rent and use from a has the business logic as central element and is subdivided in provider. The customers consume resources and only pay for "Business Objects", "Business Processes" and "Business resources used. This model is very similar to what happens Rules." According to the business rules, and in order to with the payment and consumption of energy in our homes. resolve the problem based on facts and from the This business model is possible because of the following knowledge as an essential part of the construction of the features: system, expert systems are applied through the use of the RETE algorithms (Forward Chaining). 1) Virtualization: Cloud Computing allows the user to access the service in any place through any kind of terminal or device. The required resources come from the Cloud instead Keywords: Cloud Computing, SaaS, PaaS, RETE of a visible entity.

2) Reliability: The Cloud uses various methods for the fault 1 Introduction tolerance. Computing based on interchangeable isomorphic The competitive business environment demands nodes guarantees the service reliability. The Use of the companies to concentrate in business management and not in Computing Cloud is more reliable than in a local station [2]. the technological aspects of their company which may be 3) Versatility: The Cloud can stand different applications, complex because of a changing environment. It is therefore execute them at the same time and reuse their own resources. necessary to constantly redefine the Business Logic Systems. 4) Elasticity: The Cloud scale can expand dynamically in Having a platform which can adapt quickly to these conditions order to satisfy the growing demand for requirements. is extremely important. 5) “On-Demand” Service: The Cloud is a wide group of Cloud Computing is changing the traditional way of how resources that can be rented according to the customer hardware and software providers sell their products to their necessity. customers. This is another kind of business in which the product is not sold as such, but a service is sold [2]. Mainly, this platform allows sharing resources as a service. These 1 resources include infrastructure (IaaS), software (SaaS), CAPital EXpenditures (CAPEX or capex) are capital inversions or applications (PaaS), and data storage (dSaaS). At the heart of expenditures which create benefits. 6) Economic: cost reduction is given by the fault tolerance system consists of one or more conditions and different feature which has the Cloud “per se”, (very cheap isomorphic actions which may be undertaken for each complete set of nodes). The versatility, elasticity and "On Demand” Service facts that match the condition. The RETE algorithm RETE make the resources’ availability easy [2] compared to the exhibits the following major characteristics: traditional system, so the user can enjoy this low-cost advantage. • It reduces or eliminates certain types of redundancy through the use of node sharing. The article starts explaining the relevant concepts, a proposed method, and analyzing the implications of using RETE as an • essential part of such a model. It stores partial matches when performing joins between different fact types. At the same time, it allows production rule systems to avoid complete revaluation of all facts each time changes are made 2 Expert Systems (ES) in the nodes which are stored in the working Expert systems as techniques within the area of Artificial memory. Instead, the production system has to Intelligence are presented as computer programs that can evaluate the changes (deltas) in the working memory. perform various tasks: • It allows for efficient removal of memory elements • Efficiently carrying out search and recovery when facts are retracted or moved from working processes for interrelated information stored on a memory. large scale. The RETE algorithm is widely used to implement matching • functionality within pattern-matching engines to support the Formal representation of symbolic knowledge on 2 the field in which the system acts. Chain Forward and useful to interface in the formulation and use of the business rules. • Allowing inferences and heuristics to complete knowledge. 4 PaaS Model focused on the business logic • Explanation of the conclusions reached, interacting with the user explaining the line of reasoning We propose a Cloud Computing model [8] that attempts pursued. to conceptualize the development of a platform as a service (PaaS) to support software solutions as a service (SaaS). The Expert Systems constitute efficient help when requiring a model is essentially based on the business layer, taking into good interpretation of complex information, advice on the account that it is in this good level where the development of field in which the works, demanding the main processes and algorithms of the SaaS solution are comparable output from the system to that from human required, leaving a secondary and subordinated rule to the experts. other two layers (Data and interface) in the business layer.

Expert Systems are based on the declarative knowledge (facts In the model, the interface will depend on how we access the about objects, situations) and control knowledge (information SaaS solution (as Internet navigators, mobile devices, about the monitoring of an action). [3] [4]. Expert Systems business logic web services). Data layer is only the object incorporate capacities of explaining the reasoning followed in persistence, the metadata storage of the process structures and the resolution of problems and the acquisition of new the business rules. Figure 1 presents the general scheme of the knowledge, and also they present simple interaction model: procedures with the users [9].

3 RETE Algorithm The RETE algorithm is a pattern matching algorithm for implementing production rule systems. It was designed by Dr. Charles L. Forgy of Carnegie Mellon University. RETE has become the basis for many popular expert systems, including CLIPS, Jess, Drools, and Soar.

2 The RETE algorithm provides a logical description Forward chaining is one of the main methods of reasoning when rules of responsible for matching data tuples (“facts”) against rules in (in artificial intelligence) are used and can be logically described as a pattern-matching production system. A production rule repeated applications of "modus ponens". Its implementation in expert systems and business and productive rule systems is popular. 4.1.3 Business Processes: The Workflow Reference Model defines a business process as a group of one or more connected activities, which collectively make a business goal, normally within the functional structure of an organisation [11]. Business Processes are responsible for organizing the resources of the system by means of the integration of the business rules and business objects and workflow, understanding workflows not only as automata tasks through forms of task assignation to users or roles. The model proposes the management of these BPM 5 processes which are implemented and modelled through BMPN 6.

4.1.4 Interface and Data Layer Interface Layer consists of interfaces or screens showed in the browsers, mobile devices or interfaces to other systems that consume these services. This presentation layer makes Figure 1: Model based on the business logic reference to the web service interface and sends encapsulated 4.1 Business Logic Layer: data in XML messages that only the interface knows. This layer must know the different kind of data and messages that It contains the heart of the system. It is a group of layers can be received by the service interface. with subroutines developing the last goal of the application. It Data Layer is the responsible for passive storage of the object uses interfaces among layers and management interfaces persistence, process structures and businesses rules. The Data oriented to the user in order to produce the parametrical adjust Layer is responsible for the structure definition storage of the of the Business Logic Layer to the requirement changes in the business logic layer and associated data. environment and within the organisation. Business Logic Layer is composed of the following 5 Business Rule Layer: RETE Algorithm interrelated sub-layers: main actor 4.1.1 Business Rules In traditional system development, a change in the business It contains the group of business rules and interferences conditions or rules would involve corrections, additions or corresponding to the service implementation. This layer has updates in code lines, database objects, and stored procedures user tools through the interface layer and this allows for a and in functions or triggers [5]. Complexity associated both quick modification when changes are made in the business with recoding and impact on the system design and test times conditions. This layer is a production rule system, that is, a can confer instability to the system maintenance and 3 Business Rule Management System-BRMS , which allows us exploitation [10]. Under this development scheme, system to configure externally business rules to the application using maintenance becomes more complex and tedious as the them, without modifying the programming code. One example environment changes increasingly. A BRMS assures that the 4 is the use of the RETE algorithm. system adapts to the business rule dynamism and definition modifications, without recoding programs and objects. 4.1.2 Business Objects A Cloud Computing system, in accordance with the features Business Objects are representations of organizational “Scalability”, “Versatility”, “Reliability” and “Elasticity”, concepts and collaborate with others in order to reach business must be efficient in all elements the system is composed of. goals [12]. Business modelling will be given by the relations This ensures that when incorporating an expert system within of the objects, properties and methods, and also the interaction the BRMS business rule layer it must be very efficient [10]. A with the business process layer and business rule layer. simple implementation of an expert system would prove each rule with the facts of the knowledge base, activating the rule, if appropriate, and evaluating the following in a process that can

5 Business Process Management or BPM is the business methodology whose goal is to improve the efficiency through the systematic management of the 3 BRMS or Business Rule Management System is a software system used to business processes which should be continuously modelled, automatized and define, deploy, execute, monitor and maintain the variety and complexity of optimized. As its name suggests, BPM is focused on the management of the decision logic that is used by the operational systems within an organisation business processes. 6 or enterprise. Business Process Modeling Notation or BPMN is a common graphical 4 The RETE algorithm is a pattern matching algorithm which is efficient for notation to bridge the communication gap that frequently occurs between implementing a rule production system. It was created by Dr. Charles L. business process design and public and private processes, orchestration, Forgy of the Carnegie Mellon University. choreography, etc. as well as advanced modelling concepts. be iterative. This algorithm, even for a low number of rules several orders of magnitude (because RETE performance is and facts, can have a very high execution time (making it theoretically independent of the number of rules in the inappropriate for real production systems in the Cloud). system). However, in very large expert systems, RETE usually Therefore, the utility of applying the RETE algorithm to the presents problems because of its great quantity of energy recent system is given by its speed and efficiency [6] and it is consumption. When implementing systems of great consequently used as a basis for more efficient expert system importance as a service (SaaS) and related to the use of the implementations in the Cloud. memory, limitation can be resolved with the “reliability” A RETE-based expert system builds a network of nodes, feature, that is, computing based on interchangeable where each node (except the root) corresponds to a pattern isomorphic nodes which let generate parallelisms [1] resolving occurring in the business condition. Therefore, the path from the problem of memory limitation, Workaround solution 9. the root node to a leaf node defines a complete rule The proposal of improved solution, according to the previous conditional part [7]. Each node has a memory of facts which one, is the use of optimized RETE algorithms, such as “RETE satisfy that pattern. This structure is essentially a special case Plus Algorithm” [10]. of 7 deterministic finite automaton.8 As new facts are asserted or modified, they propagate along the network, causing nodes which are implied in the pattern to 6 Conclusions get active. When a fact or combination of facts causes all of the patterns for a given rule to be satisfied, a leaf node is A Cloud Computing solution in SaaS requires having a reached and the corresponding rule is triggered. steady, elastic, scalable and reliable platform for the adequate delivery of a quality service. The proposed model integrates 5.1 Limitations and Indications the use of a BRMS (RETE algorithm), with Business Objects and Business Processes which constitute the basis of an When developing a business solution SaaS on a PaaS efficient PaaS platform. platform, the considerations that we have to take into account and that take part of the limitations of a RETE-based BRMS A RETE-based BRMS assures that the system which is are: defined according to the proposed model, adapts itself to the • There is a limited relationship between conditions in an dynamism of the environment, through a definition of flexible engine of this kind and the Business Logic problem. network of nodes which models the business rules and proposes an adapted solution to the scalability and elasticity • RETE regular models are based on a structure of facts features searched in a PaaS platform. which are represented by simple groups of 3 elements which can not cover complex business logic.

• There are efficiency problems with large volumes of data 7 References matching [10] . [1] A Computing Mode Suitable for Medium and Small- • RETE sacrifices memory in order to implement processing sized Enterpresis Cloud Computing [Journal] / auth. Wie Liu speed. Memory is a poor resource in the system Liyan Zhang, Chunying Wu, Hongli Cai, Lele Qin. - [s.l.] : IEEE infrastructure. Computer Society, 2010. - 2010 Internacional Conference on Intelligent Computation Technology and Automation. - 978-0- The first two limitations are resolved in the proposed model 7695-4077-1/10. centred in the business logic and presented in Figure 1. The model resolves limitations through the use of a BRMS, [2] Cloud Computing Research and Development Trend complementing with Business Objects its attributes and [Journal] / auth. Shuai Zhang [y otros]. - [s.l.] : IEEE Cpmputer methods (orientation to objects), and process automation and Society, 2010. - 2010 Second International Conference on Future orchestration through BPM. Networks. - 978-7695-3940-9/10. According to the use of the memory and the efficiency of the algorithm with great load of data, RETE (Forward Chaining) [3] Expert Systems, Principles and Programming [Book] / sacrifices memory for increased speed. In most cases, the auth. Giarratano Joseph C. and Riley Gary. - 2005. - ISBN 0- speed increase compared to the simple implementation is 534-38447-1.

7 A Trie is a special case of deterministic finite automaton (Set of states, [4] Introduction to Expert Systems [Book] / auth. Gnizio alphabet which defines the chains, transition function, initial state, set of James. - 1991. - ISBN 0-07-909785-5. acceptation state) and is used to store a set of chains. 8 A finite automaton or finite state machine is a mathematical model which calculates automatically an input in order to get an output. This model is 9 A Workaround is a temporal solution for a known problem, while a composed of an alphabet, a group of states and a group of transactions among definitive solution is searched, if this solution exists. such states. [5] Match Algoriths for generalized RETE networks [Journal] / auth. Lee H. S. and Schor M. L. // Artificial Intelligence. - Vol. 54. - pp. pp. 249-274.

[6] On the efficient implementation of production systems. Ph.D. Thesis, Carnegie-Mellon [Report] / auth. Forgy Charles. - 1979.

[7] RETE : A Fast Algorithm for the Many Pattern/Many Object Pattern Match Problem [Journal] / auth. Forgy Charles // Artificial Intelligence. - 1982. - 19. - pp. 17-37.

[8] Tesis de Máster Oficial de Empresas y Tecnologías de la información [Informe] = Tesis de Máster / aut. Poblete Muñoz Richard. - 2010. - págs. 14-17; 28-45.

[9] The Essence of Expert Systems. Pearson Education [Book] / auth. Darlington Keith. - 2000. - ISBN 0-13-022774-9.

[10] The Improvement Research on Rule Matching Algorithm RETE in Electronic Commerce Application Systemas [Journal] / auth. Wang Dongyun and Ren Zhijun. - Shanghai, China : IEEE, 2008. - 978-1-4244-2108-4.

[11] The Workflow Reference Modelo [Report] / auth. Workflow Management Coalition. - 1995.

[12] Using Roles and Business Objects to Model and Understand Business Processes [Journal] / auth. Artur Caetano António Rito Silva, José Tribolet // 2005 ACM Symposium on Applied Computing. - 2005. - pp. 1308-1313.