` UNIVERSITA CA’ FOSCARI – VENEZIA Corso di Laurea magistrale (ordinamento ex D.M. 270/2004) in Informatica - Computer Science a.a. 2012-2013 Tesi di Laurea Enterprise Distributed Systems: the case of the Sybase Unwired Platform Laureando: Daniele De Rosa Matricola: 813917 Relatore: Chiar.mo prof. Renzo Orsini Contents 1 Abstract 1 2 Introduction 3 3 Distribuited Systems 7 3.1 Trasparencies . . . . . . . . . . . . . . . . . . . . . . . . . 7 3.2 Middleware . . . . . . . . . . . . . . . . . . . . . . . . . . 8 3.3 Architectural models . . . . . . . . . . . . . . . . . . . . . 10 3.3.1 Client-Server model . . . . . . . . . . . . . . . . . . 10 3.3.2 Client-Server model with multiple server . . . . . . 10 3.3.3 Peer-to-peer model . . . . . . . . . . . . . . . . . . 11 3.3.4 Proxy Server model . . . . . . . . . . . . . . . . . . 12 3.4 Architectural patterns . . . . . . . . . . . . . . . . . . . . 13 3.4.1 Layering . . . . . . . . . . . . . . . . . . . . . . . . 13 3.4.2 Tiered architecture . . . . . . . . . . . . . . . . . . 14 3.5 Addressing . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.5.1 LAN . . . . . . . . . . . . . . . . . . . . . . . . . . 16 3.5.2 Broadcast . . . . . . . . . . . . . . . . . . . . . . . 16 3.5.3 Name Server . . . . . . . . . . . . . . . . . . . . . . 16 3.6 Remote Invocation . . . . . . . . . . . . . . . . . . . . . . 17 3.6.1 Request-reply protocols. . . . . . . . . . . . . . . . 17 3.6.2 Interfaces . . . . . . . . . . . . . . . . . . . . . . . 19 3.6.3 Remote Procedure Call (RPC) . . . . . . . . . . . . 20 3.6.4 Remote Method Invocation(RMI) . . . . . . . . . . 21 3.6.5 Events . . . . . . . . . . . . . . . . . . . . . . . . . 22 iii 3.7 Processes’ scheduling . . . . . . . . . . . . . . . . . . . . . 22 3.8 Mutual Exclusion . . . . . . . . . . . . . . . . . . . . . . . 23 3.8.1 The central server algorithm . . . . . . . . . . . . . 23 3.8.2 Distribuited algorithm . . . . . . . . . . . . . . . . 24 3.8.3 Ring-based algorithm . . . . . . . . . . . . . . . . . 25 3.9 Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 3.9.1 Cristian algorithm . . . . . . . . . . . . . . . . . . 27 3.9.2 Berkeley algorithm . . . . . . . . . . . . . . . . . . 27 3.9.3 Network Time Protocol (NTP) . . . . . . . . . . . 27 3.10 Replication . . . . . . . . . . . . . . . . . . . . . . . . . . 28 4 Sybase Unwired Platform 31 4.1 Platform Solution . . . . . . . . . . . . . . . . . . . . . . . 32 4.1.1 Sybase Unwired Platform Runtime . . . . . . . . . 32 4.2 Cluster and Non-cluster systems . . . . . . . . . . . . . . . 36 4.2.1 Cluster Types . . . . . . . . . . . . . . . . . . . . . 38 4.3 Mobile Business Object (MBO) . . . . . . . . . . . . . . . 41 4.4 Data Synchronization and Data refresh . . . . . . . . . . . 48 4.4.1 Unwired Server Cache . . . . . . . . . . . . . . . . 49 4.4.2 Data Refresh . . . . . . . . . . . . . . . . . . . . . 50 4.4.3 Cache Refresh schedules . . . . . . . . . . . . . . . 52 4.4.4 Data Change Notification (DCN) . . . . . . . . . . 55 4.4.5 Synchronization . . . . . . . . . . . . . . . . . . . . 58 5 Implementation of an HTML5/JS Hybrid Application 63 5.1 The purpose of the application. . . . . . . . . . . . . . . . 65 5.2 Implementation of Mobile Business Object . . . . . . . . . 65 5.2.1 Data Source and Profile Connection . . . . . . . . . 66 5.2.2 Method Definition . . . . . . . . . . . . . . . . . . 67 5.2.3 Load Arguments . . . . . . . . . . . . . . . . . . . 69 5.2.4 Relationship . . . . . . . . . . . . . . . . . . . . . . 70 5.3 Cache Group and Synchronization Group . . . . . . . . . . 72 5.4 Workflow . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 5.4.1 Code HTML5 and Javascript . . . . . . . . . . . . 75 5.4.2 Online Request . . . . . . . . . . . . . . . . . . . . 80 6 Conclusions 89 List of Figures 3.1 Client-server . . . . . . . . . . . . . . . . . . . . . . . . . . 10 3.2 Client-server with multiple server . . . . . . . . . . . . . . 11 3.3 Proxy server . . . . . . . . . . . . . . . . . . . . . . . . . . 12 3.4 Layering . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 3.5 Two-tier solution . . . . . . . . . . . . . . . . . . . . . . . 15 3.6 Three-tier solution . . . . . . . . . . . . . . . . . . . . . . 15 3.7 Name server . . . . . . . . . . . . . . . . . . . . . . . . . . 17 3.8 Request-reply protocols . . . . . . . . . . . . . . . . . . . . 18 3.9 Remote Method Invocation . . . . . . . . . . . . . . . . . 21 3.10 Remote Method Invocation . . . . . . . . . . . . . . . . . 22 3.11 Central Server algorithm . . . . . . . . . . . . . . . . . . . 24 3.12 Ring algorithm . . . . . . . . . . . . . . . . . . . . . . . . 25 3.13 Replication system . . . . . . . . . . . . . . . . . . . . . . 29 3.14 Passive Replication . . . . . . . . . . . . . . . . . . . . . . 30 3.15 Active Replication . . . . . . . . . . . . . . . . . . . . . . 30 4.1 Sybase Unwired Platform . . . . . . . . . . . . . . . . . . 31 4.2 Sybase unwired Platform Runtime . . . . . . . . . . . . . . 33 4.3 Relay Server . . . . . . . . . . . . . . . . . . . . . . . . . . 35 4.4 Non-clustered systems . . . . . . . . . . . . . . . . . . . . 37 4.5 Unwired Platform servers in clusters . . . . . . . . . . . . 38 4.6 Unwired Server cluster . . . . . . . . . . . . . . . . . . . . 39 4.7 Unwired Server connection to Relay Servers in cluster . . . 40 4.8 Mobile Business Object . . . . . . . . . . . . . . . . . . . . 42 4.9 Mobilize EIS data . . . . . . . . . . . . . . . . . . . . . . . 43 4.10 Bind attributes of two MBO . . . . . . . . . . . . . . . . . 45 vii 4.11 Relationship between MBO . . . . . . . . . . . . . . . . . 46 4.12 Data Synchronization and Data Refresh . . . . . . . . . . 48 4.13 Data Refresh . . . . . . . . . . . . . . . . . . . . . . . . . 51 4.14 Data Refresh Initiated by Unwired Server . . . . . . . . . 53 4.15 Data Change Notification . . . . . . . . . . . . . . . . . . 55 4.16 Data Change Notification without payload . . . . . . . . . 56 4.17 Data Change Notification with payload . . . . . . . . . . . 57 4.18 Synchronization . . . . . . . . . . . . . . . . . . . . . . . . 58 4.19 Combine Synchronization and Data Refresh strategies . . . 60 4.20 Synchronization initiated by Unwired Server . . . . . . . . 61 5.1 Hybrid Web Container . . . . . . . . . . . . . . . . . . . . 64 5.2 Possible Data Source . . . . . . . . . . . . . . . . . . . . . 66 5.3 Connection Profile . . . . . . . . . . . . . . . . . . . . . . 67 5.4 Method definition . . . . . . . . . . . . . . . . . . . . . . . 67 5.5 Attributes mapping . . . . . . . . . . . . . . . . . . . . . . 68 5.6 MBO of the output tables . . . . . . . . . . . . . . . . . . 69 5.7 Search person BP scrren . . . . . . . . . . . . . . . . . . . 69 5.8 Personalization Key . . . . . . . . . . . . . . . . . . . . . . 70 5.9 Load Arguments . . . . . . . . . . . . . . . . . . . . . . . 70 5.10 Relationships . . . . . . . . . . . . . . . . . . . . . . . . . 71 5.11 One-to-many and composite . . . . . . . . . . . . . . . . . 71 5.12 Relationship between MBO . . . . . . . . . . . . . . . . . 72 5.13 Cache Group Policies . . . . . . . . . . . . . . . . . . . . . 72 5.14 Cache Group . . . . . . . . . . . . . . . . . . . . . . . . . 73 5.15 Cache Group divided . . . . . . . . . . . . . . . . . . . . . 74 5.16 Synchronization . . . . . . . . . . . . . . . . . . . . . . . . 74 5.17 Synchronization interval . . . . . . . . . . . . . . . . . . . 74 5.18 Start page . . . . . . . . . . . . . . . . . . . . . . . . . . . 75 5.19 Pop-up confirmation window closing. . . . . . . . . . . . . 80 5.20 Search person BP scrren . . . . . . . . . . . . . . . . . . . 84 5.21 Online Request . . . . . . . . . . . . . . . . . . . . . . . . 84 5.22 Personalization Key mapping . . . . . . . . . . . . . . . . 85 5.23 List of the person BP with surname Monti . . . . . . . . . 85 5.24 Details of person BP Ambrogio Monti . . . . . . . . . . . . 86 Chapter 1 Abstract Analysisofadistributedsystem, openproblemsandchallenges. Descrip- tion the distributed system Sybase Unwired Platform (SUP) and how it solves such problems. Implementation of a mobile application hybrid through the SUP. 1 Chapter 2 Introduction In this paper we will analyze two systems that are spreading more and more in our everyday lives. One is more visible, and it is the mobile system, the other is the distributed system. Theadventofsmartphones, andthecontinuousgrowingoftheircomput- ing power, has meant that they can often replace the normal computer, with the significant advantage of being always handy, in the true sense of the word. They can now in fact perform various activities, from those working to those of leisure. The services available are very often used on our devices thanks to the implementation of distributed systems: they in fact allow the collabo- ration of several calculation units, independent of each other, for the achievement of the intended purpose, for example the use of a mobile application. Distributed systems, however, present many challenges to their imple- mentation and use, due to the diversity of the devices involved, the va- riety of communication protocols to connect them to each other, for the di↵erent platforms and programming languages used by each of them. It also added the di�culties related to the scalability of the system, with- out reducing the performance and consistency of the data. A number of issues, as can be noted, which must from time to time find answer. I had the opportunity to meet with all of these issues when I did my 3
Description: