| 研究生: |
吳定威 Wu, Ding Wei |
|---|---|
| 論文名稱: |
支援多租戶應用程式的SQL語句轉換機制 A SQL rewriting mechanism for enabling multi-tenant applications |
| 指導教授: |
陳恭
Chen, Kung |
| 學位類別: |
碩士
Master |
| 系所名稱: |
理學院 - 資訊科學系碩士在職專班 Excutive Master Program of Computer Science |
| 論文出版年: | 2012 |
| 畢業學年度: | 100 |
| 語文別: | 中文 |
| 論文頁數: | 74 |
| 外文關鍵詞: | AspectJ |
| 相關次數: | 點閱:293 下載:46 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
軟體即服務(Software as a Service, SaaS)是雲端運算環境下一種新興的服務模式,它的特色是將特定的應用軟體以共享軟硬體資源的方式供眾多的租戶(tenants)使用。因此,如何提供共用且有客制化功能的應用軟體就是SaaS模式的重要成功關鍵。本研究聚焦於資料庫層提供多租戶共用表格但有客制化功能的機制。讓開發人員延續一租戶一資料表的架構為基礎設計資料庫,透過SQL語句轉換機制,將SQL語句轉換為操作共享表格的語句執行,以大幅減化開發人員的工作。本研究包含兩個部份,一是資料綱要對應表(Schema Mapping Table),協助開發人員將單租戶資料庫架構轉換為塊狀表格(chunk table)的共用資料綱要方式;另一個是SQL語句自動轉換工具,透過剖面技術織入JDBC程式集中,在應用系統執行期間,將SQL語句,從一租戶一資料表寫法轉換為共享表格的方式執行。故只需將資料表改為共用架構即可使用,達到提升多租戶系統開發速度並提高資源使用率的目的。
Software as a service (SaaS) is an emerging service model of cloud computing, which is characterized by providing software that charges on a usage basis over shared hardware and software resources for a large number of tenants to use. Therefore, how to provide shared tables and customization of the applications is an important key to success in the SaaS model. This study focuses on how to enable multi-tenancy on the database layer Developers can extend a private table structure-based application to a shared database one through the proposed SQL rewriting mechanism. This approach can greatly simplify the developer's work. Our approach consists of two parts, first is Schema Mapping Table that helps developers to convert single-tenant database architecture into the chunk table schema; another is SQL statement conversion tools that works by enhancing the JDBC library as an aspect in the AspectJ language. During the execution of the application, a SQL statement is rewritten from the private table based format into chunk table based statement. In this way, we are able to enhance an application with multitenant shared tables that improve resource utilization.
第一章 緒論 8
1.1前言 8
1.2研究動機 8
1.3研究目的 9
1.4研究成果 11
1.5論文大綱 11
第二章 相關研究與技術背景 12
2.1 Aspect-Oriented Programming 12
2.2 AspectJ 16
2.3 Jsqlparser 19
2.4 SaaS Mutil-tenant System 19
2.5 SaaS多租戶系統的資料綱要 21
第三章 系統設計與架構 26
3.1 系統設計理念 26
3.2 系統設計考量 27
3.2.1資料隔離性 27
3.2.2可客製化能力 28
3.2.3設備資源共享 28
3.3 系統流程 29
3.4設計方法 31
3.4.1 資料綱要對應表檔案設計 31
3.4.2 Data Definition Language設計方法 33
3.4.3 Data Manipulation Language設計方法 34
3.4.4 Access SQL改寫 Aspect設計 40
3.4.5 產生具SQL語法改寫功能之JDBC驅動程式 42
第四章 系統實作與展示 44
4.1實作語言與工具 44
4.2系統實作展示 45
4.2.1 實例情境說明與轉換機制 45
4.2.2. JDBC驅動程式with SQL Rewriting實作展示 53
4.3測試數據 66
4.3.1 Chunk table與SQL語句自動轉換測試數據 66
4.3.2. 建立index測試數據 68
第五章 結論與建議 71
5.1 結論 71
5.2 未來發展 72
參考文獻 73
【1】 Stefan Aulbach, Torsten Grust, Dean Jacobs, Alfons Kemper, Jan Rittinger, June 2008, Multi-Tenant Databases for Software as a Service: Schema-Mapping Techniques, ACM SIGMOD.
【2】 Frederick Chong & Gianpaolo Carraro. 2006. Architecture Strategies for Catching the Long Tail. Microsoft Corporation.
【3】 Multi-Tenant Data Architecture http://msdn.microsoft.com/en-us/library/aa479086.aspx
【4】 Berthold Reinwald, 2010, Multitenancy,IBM Almaden Research Center, UW MSR Summer Institute.
【5】 張妏瑛,「應用剖面技術實作資料庫存取應用之偵錯工具」,國立政治大學資訊科學系碩士學位論文,台北,民國98年
【6】 陳恭,「剖面導向程式設計(AOP/AOSD)簡介」
http://www.cs.nccu.edu.tw/~chenk/AOP-intro.pdf
【7】 Java API 1.6
http://download.oracle.com/javase/6/docs/
【8】 MySQL® Connector/J
http://www.mysql.com/products/connector/j/
【9】 The AspectJ Project
http://eclipse.org/aspectj/
【10】 Eclipse
http://www.eclipse.org/
【11】 Java API 1.6
http://docs.oracle.com/javase/6/docs/api/
【12】 JSqlParser parses
http://jsqlparser.sourceforge.net/
【13】 Java Compiler Compiler (JavaCC) - The Java Parser Generator
http://javacc.java.net/
【14】 SQL語法解釋器jsqlparser
http://www.iteye.com/topic/968200