Mongodb - Document-Oriented Store
Total Page:16
File Type:pdf, Size:1020Kb
CONTEXT-AWARE SERVICE REGISTRY: MODELING AND IMPLEMENTATION ALAA ALSAIG A THESIS IN THE DEPARTMENT OF COMPUTER SCIENCEAND SOFTWARE ENGINEERING PRESENTEDIN PARTIAL FULFILLMENTOFTHE REQUIREMENTS FORTHE DEGREEOF MASTEROF COMPUTER SCIENCE CONCORDIA UNIVERSITY MONTRÉAL,QUÉBEC,CANADA NOVEMBER 2013 c ALAA ALSAIG, 2013 CONCORDIA UNIVERSITY School of Graduate Studies This is to certify that the thesis prepared By: Miss. Alaa AbdulBasit Alsaig Entitled: Context-Aware Service Registry: Modeling and Implementation and submitted in partial fulfillment of the requirements for the degree of Master in Applied Science (Software Engineering) complies with the regulations of the University and meets the accepted standards with respect to originality and quality. Signed by the final examining committee: ______________________________________ Chair Dr. N. Tsantalis ______________________________________ Examiner Dr. N. Shiri ______________________________________ Examiner Dr. D. Goswami ______________________________________ Co-supervisor Dr. V. S. Alagar ______________________________________ Co-supervisor Dr. M. Mohammad Approved by ________________________________________________ Chair of Department or Graduate Program Director ________________________________________________ Dr. Christopher W. Trueman, Interim Dean Faculty of Engineering and Computer Science Date ________________________________________________ Abstract Context-aware Service Registry: Modeling and Implementation Alaa Alsaig Modern societies have become very dependent on information and services. Technology is adapting to the increasing demands of people and businesses. Context-Aware Systems are becoming ubiquitous. These systems comprise mechanisms to acquire knowledge about the surrounding environment and adapt its behaviour and service provision accordingly. Service- oriented computing is the main stream software development methodology. In Service-oriented Applications (SOA), service providers publish the services created by them in service registries. These services are accessed by service requesters during discovery process. For large scale SOA, the registry structure and the type of quires that it can handle are central to efficient service discovery. Moreover, the role of context in determining services and affecting execution is central. This thesis investigates the structure of a context-aware service registry in which context-aware services are stored by service producers and retrieved by service requesters in different contexts. The thesis builds on an existing rich theoretical service model in which con- tract, functionality, and contexts are bundled together. The thesis investigates generic models and structures for context, context history, and context-aware registry. Also, it studies state of the arts database technologies to analyse its suitability for implementing a registry for rich services. Specifically, the thesis provides a thorough study of the structures, implementation, performance, limitations, and features of Key-Value, Documented Oriented, and Column Ori- ented databases while considering options for implementing a rich service registry. Database models of contexts and context-aware services are discussed and implemented. The relative iii performance of the models are discussed after evaluating the test results run on large data sets. Based upon test results a justification for the selected model is given. iv Acknowledgments I would like to express my sincere thanks to my supervisors professor Vangalur Alagar and Dr.Mubarak Mohammad for their guidance, teaching, and training through the learning process of this master thesis. It has been an honour working with them as they are great sources of knowledge and inspiration and role models for humility and patience. I would not have been able to accomplish my thesis without their educational and personal support. Both have a great understanding which makes them believe in others, motivate them, and give them chances. I would never ask for better supervisors. I have learnt a lot from them throughout the work of my journey towards the masters. I would like to thank my parents who have been always sources of encouragement and support and for having trust on me. Their giving and caring cannot be compensated and thanking them is never enough to express the love and sincerity I have towards them. This love includes all my sisters and brothers that are always there for me. A special thank for my companion in this journey, my brother Ammar. I would not have been able to achieve this without him. In all struggles I had, I found him there standing by my side listening and supporting. I extend my deep thanks to his wife Duaa for her patience and support throughout the whole journey. A great thank for my nieces Wedad and Sarah and my nephew Yassir for adding joy and smiles to my life. A great thank from the heart for all friends in Canada. Their support and caring are unde- niable. They were not only friends but also a family who were there to celebrate my happiness v and cheer me up during my struggles. The kindness and great personalities they have make them very memorable. Undeniably, I learnt a lot from their experiences and guidance. I am so blessed to have them in my life. A special thank for other great people who were helping from overseas and who have never been late to listen, advice and support during these years. The far distance and different time zones were never reasons for ignoring help and support. I cannot express how grateful I am for them. Special gratitude for my brother Dr. Mohammad Alsaig and my professor Dr. Wadee Alhalabi. Moreover, I would like to extend my thanks to Saudi Cultural Bureau for the financial support and help throughout these years. vi Contents List of Figures x List of Tables xiv 1 Introduction 1 1.1 Contribution . 4 2 Literature Review 5 2.1 Summary . 10 3 Context 11 3.1 Context Definition . 12 3.2 Context Type . 14 3.3 Generic Context Model . 16 3.4 Service Context History Model . 21 3.5 Summary . 26 4 Context-Aware Services 27 4.1 Configured Services . 28 4.2 Service . 28 4.3 Contract . 34 vii 4.4 Configured Service Generic Model . 40 4.5 Summary . 43 5 Context-Aware Service Registry 44 5.1 Context-Aware Service Registry . 46 5.1.1 Domain, Sub-Domain and Function . 47 5.1.2 Modeling Domain, Sub-Domain and Function . 52 5.1.3 Service Providers (SP) . 55 5.1.4 Configured Services (CS) . 56 5.2 Context-Aware Service Registry Generic Model . 57 5.3 Summary . 60 6 CASR Implementation in NoSQL Databases 61 6.1 Why NoSql Databases . 61 6.2 Implementation: Redis - Key-Value Store . 64 6.2.1 Redis Features . 64 6.2.2 Design Considerations . 67 6.2.3 Implementing the Domain Knowledge Design . 71 6.2.4 Implementing Provider Design . 77 6.2.5 Implementing Configured Service Design . 77 6.2.6 Implementing Context Design . 80 6.2.7 Implementation Limitations . 82 6.3 Implementation: MongoDB - Document-Oriented Store . 83 6.3.1 MongoDB Features . 84 6.3.2 Design Consideration . 86 6.3.3 MongoDB Implementation . 90 6.3.4 Implementation Limitation . 94 viii 6.4 Implementation: Hbase Column-Oriented Store . 97 6.4.1 Hbase Features . 97 6.4.2 Design Consideration . 100 6.4.3 Table1: Domain, Sub-Domain and Providers in Hbase . 102 6.4.4 Table2: Function in Hbase . 103 6.4.5 Table3: Services in Hbase . 106 6.4.6 Table4: Contract in Hbase . 106 6.4.7 Table5: Context in Hbase . 107 6.4.8 Table6: Followers/SRSPRole in Hbase . 109 6.4.9 Limitations . 109 6.5 Summary . 113 7 Testing and Analysis 114 7.1 YCSB Benchmarking . 114 7.2 General NoSql Characteristics . 118 7.2.1 Redis . 118 7.2.2 MongoDB . 120 7.2.3 Hbase . 122 7.3 Overall Verdict . 123 7.4 Summary . 124 8 Conclusion 125 8.1 Future Work . 126 Bibliography 132 ix List of Figures 1 The Generic Context Model . 16 2 The structure of Context Value . 17 3 The Service Context Instance When No SR in the system . 20 4 The Service Context Instance when SR is in the System . 21 5 Context History Hierarchical Structure . 22 6 The Context History Instance of Internet Service . 24 7 The Context History Instance 2 of Internet Service . 26 8 The Definition of the Configured Services [Ibr12] ................... 28 9 The Generic Structure of Service Functionality . 29 10 Example of Service Functionality Element . 31 11 The Generic Structure of Non-Functionality Properties . 31 12 Example of Service Non-functional Property . 32 13 The Generic Structure of Service Attributes . 33 14 Example of Service Attributes Part . 34 15 Example of Context Element . 36 16 The Generic Structure of Trustwothiness . 37 17 Example of Trustwothiness Element . 37 18 The Generic Structure of Legal Issues . 39 19 Example of Legal Issues Element . 40 x 20 The Generic Structure of Configured Service . 41 21 CarRent Configured Service Example . 42 22 The main structure Service Registry . 45 23 Context-Aware Service Registry Storage structure . 46 24 The Domain, Sub-Domain and Function Definition . 53 25 SP and SR Context Definition . ..