[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

JP2011113103A - Multi-tenant type computer system - Google Patents

Multi-tenant type computer system Download PDF

Info

Publication number
JP2011113103A
JP2011113103A JP2009265868A JP2009265868A JP2011113103A JP 2011113103 A JP2011113103 A JP 2011113103A JP 2009265868 A JP2009265868 A JP 2009265868A JP 2009265868 A JP2009265868 A JP 2009265868A JP 2011113103 A JP2011113103 A JP 2011113103A
Authority
JP
Japan
Prior art keywords
information
processing apparatus
client computer
information processing
management information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2009265868A
Other languages
Japanese (ja)
Inventor
Atsuyuki Inui
敦行 乾
Hirofumi Nagasuga
弘文 長須賀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP2009265868A priority Critical patent/JP2011113103A/en
Publication of JP2011113103A publication Critical patent/JP2011113103A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

【課題】既存のアプリケーションを変更することなく、複数ユーザがコンピュータシステムのデータベースにアクセスすることを可能とする。
【解決手段】
複数のクライアントコンピュータに接続する情報処理装置であって、第1のクライアントコンピュータより第1のリクエストを受信した場合、第1のクライアントコンピュータに関する情報を第1の管理情報に格納し、データベースにアクセスするアクセス言語を作成する場合、第1の管理情報より第1のクライアントコンピュータに関する情報を読み出し、アクセス言語に含まれるテーブル名に第1のクライアントコンピュータに関する情報を付加し、作成したアクセス言語を用いて前記データベースにアクセスする、情報処理装置である。
【選択図】図3
A plurality of users can access a database of a computer system without changing an existing application.
[Solution]
When an information processing apparatus connected to a plurality of client computers receives a first request from a first client computer, information relating to the first client computer is stored in the first management information and a database is accessed. When creating an access language, information about the first client computer is read from the first management information, information about the first client computer is added to the table name included in the access language, and the access language is used to create the access language. An information processing apparatus that accesses a database.
[Selection] Figure 3

Description

本発明は、複数のユーザ(組織)により利用されるコンピュータシステムに関し、特にテーブルをユーザ(組織)毎に格納するデータベースへアクセスするサーバに関する。   The present invention relates to a computer system used by a plurality of users (organizations), and more particularly to a server that accesses a database storing a table for each user (organization).

これまでクライアント上で実行するデスクトップアプリケーションとして実装されてきた企業内の業務システムの多くがWeb上のサービスである、SaaS(Software as a Service)として提供されはじめている。   Many enterprise business systems that have been implemented as desktop applications executed on clients so far have begun to be provided as SaaS (Software as a Service), which is a service on the Web.

SaaSを提供するコンピュータシステムの特徴として、マルチテナント型のコンピュータシステムが挙げられる。マルチテナントとは、複数のユーザ(組織、又はテナントとも言う。)が、1つのコンピュータシステム(例えば、サーバ及びデータベースを含む。)にアクセスする形態を意味する。マルチテナント型のコンピュータシステムを提供するためには、データを格納するデータベースにおいてユーザごとにデータを管理する必要がある。ここでデータベースとは、例えばOracle(登録商標) Database、MySQL(登録商標)、PostgreSQL(米国の登録商標)などのリレーショナルデータベースのことを指す。リレーショナルデータベースは、同じ種類のデータの集合をテーブル単位で管理するデータベースを指す。例えばユーザに関するデータはusersテーブルで、本に関するデータはbooksテーブルで管理する。テーブルはデータの属性を表すカラムを持っている。例えばユーザの名前属性はusersテーブルのnameカラムに保存する。   A characteristic of a computer system that provides SaaS is a multi-tenant computer system. The multi-tenant means a form in which a plurality of users (also referred to as organizations or tenants) access one computer system (for example, including a server and a database). In order to provide a multi-tenant computer system, it is necessary to manage data for each user in a database storing data. Here, the database refers to a relational database such as Oracle (registered trademark) Database, MySQL (registered trademark), or PostgreSQL (registered trademark in the United States). A relational database refers to a database that manages a set of data of the same type in units of tables. For example, data related to users is managed in the users table, and data related to books is managed in the books table. The table has columns that represent data attributes. For example, the user name attribute is stored in the name column of the users table.

特許文献1には、マルチテナントデータベース環境の構築方法に関する技術が開示されている。特許文献1に記載の技術により、1つのデータベースを複数の組織のユーザが利用することが可能となる。   Patent Document 1 discloses a technique related to a method for constructing a multi-tenant database environment. With the technology described in Patent Document 1, users of a plurality of organizations can use one database.

特表2009−518713Special table 2009-518713

特許文献1に記載の技術では、次で説明するようにデータベースの構造が特殊であり、様々な問題が生じる。   In the technique described in Patent Document 1, the structure of the database is special as described below, and various problems occur.

図1乃至図2を用いて特許文献1に記載のマルチテナントデータベース環境にてアクセスされるデータベースの構造の概要を説明する。   The outline of the structure of the database accessed in the multi-tenant database environment described in Patent Document 1 will be described with reference to FIGS.

図1は、データベースの構造の一例を示す図である。データベースは、Dataテーブル110、Objectsテーブル120、Fieldsテーブル130からなる。Dataテーブル110は、実際の値を格納する。Fieldsテーブル130は、Dataテーブル110の値が、どのフィールド属するかを表す。   FIG. 1 is a diagram illustrating an example of the structure of a database. The database includes a Data table 110, an Objects table 120, and a Fields table 130. The Data table 110 stores actual values. The Fields table 130 indicates which field the value of the Data table 110 belongs to.

図2は、引用文献1のマルチテナントデータベース環境において管理されている統合テーブル210の一例を示す。「OrgID212」は、組織名(組織X、組織Y)を示す。つまり、複数の組織のテーブルを組織ごとに管理せずに、統合テーブルとして1つのDataテーブルである統合テーブル210にて管理する。
他のカラムは、以下の内容を示す。GUID211は、レコードごとに付与されるユニークなIDである。ObjID212は、レコードが所属するグループを表す。関連するレコードは同じObjIDを持つ。レコードの値は、Value1 215、Value2 216、・・・に格納され、これらがどのフィールドの値だったかは別のFieldsテーブルを参照することにより把握される。
FIG. 2 shows an example of the integrated table 210 managed in the multi-tenant database environment of the cited document 1. “OrgID 212” indicates an organization name (organization X, organization Y). That is, a plurality of organization tables are not managed for each organization, but are managed as an integrated table by the integrated table 210 that is one Data table.
The other columns show the following contents. The GUID 211 is a unique ID assigned to each record. ObjID 212 represents a group to which the record belongs. Related records have the same ObjID. The value of the record is stored in Value1 215, Value2 216,..., And it is grasped by referring to another Fields table which field value these are.

このように、従来のマルチテナントデータベース環境においては、新たに組織名を示す「OrgID212」の列を追加して管理しなければならず、既存のアプリケーションのデータベースの構造と異なるため、構造の異なるデータベースへアクセスするための新規にアプリケーションを開発するか、既存のアプリケーションのソースコードを修正する必要があるという課題がある。   As described above, in the conventional multi-tenant database environment, a new column “OrgID 212” indicating the organization name must be added and managed. There is a problem that it is necessary to develop a new application to access the application or to modify the source code of an existing application.

上記課題を解決するための情報処理装置は、複数のクライアントコンピュータに接続する情報処理装置であって、前記複数のクライアントコンピュータから受信したリクエスト毎に関連する処理を管理する複数の管理情報と、を格納するメモリと、前記メモリに格納される前記複数の管理情報を参照して、前記リクエストに関する処理を実行するプロセッサと、前記複数のクライアントコンピュータに関する情報を含むテーブル名を有する複数のテーブルから構成されるデータベースを格納する記憶装置と、を含み、前記プロセッサは、複数のクライアントコンピュータに含まれる第1のクライアントコンピュータより第1のリクエストを受信した場合、前記第1のクライアントコンピュータに関する情報を前記第1のリクエストに関連する第1の管理情報に格納し、前記プロセッサは、前記第1のリクエストをもとに前記データベースにアクセスするアクセス言語を作成する場合、前記第1の管理情報より前記第1のクライアントコンピュータに関する情報を読み出し、前記アクセス言語に含まれるアクセス先テーブル名に前記第1のクライアントコンピュータに関する情報を付加し、前記プロセッサは、前記作成したアクセス言語を用いて前記データベースにアクセスする、ことを特徴とする情報処理装置である。   An information processing apparatus for solving the above problems is an information processing apparatus connected to a plurality of client computers, and a plurality of management information for managing processing related to each request received from the plurality of client computers. A memory for storing, a processor for executing processing relating to the request with reference to the plurality of management information stored in the memory, and a plurality of tables having table names including information relating to the plurality of client computers. And a storage device for storing the database, wherein when the processor receives a first request from a first client computer included in a plurality of client computers, the processor receives information about the first client computer. Related to requests When the processor creates an access language for accessing the database based on the first request, the processor reads information on the first client computer from the first management information. An information processing apparatus characterized in that information on the first client computer is added to an access destination table name included in the access language, and the processor accesses the database using the created access language. It is.

本発明によれば、既存のアプリケーションを変更することなく、複数ユーザがコンピュータシステムのデータベースにアクセス可能となる。   According to the present invention, a plurality of users can access a database of a computer system without changing an existing application.

データベースの構造の一例を示す図である。It is a figure which shows an example of the structure of a database. 従来技術のマルチテナントデータベース環境において管理されてているテーブルの例を示す。An example of a table managed in a conventional multi-tenant database environment is shown. 実施例1における、コンピュータシステムの全体構成を示す図である。1 is a diagram illustrating an overall configuration of a computer system in Embodiment 1. FIG. 実施例1における、組織ごとの情報を含むテーブルの一例を示す図である。It is a figure which shows an example of the table containing the information for every structure | tissue in Example 1. FIG. 実施例1における、スレッド管理情報の一例を示す図である。6 is a diagram illustrating an example of thread management information in Embodiment 1. FIG. 実施例1における、スレッドスケジューリングプログラムの処理の一例を示す図である。6 is a diagram illustrating an example of processing of a thread scheduling program in Embodiment 1. FIG. 実施例1における、マルチテナント対応認証プログラムの処理の一例を示す図である。It is a figure which shows an example of a process of the multitenant corresponding | compatible authentication program in Example 1. FIG. 実施例1における、マルチテナント対応データベース接続プログラムの処理の一例を示す図である。It is a figure which shows an example of a process of the multi tenant corresponding | compatible database connection program in Example 1. FIG. 実施例1における、データベース接続管理情報の一例を示す図である。It is a figure which shows an example of the database connection management information in Example 1. 実施例2における、コンピュータシステムの全体構成を示す図である。FIG. 10 is a diagram illustrating an overall configuration of a computer system according to a second embodiment. 実施例2における、マルチテナント対応データベース接続プログラムBの処理を示す図である。It is a figure which shows the process of the multitenant corresponding | compatible database connection program B in Example 2. FIG.

以下、図面を参照して、本発明の実施例の一例を説明する。   Hereinafter, an example of an embodiment of the present invention will be described with reference to the drawings.

以下、本発明を実施するための第1の形態を説明する。   Hereinafter, a first embodiment for carrying out the present invention will be described.

図3は、本実施例における、コンピュータシステムの全体構成図である。
本発明の実施の形態に係るコンピュータシステムには、ネットワークに接続された複数の情報処理装置301、310が含まれる。情報処理装置には、クライアントコンピュータである1台以上の情報処理装置(以下、クライアント)310、クライアントからのリクエストを受け付けて処理を行う情報処理装置(以下、サーバ)301、が含まれる。なお、クライアント310は、ユーザの数だけ存在しうるが、図3では説明のため2つだけ示している。従って、クライアント310の数はこれに限定されるものではない。
FIG. 3 is an overall configuration diagram of the computer system in the present embodiment.
The computer system according to the embodiment of the present invention includes a plurality of information processing apparatuses 301 and 310 connected to a network. The information processing apparatus includes one or more information processing apparatuses (hereinafter referred to as clients) 310 that are client computers, and an information processing apparatus (hereinafter referred to as servers) 301 that receives and processes requests from the clients. Although there can exist as many clients 310 as there are users, only two clients 310 are shown in FIG. Therefore, the number of clients 310 is not limited to this.

クライアント310を利用するユーザは「組織」に属している。「組織」とは、例えばA会社や、B部署などであり、その単位は限定されるものではない。そして、クライアント310は、本マルチテナント対応アプリケーションを利用するために、サーバ301に対して組織名情報を含んだ認証情報を送信する。認証情報の一例として、ユーザIDに、組織名を付加する方法がある。組織xxxに属するユーザaaaの場合、aaa@xxxである。   A user who uses the client 310 belongs to “organization”. The “organization” is, for example, company A or department B, and the unit is not limited. Then, the client 310 transmits authentication information including the organization name information to the server 301 in order to use this multi-tenant compatible application. As an example of authentication information, there is a method of adding an organization name to a user ID. In the case of the user aaa belonging to the organization xxx, it is aaa @ xxx.

以下、各構成要素について説明する。
サーバ301は、テーブルなどの情報やプログラムを格納するメモリ302、メモリに格納されるプログラムを読み出して実行するCPU311、複数のハードディスクを含みデータベースに関連するデータを格納する外部記憶装置312を含む。なお、外部記憶装置312は、ハードディスクだけでなく、データを記憶するための媒体であればよく、フラッシュメモリなどでもよい。また、本実施例では、外部記憶装置312として説明するが、記憶装置を意味する。
サーバ301のオペレータ(管理者)は、マルチテナント対応認証プログラム305と、マルチテナント対応データベース接続プログラム307と、データベース接続プログラム306と、アプリケーションプログラム309と、データベース管理プログラム310と、をまず外部記憶装置に格納する。CPUにより実行されるオペレーティングシステム(以下、OS:Operating System)317が、これらのプログラムを呼び出し、実行する際はメモリに格納されるため、以降、これらのプログラムはメモリに格納されているものとする。また、以下、OS317や各プログラムを主語にして、実行される処理を説明するが、実際にはCPU311がメモリ302からOS317や各プログラムを読み出し、各処理を実行することを意味する。また、各プログラムにより実行される処理は、フローチャートを用いて後に詳述する。
Hereinafter, each component will be described.
The server 301 includes a memory 302 that stores information such as a table and a program, a CPU 311 that reads and executes a program stored in the memory, and an external storage device 312 that includes a plurality of hard disks and stores data related to a database. The external storage device 312 is not limited to a hard disk, but may be a medium for storing data, and may be a flash memory or the like. In this embodiment, the external storage device 312 will be described, but it means a storage device.
The operator (administrator) of the server 301 first loads the multi-tenant compatible authentication program 305, the multi-tenant compatible database connection program 307, the database connection program 306, the application program 309, and the database management program 310 into the external storage device. Store. Since an operating system (hereinafter referred to as OS: Operating System) 317 executed by the CPU calls and executes these programs, the programs are stored in the memory, and hence these programs are stored in the memory hereinafter. . In the following, the processing to be executed will be described with the OS 317 and each program as the subject, but in practice, this means that the CPU 311 reads the OS 317 and each program from the memory 302 and executes each processing. The processing executed by each program will be described in detail later using a flowchart.

外部記憶装置312には、アプリケーションプログラム309がマルチテナント対応データベース接続プログラム306を通してアクセスするデータベース308を管理し、データベース308に関連するテーブルの情報が格納されている。データベースのテーブルは、組織X用テーブル321、組織Y用テーブル322のように組織ごとに分ける。そして、各テーブルには、「製品情報@組織X」「製品情報@組織Y」のように、情報名と組織名とを含む名称(例えば、ID)が割り当てられる。図4は、組織ごとに、製品情報と顧客情報とを含む別々のテーブルで管理する一例を示す図である。図4は、組織Xの商品情報411(名称:製品情報@組織X)と顧客情報412(名称:顧客情報@組織X)と、組織Yの商品情報421(名称:製品情報@組織Y)と顧客情報422(名称:顧客情報@組織Y)と、を表すテーブルを示す。
また、図3の例では、データベース308はサーバ301に含まれる外部記憶装置312に格納されている、サーバ301が別のデータベースサーバと接続し、該別のデータベースサーバが持つ外部記憶装置にデータベースを格納するようにしてもよい。また、外部記憶装置312が、別筐体のストレージ装置として、サーバ301の外部に存在する構成であってもよい。
The external storage device 312 manages a database 308 that is accessed by the application program 309 through the multi-tenant compatible database connection program 306, and stores information on tables related to the database 308. The database table is divided for each organization such as an organization X table 321 and an organization Y table 322. Each table is assigned a name (for example, ID) including an information name and an organization name such as “product information @ organization X” and “product information @ organization Y”. FIG. 4 is a diagram illustrating an example of management for each organization using separate tables including product information and customer information. FIG. 4 shows product information 411 (name: product information @ organization X) of organization X, customer information 412 (name: customer information @ organization X), and product information 421 (name: product information @ organization Y) of organization Y. The table showing customer information 422 (name: customer information @ organization Y) is shown.
In the example of FIG. 3, the database 308 is stored in the external storage device 312 included in the server 301. The server 301 is connected to another database server, and the database is stored in the external storage device of the other database server. You may make it store. Further, the external storage device 312 may be configured to exist outside the server 301 as a separate storage device.

メモリ302には、OS317、スレッド管理情報313、マルチテナント対応プログラム319、データベース接続管理情報323が格納されている。
OS317はスレッドスケジューリングプログラム318を含む。OS317は、サーバ301がクライアント310からのリクエストを受け付けた場合、スレッドスケジューリングプログラム318を実行し、各マルチテナント対応プログラム319を実行することでリクエストを処理する。スレッドスケジューリングプログラム318は、1つのリクエストに対し1つのスレッドを作成する。スレッドとはプログラムを実行する状態のことを指し、スレッド管理情報313にて管理される。
The memory 302 stores an OS 317, thread management information 313, a multi-tenant correspondence program 319, and database connection management information 323.
The OS 317 includes a thread scheduling program 318. When the server 301 accepts a request from the client 310, the OS 317 executes the thread scheduling program 318 and executes the multi-tenant correspondence program 319 to process the request. The thread scheduling program 318 creates one thread for one request. A thread refers to a state in which a program is executed, and is managed by thread management information 313.

スレッド管理情報313は、スタック414、CPUレジスタ415、スレッドローカル領域416を含む。
図5は、本実施例における、スレッド管理情報313の一例を示す図である。なお、図5に記載のスレッド管理情報313のフォーマットは一例であって、図5に示したフォーマットに限定されるものではない。OSによって複数のスレッドを管理しているが、本実施例においては、各スレッドごとに該スレッド管理情報を保持する。
図4のスタック414に該当するのが、局所変数である。局所変数1〜nは、プログラムにおける関数などの局所的に使用する変数である。つまり、スタック414に格納されるデータは、プログラム間で共有することができず、特定のプログラムに対して特定の領域が割り当てられている。
図4のCPUレジスタ415に該当するのが、プログラムカウンタやスタックカウンタである。プログラムカウンタはこのスレッドが現在プログラムのどこを実行しているかの情報を持つ。スタックカウンタは現在のスタックの位置である。
図4のスレッドローカル領域416に該当するのが、スレッドローカル変数である。スレッドローカル変数は同一スレッド内で動くプログラム間で共有できる変数である。そして、後で詳述するようにスレッドローカル領域416に、リクエスト発行元の組織名が格納される。
上記のように、スレッド管理情報の格納領域には、プログラム間で情報を共有できない領域と、プログラム間で情報を共有できる領域がある。スレッドローカル領域416に情報を格納することで、プログラム間で情報を共有できる。本実施例では、スレッドローカル領域416に組織名を格納することにより、マルチテナント対応認証プログラム305と、マルチテナントデータベース接続プログラム407と、アプリケーションプログラム309とで組織名情報を共有することができる。
The thread management information 313 includes a stack 414, a CPU register 415, and a thread local area 416.
FIG. 5 is a diagram illustrating an example of the thread management information 313 in the present embodiment. Note that the format of the thread management information 313 illustrated in FIG. 5 is an example, and is not limited to the format illustrated in FIG. Although a plurality of threads are managed by the OS, in this embodiment, the thread management information is held for each thread.
A local variable corresponds to the stack 414 in FIG. Local variables 1 to n are variables used locally such as functions in a program. That is, the data stored in the stack 414 cannot be shared between programs, and a specific area is assigned to a specific program.
A program counter and a stack counter correspond to the CPU register 415 in FIG. The program counter has information about where this thread is currently executing in the program. The stack counter is the current stack position.
A thread local variable corresponds to the thread local area 416 in FIG. Thread local variables are variables that can be shared between programs running in the same thread. As will be described in detail later, the organization name of the request issue source is stored in the thread local area 416.
As described above, the thread management information storage area includes an area where information cannot be shared between programs and an area where information can be shared between programs. By storing information in the thread local area 416, information can be shared between programs. In this embodiment, by storing the organization name in the thread local area 416, the organization name information can be shared by the multi-tenant authentication program 305, the multi-tenant database connection program 407, and the application program 309.

図6は、実施例1における、スレッドスケジューリングプログラム318の処理の一例を示す図である。
スレッドスケジューリングプログラム318は、サーバ301がある組織からリクエストを受信した場合に、どのスレッドにて処理を行うか(どのスレッド管理情報を用いて処理を行うか)を決定する。(ステップ600)例えば、どの処理にも利用されていないスレッド管理情報の領域がある場合には、そのスレッド管理情報の領域を用いて受信したリクエストの処理を行う、と決定する。マルチテナント認証プログラムを実行(ステップ601)する。その後、スレッドスケジューリングプログラム318は、アプリケーションプログラムを実行(ステップ602)する。
FIG. 6 is a diagram illustrating an example of processing of the thread scheduling program 318 according to the first embodiment.
When the server 301 receives a request from a certain organization, the thread scheduling program 318 determines which thread performs processing (which thread management information is used for processing). (Step 600) For example, when there is an area of thread management information that is not used for any processing, it is determined that the received request is processed using the area of the thread management information. A multi-tenant authentication program is executed (step 601). Thereafter, the thread scheduling program 318 executes the application program (step 602).

図7は、本実施例の図6のステップ601における、マルチテナント対応認証プログラム305の処理の一例を示す図である。
マルチテナント対応認証プログラム305は、クライアント310から受信したリクエストを取得する(ステップ701)。
マルチテナント対応認証プログラム305は、クライアントとサーバとの間のセッションが確立されているか確認する(ステップ702)。
マルチテナント対応認証プログラム305は、セッションが確立されていない場合、認証情報の有無を確認する(ステップ704)。ここで、クライアント310から受信する認証情報には、上記の通り組織名(ユーザ名、クライアント名等)に関する情報が含まれている。
FIG. 7 is a diagram illustrating an example of processing of the multi-tenant authentication program 305 in step 601 of FIG. 6 according to the present embodiment.
The multi-tenant authentication program 305 acquires the request received from the client 310 (step 701).
The multi-tenant authentication program 305 confirms whether a session is established between the client and the server (step 702).
When the session is not established, the multi-tenant authentication program 305 confirms the presence / absence of authentication information (step 704). Here, the authentication information received from the client 310 includes information on the organization name (user name, client name, etc.) as described above.

マルチテナント対応認証プログラム305は、認証情報がない場合は、クライアント310に対して認証情報を要求する(ステップ707)。そして、その後ステップ705を実行する。
マルチテナント対応認証プログラム305は、認証情報があった場合、セッションの作成の可否を判断し、「可」の場合にはセッションを作成する(705)。セッションを作成する際には、セッションを確立したサーバに関する情報や、認証情報に含まれる組織名を含むセッション情報を作成する。
その後、ステップ600で決定された受信したリクエストを実行するスレッドを管理するためのスレッド管理情報に含まれるスレッドローカル領域に、認証情報又は作成したセッション情報から取得できる組織名を格納する(703)。
マルチテナント対応認証プログラム305は、ステップ702でセッションが確立されている場合には、ステップ600で決定された受信したリクエストを実行するスレッドを管理するためのスレッド管理情報に含まれるスレッドローカル領域に、セッション情報から取得した組織名を格納する(ステップ703)。
If there is no authentication information, the multi-tenant authentication program 305 requests authentication information from the client 310 (step 707). Then, step 705 is executed.
If there is authentication information, the multi-tenant authentication program 305 determines whether or not a session can be created, and if “Yes”, creates a session (705). When creating a session, session information including information about the server that established the session and the organization name included in the authentication information is created.
Thereafter, the organization name that can be acquired from the authentication information or the created session information is stored in the thread local area included in the thread management information for managing the thread that executes the received request determined in step 600 (703).
When the session is established in step 702, the multi-tenant authentication program 305 stores the thread local area included in the thread management information for managing the thread that executes the received request determined in step 600. The organization name acquired from the session information is stored (step 703).

図8は、本実施例の図6のステップ602における、アプリケーションプログラム309の処理の一例を示す図である。   FIG. 8 is a diagram illustrating an example of processing of the application program 309 in step 602 of FIG. 6 according to the present embodiment.

アプリケーションプログラム309は、図9に示すデータベース接続管理情報323で指定されているデータベース接続プログラムを用いてデータベースに接続する。図9は、本実施例における、データベース接続管理情報323の一例を示す。データベース接続管理情報323は、データベース接続プログラム名4231、データベースに接続するためのユーザ名4232とパスワード4233を格納する。
複数の組織によりサーバを介してデータベースへアクセスする構成であるマルチテナント型コンピュータシステムとする前の通常のアプリケーションでは、データベース接続管理情報323に通常のデータベース接続プログラム306を格納する。
複数の組織によりサーバを介してデータベースへアクセスする構成であるマルチテナント型のコンピュータシステムとする場合は、データベース接続管理情報323にマルチテナント対応データベース接続プログラム307を格納する。つまり、通常のデータベース接続プログラム306に加えて、アクセス先のテーブルの名前に組織名を付加する処理を実行するプログラムを使用する。
The application program 309 connects to the database using the database connection program specified by the database connection management information 323 shown in FIG. FIG. 9 shows an example of the database connection management information 323 in the present embodiment. The database connection management information 323 stores a database connection program name 4231, a user name 4232 for connecting to a database, and a password 4233.
In a normal application before a multi-tenant computer system configured to access a database via a server by a plurality of organizations, a normal database connection program 306 is stored in the database connection management information 323.
In the case of a multi-tenant computer system configured to access a database via a server by a plurality of organizations, the multi-tenant compatible database connection program 307 is stored in the database connection management information 323. That is, in addition to the normal database connection program 306, a program for executing processing for adding the organization name to the name of the access destination table is used.

マルチテナント化後のアプリケーションでは、アプリケーションプログラム309はマルチテナント対応データベース接続プログラム307を用いてデータベース308へアクセスする。マルチテナント対応データベース接続プログラム307の処理を以下に説明する。ステップ802〜ステップ805において、マルチテナント対応データベース接続プログラム307は、スレッドスケジューリングプログラム418から受信したSQL(Structured Query Language)文に含まれるテーブル名に、リクエストを実行するスレッドを管理するためのスレッド管理情報に含まれるスレッドローカル領域416に格納される組織名を付加する処理を行う。ここで、SQL文とは、データベースにアクセスするための言語である。   In the application after multi-tenancy, the application program 309 accesses the database 308 using the multi-tenant compatible database connection program 307. The processing of the multi-tenant compatible database connection program 307 will be described below. In step 802 to step 805, the multi-tenant compatible database connection program 307 uses the thread management information for managing the thread that executes the request in the table name included in the SQL (Structured Query Language) statement received from the thread scheduling program 418. The process of adding the organization name stored in the thread local area 416 included in is performed. Here, the SQL sentence is a language for accessing the database.

マルチテナント対応データベース接続プログラム307は、スレッドスケジューリングプログラム418から受信した、リクエストを実行するスレッドを管理するためのスレッド管理情報に含まれるスレッドローカル領域416から組織名を取得する(ステップ801)。
マルチテナント対応データベース接続プログラム307は、アプリケーションプログラム309から受け取ったSQL文を空白文字で分解する(ステップ802)。例えば「select * from users」というSQL文を受信した場合、「select」「*」「from」「users」の4つの単語に分解する。
マルチテナント対応データベース接続プログラム307は、into、from、tableの次の単語に組織名を付加する(ステップ803)。SQLの構文規則によれば、これらの単語のあとに続く単語はテーブル名だからである。
マルチテナント対応データベース接続プログラム307は、ドットの前の単語に組織名を付加する(ステップ804)。SQLの構文規則によれば、ドットの前の単語はテーブル名だからである。
マルチテナント対応データベース接続プログラム307は、最後に単語を空白文字で結合し(ステップ805)する。例えば「select」「*」「from」「X_users」の各単語を空白文字で結合すると「select * from X_users」となる。
The multi-tenant correspondence database connection program 307 acquires the organization name from the thread local area 416 included in the thread management information received from the thread scheduling program 418 for managing the thread for executing the request (step 801).
The multi-tenant correspondence database connection program 307 decomposes the SQL sentence received from the application program 309 with a blank character (step 802). For example, when an SQL sentence “select * from users” is received, it is decomposed into four words “select”, “*”, “from”, and “users”.
The multi-tenant correspondence database connection program 307 adds an organization name to the next word after into, from, and table (step 803). This is because the words following these words are table names according to the SQL syntax rules.
The multi-tenant correspondence database connection program 307 adds the organization name to the word before the dot (step 804). This is because, according to SQL syntax rules, the word before the dot is a table name.
The multi-tenant correspondence database connection program 307 finally combines words with a blank character (step 805). For example, if the words “select”, “*”, “from”, and “X_users” are combined with a blank character, “select * from X_users” is obtained.

マルチテナント対応データベース接続プログラム307は、組織名を付加したSQL文を用いてデータベース接続プログラム306を実行する(906)。   The multi-tenant compatible database connection program 307 executes the database connection program 306 using the SQL statement with the organization name added (906).

例えば組織名がXで「select users.name from users」というSQL文の場合、マルチテナント対応データベース接続プログラム307は、「select X_users.name from X_users」というSQL文に変換し、変換後のSQL文を用いてデータベース接続プログラム306を実行する。データベース接続プログラム306は、データベース管理プログラム310にSQL文を渡し、データへのアクセスを依頼する。データベース管理プログラム310はMySQL、OracleDB、PostgreSQLなどのDBMSである。データベース管理プログラム310は受け取ったSQL文に含まれる組織名(例えば、X)を参照して、組織名X用のテーブル421(製品情報@組織X411や顧客情報@組織X412)にアクセスすることができる。   For example, if the organization name is X and the SQL statement “select users.name from users” is selected, the multi-tenant compatible database connection program 307 converts the SQL statement after conversion into an SQL statement “select X_users.name from X_users”. The database connection program 306 is executed using the database connection program 306. The database connection program 306 passes an SQL statement to the database management program 310 and requests access to data. The database management program 310 is a DBMS such as MySQL, OracleDB, or PostgreSQL. The database management program 310 can access the organization name X table 421 (product information @ organization X411 and customer information @ organization X412) with reference to the organization name (for example, X) included in the received SQL statement. .

以上説明したように、本実施例では、リクエストを受領した時に、スレッドごとにアクセス元の組織をスレッド管理情報により管理する。そして、該スレッドのスレッド管理情報を用いて実行されるアプリケーションがデータベースにアクセスする際に、アクセス元組織名をSQL文に追加しすることにより、既存のテーブルにアクセスすることが可能となる。これにより、単一の組織によりアクセスされていたデータベースを、複数の組織によりアクセスされる形態に変更する場合に、既存のアプリケーション、既存のテーブルを用いて運用を継続することができ、開発者や管理者の負担を軽減することができる。   As described above, in this embodiment, when a request is received, the access source organization is managed by thread management information for each thread. Then, when an application executed using the thread management information of the thread accesses the database, it is possible to access an existing table by adding the access source organization name to the SQL statement. As a result, when a database that has been accessed by a single organization is changed to a form that is accessed by multiple organizations, it is possible to continue operation using existing applications and existing tables. The burden on the administrator can be reduced.

以下、本発明を実施するための第2の実施形態を説明する。   The second embodiment for carrying out the present invention will be described below.

図10は、実施例2における、コンピュータシステムの全体構成の一例を示す図である。マルチテナント対応データベース接続プログラムB1007とアプリケーションプログラムB1009以外は実施例1の図4に示すコンピュータシステムの全体構成と同じである。実施例2と実施例1とが異なる点を以下に説明する。   FIG. 10 is a diagram illustrating an example of the overall configuration of a computer system according to the second embodiment. Except for the multi-tenant compatible database connection program B 1007 and the application program B 1009, the overall configuration of the computer system shown in FIG. Differences between the second embodiment and the first embodiment will be described below.

アプリケーションプログラムB1009は、マルチテナント対応データベース接続プログラムB1007にどのテーブル、にどのような操作をするか(参照、更新、削除、生成)の情報を入力し、マルチテナント対応デーベース接続プログラムB1007を実行する。具体的には、アプリケーションプログラムB1009は、マルチテナント対応データベース接続プログラムB1007に組織名が付加されていないテーブル名(例えば、製品情報や顧客情報)と操作内容に関する情報を入力する。   The application program B 1009 inputs information on which table and what operation (reference, update, delete, generation) to the multi-tenant compatible database connection program B 1007 and executes the multi-tenant compatible database connection program B 1007 . Specifically, the application program B 1009 inputs a table name (for example, product information or customer information) to which the organization name is not added to the multi-tenant correspondence database connection program B 1007 and information on the operation content.

マルチテナント対応データベース接続プログラムB1007は、アプリケーションプログラムB1009から、入力としてアクセス対象の組織名は付加されていないテーブル名と操作内容を受信する。
マルチテナント対応データベース接続プログラムB1007は、組織ごとのテーブルにアクセスするSQL文を生成し、アプリケーションプログラムにB1009に返す。
The multi-tenant compatible database connection program B 1007 receives, from the application program B 1009, the table name and the operation content to which the organization name to be accessed is not added.
The multi-tenant correspondence database connection program B1007 generates an SQL statement for accessing the table for each organization and returns it to the application program to B1009.

図11は、マルチテナント対応データベース接続プログラムB1007の処理フローの一例を示す。
マルチテナント対応データベース接続プログラムB1007は、スレッドスケジューリングプログラム418から受信した、リクエストを実行するスレッドを管理するためのスレッド管理情報に含まれるスレッドローカル領域416から組織名を取得する(ステップ1101)。
マルチテナント対応データベース接続プログラムB1007は、アプリケーションプログラムB1009から、アクセス対象のテーブル名と、操作内容(例えば、参照、更新、削除、生成)に関する情報を受信する。そして、受信したアクセス対象のテーブル名に組織名を付加してSQL文を組み立てる(ステップ1102)。
このSQL文をデータベース接続プログラム407に渡し、データベース接続プログラム407を実行する。
FIG. 11 shows an example of the processing flow of the multi-tenant compatible database connection program B 1007.
The multi-tenant compatible database connection program B 1007 obtains the organization name from the thread local area 416 included in the thread management information for managing the thread that executes the request received from the thread scheduling program 418 (step 1101).
The multi-tenant compatible database connection program B 1007 receives from the application program B 1009 information on the table name to be accessed and the operation content (for example, reference, update, deletion, generation). Then, an organization name is added to the received table name to be accessed, and an SQL sentence is assembled (step 1102).
The SQL statement is passed to the database connection program 407, and the database connection program 407 is executed.

実施例2はアプリケーションプログラムB1009がSQL文を組み立てる必要がないため、アプリケーションプログラムB1009に負担が軽減されるという効果ある。   The second embodiment has an effect of reducing the burden on the application program B 1009 because the application program B 1009 does not need to assemble an SQL statement.

401:サーバ、402:メモリ、405:マルチテナント対応認証プログラム、406:データベース接続プログラム、407:マルチテナント対応データベース接続プログラム、409:アプリケーションプログラム、410:クライアント、411:CPU、412:外部記憶装置、413:スレッド管理情報、414:スタック領域、415:CPUレジスタ、416:スレッドローカル領域、317:OS、418:スレッドスケジューリングプログラム、419:マルチテナント対応プログラム、1007:マルチテナント対応データベース接続プログラムB、1009:アプリケーションプログラムB 401: server, 402: memory, 405: multi-tenant compatible authentication program, 406: database connection program, 407: multi-tenant compatible database connection program, 409: application program, 410: client, 411: CPU, 412: external storage device, 413: Thread management information, 414: Stack area, 415: CPU register, 416: Thread local area, 317: OS, 418: Thread scheduling program, 419: Multi-tenant compatible program, 1007: Multi-tenant compatible database connection program B, 1009 : Application program B

Claims (11)

複数のクライアントコンピュータに接続する情報処理装置であって、
前記複数のクライアントコンピュータから受信したリクエスト毎に関連する処理を管理する複数の管理情報と、を格納するメモリと、
前記メモリに格納される前記管理情報を参照して、前記リクエストに関する処理を実行するプロセッサと、
前記複数のクライアントコンピュータに関する情報を含むテーブル名を有する複数のテーブルから構成されるデータベースを格納する記憶装置と、を含み、
前記プロセッサは、複数のクライアントコンピュータに含まれる第1のクライアントコンピュータより第1のリクエストを受信した場合、前記第1のクライアントコンピュータに関する情報を前記第1のリクエストに関連する第1の管理情報に格納し、
前記プロセッサは、前記第1のリクエストをもとに前記データベースにアクセスするアクセス言語を作成する場合、前記第1の管理情報より前記第1のクライアントコンピュータに関する情報を読み出し、前記アクセス言語に含まれるアクセス先テーブル名に前記第1のクライアントコンピュータに関する情報を付加し、
前記プロセッサは、前記作成したアクセス言語を用いて前記データベースにアクセスする、ことを特徴とする情報処理装置。
An information processing apparatus connected to a plurality of client computers,
A plurality of management information for managing processing related to each request received from the plurality of client computers; a memory for storing;
A processor that executes processing related to the request with reference to the management information stored in the memory;
A storage device for storing a database composed of a plurality of tables having table names including information relating to the plurality of client computers,
When the processor receives a first request from a first client computer included in a plurality of client computers, the processor stores information on the first client computer in first management information related to the first request. And
When creating an access language for accessing the database based on the first request, the processor reads information about the first client computer from the first management information, and accesses included in the access language Adding information about the first client computer to the destination table name;
The information processing apparatus, wherein the processor accesses the database using the created access language.
請求項1に記載の情報処理装置であって、
前記プロセッサは、前記第1のクライアントコンピュータより前記第1のリクエストを受信した場合、前記複数の管理情報より管理情報を選択し、前記選択した管理情報を前記第1の管理情報とする、ことを特徴とする情報処理装置。
The information processing apparatus according to claim 1,
When the processor receives the first request from the first client computer, the processor selects management information from the plurality of management information, and sets the selected management information as the first management information. A characteristic information processing apparatus.
請求項2に記載の情報処理装置であって、
前記複数の管理情報より前記管理情報を選択する際、他のクライアントコンピュータから受信したリクエストに関する処理に使用されていない管理情報を選択する、ことを特徴とする情報処理装置。
An information processing apparatus according to claim 2,
An information processing apparatus, wherein when selecting the management information from the plurality of management information, management information that is not used for processing related to a request received from another client computer is selected.
請求項3に記載の情報処理装置であって、
前記プロセッサは、前記第1のクライアントコンピュータから受信した認証情報を元に、前記第1のクライアントコンピュータに関する情報を取得する、ことを特徴とする情報処理装置。
The information processing apparatus according to claim 3,
The information processing apparatus characterized in that the processor acquires information about the first client computer based on authentication information received from the first client computer.
請求項4に記載の情報処理装置であって、
前記第1のクライアントコンピュータに関する情報は、前記第1のクライアントコンピュータが所属する組織名である、ことを特徴とする情報処理装置。
The information processing apparatus according to claim 4,
The information processing apparatus according to claim 1, wherein the information related to the first client computer is an organization name to which the first client computer belongs.
請求項5に記載の情報処理装置であって、
前記アクセス言語は、SQL言語である、ことを特徴とする情報処理装置。
The information processing apparatus according to claim 5,
The information processing apparatus, wherein the access language is an SQL language.
請求項6に記載の情報処理装置であって、
前記アクセス言語に含まれるinfo、from、tableのいずれかの単語の後ろに前記第1のクライアントコンピュータに関する情報を付加する処理により、前記アクセス言語に含まれる前記アクセス先テーブル名に前記第1のクライアントコンピュータに関する情報を付加する、ことを特徴とする情報処理装置。
The information processing apparatus according to claim 6,
The first client is added to the access destination table name included in the access language by adding information on the first client computer after any of the info, from, and table words included in the access language. An information processing apparatus characterized by adding information about a computer.
請求項6に記載の情報処理装置であって、
前記アクセス言語に含まれるドットの前に前記第1のクライアントコンピュータに関する情報を付加する処理により、前記アクセス言語に含まれる前記アクセス先テーブル名に前記第1のクライアントコンピュータに関する情報を付加する、ことを特徴とする情報処理装置。
The information processing apparatus according to claim 6,
Adding information related to the first client computer to the access destination table name included in the access language by a process of adding information related to the first client computer before a dot included in the access language. A characteristic information processing apparatus.
請求項7に記載の情報処理装置であって、
前記複数の管理情報は、それぞれ、単一のプログラムによりアクセス可能な第1の領域と、複数のプログラムによりアクセス可能な第2の領域と、を含み、
前記第1のクライアントコンピュータに関する情報を前記第1のリクエストに関連する前記第1の管理情報に格納する際、前記第1の管理情報の前記第2の領域に格納することを特徴とする情報処理装置。
The information processing apparatus according to claim 7,
Each of the plurality of management information includes a first area accessible by a single program, and a second area accessible by a plurality of programs,
When information related to the first client computer is stored in the first management information related to the first request, the information processing is stored in the second area of the first management information apparatus.
請求項9に記載の情報処理装置であって、
前記複数の管理情報は、スレッド管理情報であり、
前記第1の領域は、スタック領域とCPUレジスタ領域を含み、
前記第2の領域は、スレッドローカル領域を含む、
ことを特徴とする情報処理装置。
The information processing apparatus according to claim 9,
The plurality of management information is thread management information;
The first area includes a stack area and a CPU register area;
The second region includes a thread local region;
An information processing apparatus characterized by that.
請求項1に記載の情報処理装置であって、
前記プロセッサは、前記第1のリクエストに関連する処理を実行している場合に、複数のクライアントコンピュータに含まれる第2のクライアントコンピュータより第2のリクエストを受信した場合、前記第2のクライアントコンピュータに関する情報を前記第1の管理情報とは異なり、前記第2のリクエストに関連する第2の管理情報に格納し、
前記プロセッサは、前記第2のリクエストをもとに前記データベースにアクセスするアクセス言語を作成する場合、前記第2の管理情報より前記第2のクライアントコンピュータに関する情報を読み出し、前記アクセス言語に含まれるアクセス先テーブル名に前記第2のクライアントコンピュータに関する情報を付加し、
前記プロセッサは、前記作成したアクセス言語を用いて前記データベースにアクセスする、ことを特徴とする情報処理装置。
The information processing apparatus according to claim 1,
When the processor receives a second request from second client computers included in a plurality of client computers when executing processing related to the first request, the processor relates to the second client computer. Unlike the first management information, the information is stored in the second management information related to the second request,
When creating an access language for accessing the database based on the second request, the processor reads information on the second client computer from the second management information, and accesses included in the access language Adding information about the second client computer to the destination table name;
The information processing apparatus, wherein the processor accesses the database using the created access language.
JP2009265868A 2009-11-24 2009-11-24 Multi-tenant type computer system Pending JP2011113103A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2009265868A JP2011113103A (en) 2009-11-24 2009-11-24 Multi-tenant type computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009265868A JP2011113103A (en) 2009-11-24 2009-11-24 Multi-tenant type computer system

Publications (1)

Publication Number Publication Date
JP2011113103A true JP2011113103A (en) 2011-06-09

Family

ID=44235420

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009265868A Pending JP2011113103A (en) 2009-11-24 2009-11-24 Multi-tenant type computer system

Country Status (1)

Country Link
JP (1) JP2011113103A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013077205A (en) * 2011-09-30 2013-04-25 Toshiba Corp Database request processing apparatus and program
WO2013132377A1 (en) * 2012-03-08 2013-09-12 International Business Machines Corporation Managing tenant-specific data sets in a multi-tenant environment
CN107148625A (en) * 2014-10-30 2017-09-08 1C有限责任公司 The method for the management split to the information object being stored in single database
JP2021518021A (en) * 2018-05-14 2021-07-29 ネッツユニオン クリアリング コーポレーション Data processing methods, equipment and computer readable storage media

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013077205A (en) * 2011-09-30 2013-04-25 Toshiba Corp Database request processing apparatus and program
WO2013132377A1 (en) * 2012-03-08 2013-09-12 International Business Machines Corporation Managing tenant-specific data sets in a multi-tenant environment
GB2514968A (en) * 2012-03-08 2014-12-10 Ibm Managing tenant-specific data sets in a multi-tenant environment
JP2015513153A (en) * 2012-03-08 2015-04-30 インターナショナル・ビジネス・マシーンズ・コーポレーションInternational Business Machines Corporation Computer-implemented method, computer program product, and system for managing tenant-specific data sets in a multi-tenant environment
US9244951B2 (en) 2012-03-08 2016-01-26 International Business Machines Corporation Managing tenant-specific data sets in a multi-tenant environment
US9251183B2 (en) 2012-03-08 2016-02-02 International Business Machines Corporation Managing tenant-specific data sets in a multi-tenant environment
CN107148625A (en) * 2014-10-30 2017-09-08 1C有限责任公司 The method for the management split to the information object being stored in single database
JP2017534987A (en) * 2014-10-30 2017-11-24 リミテッド ライアビリティー カンパニー “1シー” Management method of dividing information objects stored in a single database
CN107148625B (en) * 2014-10-30 2020-11-13 1C有限责任公司 Method for the management of the segmentation of information objects stored in a single database
JP2021518021A (en) * 2018-05-14 2021-07-29 ネッツユニオン クリアリング コーポレーション Data processing methods, equipment and computer readable storage media
JP7133647B2 (en) 2018-05-14 2022-09-08 ネッツユニオン クリアリング コーポレーション DATA PROCESSING METHOD, APPARATUS AND COMPUTER-READABLE STORAGE MEDIUM

Similar Documents

Publication Publication Date Title
AU2015219103B2 (en) Transparent discovery of semi-structured data schema
US20200334248A1 (en) Background format optimization for enhanced queries in a distributed computing cluster
US8200705B2 (en) Method and apparatus for applying database partitioning in a multi-tenancy scenario
US9251183B2 (en) Managing tenant-specific data sets in a multi-tenant environment
US8533229B2 (en) Soap-based web services in a multi-tenant database system
US9703834B2 (en) Topological query in multi-tenancy environment
Binani et al. SQL vs. NoSQL vs. NewSQL-a comparative study
US10146814B1 (en) Recommending provisioned throughput capacity for generating a secondary index for an online table
US20150363435A1 (en) Declarative Virtual Data Model Management
Kossmann et al. Cloudy: A modular cloud storage system
JP2011113103A (en) Multi-tenant type computer system
US20110153679A1 (en) System and method to for implementing unique primary keys across enterprise databases
CN112889039B (en) Identification of records for post-cloning tenant identifier conversion
EP2815331A1 (en) Topological query in multi-tenancy environment
US10728257B2 (en) Profile-based dashboard system
Williams Hybrid database: Dynamic selection of database infrastructure to improve query performance
Bellot et al. Efficient Entities Management for Java Autonomous Web Applications.