CN105912597B - The method of tenant's structural data is stored in multi-tenant database - Google Patents
The method of tenant's structural data is stored in multi-tenant database Download PDFInfo
- Publication number
- CN105912597B CN105912597B CN201610206330.5A CN201610206330A CN105912597B CN 105912597 B CN105912597 B CN 105912597B CN 201610206330 A CN201610206330 A CN 201610206330A CN 105912597 B CN105912597 B CN 105912597B
- Authority
- CN
- China
- Prior art keywords
- tenant
- data
- data model
- basic
- stored
- 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.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
- G06F16/2282—Tablespace storage structures; Management thereof
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The method that the present invention relates to a kind of to store tenant's structural data in multi-tenant database, comprising: (1) setting structure data model: the structural data model is made of basic data model, expansion table data model and key-value pair data model;The basic data model is used to store the basic information of tenant, and the expansion table data model is used to store the expansion information of tenant's basic information, and the key-value pair data model is used to store the user-defined data table information of tenant;(2) classify tenant: the data type generated according to tenant classifies to the tenant in multi-tenant application;(3) it stores tenant data: according to classification as a result, to the data that different types of tenant generates, being stored using the different data model in structural data model.The method that embodiment of the present invention provides, can effectively store the basic data and self-defining data of tenant, while reaching tenant's demand, meet the interests of service supplier.
Description
Technical field
The present invention relates to cloud computing application technical field, especially one kind, and tenant's structuring is stored in multi-tenant database
The method of data.
Background technique
Cloud computing is a kind of delivery service mode emerging in recent years, is provided by network with on-demand, easy extension way
Resource needed for user or service.Software as a Service (SaaS), i.e. software are serviced, and are the big bases of cloud computing three
One of plinth form, by being deployed in data center in service provider's Unified Set, user can temporally wait demands for various applications,
Corresponding service is accessed by Web browser or Web client, to be used as needed, there is very big flexibility.
In order to reach benefit, SaaS application service provider uses multi-tenant (Muti-Tenant) technology, need to
The tenant to use same or similar SaaS to service makes it generate certain scale effect using the same application example.I
Using the application call SaaS multi-tenant application that multi-tenant technology runs in a manner of SaaS.
In the application of SaaS multi-tenant, according to data sharing degree, the data of different tenants can be divided into two major classes: the
One kind is basic data, mainly includes basic data metadata and basic data Value Data, basic data model can be used to carry out
Storage, for realizing all tenants require using service;Another kind of is self-defining data comprising user-defined data table and is made by oneself
Adopted field, for realizing tenant's individual demand.
Wherein, since database designer can not predict the customized demand of each tenant in advance, and each tenant
Personal needs are again different, so that self-defining data flexibility is very big.Storage method in the prior art is more or less all
It has some limitations, is not able to satisfy tenant's structural data memory requirement, therefore, a kind of new method is needed, to meet
The structural data storage demand of tenant.
Summary of the invention
The method that it is an object of the invention to a kind of to store tenant's structural data in multi-tenant database, can be effective
The basic data and self-defining data of storage tenant meets the interests of service supplier while reaching tenant's demand.
In order to achieve the above-mentioned object of the invention, the technical solution adopted in the present invention is as follows:
The method that the embodiment of the invention provides a kind of to store tenant's structural data in multi-tenant database, comprising:
(1) setting structure data model:
The structural data model is by basic data model, expansion table data model and key-value pair data model group
At;
The basic data model is used to store the basic information of tenant, and the expansion table data model is for storing tenant
The expansion information of basic information, the key-value pair data model are used to store the user-defined data table information of tenant;
(2) classify tenant:
The data type generated according to tenant classifies to the tenant in multi-tenant application;
(3) tenant data is stored:
According to classification as a result, to the data that different types of tenant generates, the difference in structural data model is used
Data model is stored.
As a kind of specific embodiment, the basic data model includes tenant's table and multiple basic information tables.
As a kind of specific embodiment, the expansion packetization, which includes, expands field data and expansion field metadata.
As a kind of specific embodiment, the expansion table data model includes that a Zhang Tuo opens up tables of data and Zhang Tuo exhibition word
Section metadata table.
As a kind of specific embodiment, the user-defined data table information includes table metadata information, field metadata information
With Value Data information.
As a kind of specific embodiment, the key-value pair data model includes a table metadata table, a field member
Tables of data and a Value Data table.
As a kind of specific embodiment, it is described according to tenant generate data type to multi-tenant application in tenant into
Row classification specifically:
The tenant for only generating basic data is defined as the first tenant;
The tenant for generating basic data and custom field data is defined as the second tenant;
The tenant for generating basic data, user-defined data table data and custom field data is defined as third tenant.
As a kind of specific embodiment, it is described according to classification as a result, to different types of tenant generate data, make
It is stored with the different data model in structural data model specifically:
The basic data that the first tenant generates is stored using basic data model;
The basic data that the second tenant generates is stored using basic data model, uses expansion table data model storage second
The custom field data that tenant generates;
The basic data generated using basic data model storage third tenant, stores third using expansion table data model
The custom field data that tenant generates, the user-defined data table data generated using key-value pair data model storage third tenant.
Compared with prior art, technical solution provided by the invention has the following beneficial effects:
The method that tenant's structural data is stored in multi-tenant database that embodiment of the present invention provides, passes through setting
Structural data model, the models coupling basic data model, expansion table data model and key-value pair data model, overcomes
The shortcomings that single model is when storing multi-tenant data, can effectively store the basic data and self-defining data of tenant,
While reaching tenant's demand, meet the interests of service supplier.
Detailed description of the invention
Fig. 1 is the logical architecture figure of multi-tenant Course Website group's application system of the embodiment of the present invention;
Fig. 2 is the flow chart of one embodiment of method described in the embodiment of the present invention;
Fig. 3 is that the embodiment of the present invention illustrates in multi-tenant Course Website application system tenant's information data and each
The logical storage structure of the user information data of a tenant.
Specific embodiment
In order to be fully understood from the purpose of the present invention, feature and effect, below with reference to attached drawing 1-3 to structure of the invention
Think of, specific structure and the technical effect of generation are described further.
The present embodiment, by taking Course Website group's application system with multi-tenant architecture as an example, the system is with a subject
Mono- tenant of Cheng Zuowei, the soft and hardware resource of shared system between multiple tenants, is divided into three big components, background system, foreground
System and database, the application system logical architecture is referring to Fig. 1, from figure 1 it appears that the system includes ftp server
101, content management server 102, web application server 103, database (File Transfer Protocol Server)
Server 104 and external user 105 and internal user 106.Wherein, present invention is mainly applied on database.
As shown in Fig. 2, a kind of method that tenant's structural data is stored in multi-tenant database is present embodiments provided,
Include:
Step 201: setting structure data model
The structural data model is by basic data model, expansion table data model and key-value pair data model group
At.
Wherein, the basic data model is used to store the basic information of tenant, and basic data model is arranged two tables, and one
Open tenant's table and multiple basic information tables.Wherein, tenant's table (tenant_info) setting tenant_id (tenant ID, major key),
Name (name), telephone (phone), address (address) and email (E-mail address) field, user's table (user_
Info) user_id (User ID, major key) is set, tenant_id (tenant id, external key), ext_data_id (field id is expanded,
External key), name (name), age (age) and telephone (phone) field.
The expansion table data model is used to store the expansion information of tenant's basic information, and the expansion information includes expanding
Field data and expansion field metadata.It expands data model and needs to be arranged two tables, a Zhang Tuo opens up tables of data and Zhang Tuo's exhibition
Field metadata table.Wherein, tables of data (ext_data) setting ext_data_id (expanding data ID, major key), ext_ are expanded
Col_id (expanding column ID, external key) and expansion data value (value) field, expand field metadata table (ext_column_
Metadata) be arranged ext_col_id (expand column ID, major key), tenant_id (tenant ID, external key), name (column name) and
Type (column data type) field.
The key-value pair data model is used to store the user-defined data table information of tenant, and the user-defined data table information includes list cell
Data information, field metadata information and Value Data information, the key-value pair data model need to be arranged three tables, include one
Table metadata table, a field metadata table and a Value Data table.Wherein, table metadata table (table_matadata) is arranged
Whether id (table id, major key), tenant_id (tenant ID, external key), name (table name), enabled (come into force), info (table description
Information) field, field metadata table (column_metadata) setting col_id (column ID, major key), tenant_id (tenant
ID, external key), table_id (table id, external key), name (column name), type (field data types), length (field length),
Null (can be null), def_v (default value), enabled (whether coming into force) and info (column description information) field, Value Data
Id (value ID, major key) is arranged in table (data), tenant_id (tenant ID, external key), table_id (table id, external key), col_id
(column ID, external key), value (field value) and info (value description information) field.As shown in figure 3, for the structuring number after setting
According to Model B EKV.
Step 202: classification tenant
The data type generated according to tenant classifies to the tenant in multi-tenant application.It is described according to tenant generate
Data type classifies to the tenant in multi-tenant application specifically: the tenant for only generating basic data is defined as the first rent
Family;The tenant for generating basic data and custom field data is defined as the second tenant;Basic data, user-defined data table will be generated
The tenant of data and custom field data is defined as third tenant.
There are three tenant A, B, C on the SaaS platform of the present embodiment, specifying information is as shown in the table:
Table 4-1 is tenant's information table (tenant_info)
tenant_id | name | telephone | address | |
001 | A | 13666666666 | Nanchang | pty@163.com |
002 | B | 13888888888 | ShenZhen,GuangDong | xy@163.com |
003 | C | 13999999999 | Beihai Fisheries Base Guangxi Province | abc@163.com |
Table 4-2 is the user message table (user_info) of tenant A
user_id | tenant_id | name | age | telephone |
100001 | 001 | Zhang Xi | 18 | 13677777777 |
100002 | 001 | Zhao Qi | 19 | 13688888888 |
Table 4-3 is the user message table (user_info_B) of tenant B
user_id | tenant_id | name | age | telephone | sex | |
200001 | 002 | Zhao Zhong | 20 | 13699999999 | Male | a@163.com |
200002 | 002 | Party building | 21 | 13600000000 | Female | b@163.com |
Table 4-4 is the user message table (my_user) of tenant C
user_id | tenant_id | father_name | birthday |
300001 | 003 | Ren Hang | 1988-10-10 |
300002 | 003 | Hu Rong | 2000-10-01 |
Wherein, for tenant A, basic data is only generated, first kind tenant is belonged to.For tenant B, need to existing table
Part modification is carried out, the second class tenant is belonged to.For tenant C, needs newly-built table with storing data, belong to third class tenant.
Step 203: storage tenant data
According to classification as a result, to the data that different types of tenant generates, the difference in structural data model is used
Data model is stored.Its specifically: the basic data that the first tenant generates is stored using basic data model;Use basis
Data model stores the basic data that the second tenant generates, and stores the customized of the second tenant generation using expansion table data model
Field data;The basic data generated using basic data model storage third tenant, uses expansion table data model storage the
The custom field data that three tenants generate, the user-defined data table data generated using key-value pair data model storage third tenant.
The data of tenant A are stored using the tables of data in basic data model.
Tenant B generates basic data and custom field data, basic data are deposited using the tables of data of basic data model
Storage, custom field data are stored using the tables of data in expansion table data model.
Tenant C can generate basic data, user-defined data table data and custom field data, wherein basic data uses base
The tables of data of plinth data model stores, and custom field data are stored using the tables of data for expanding table data model, user-defined data table
Data are stored using the tables of data of key-value pair data model.
As shown in chart 5-1 to table 5-7, stored for the data by above-mentioned steps, three tenants A, B, C of the present embodiment
Schematic diagram after BEKV model.
Table 5-1 basic data model tenant information table (tenant_info)
tenant_id | name | telephone | address | |
001 | A | 13666666666 | Nanchang | pty@163.com |
002 | B | 13888888888 | ShenZhen,GuangDong | xy@163.com |
003 | C | 13999999999 | Beihai Fisheries Base Guangxi Province | abc@163.com |
The user message table (user_info) of table 5-2 basic data model tenant
user_id | tenant_id | ext_data_id | name | age | telephone |
100001 | 001 | Zhang Xi | 18 | 13677777777 | |
100002 | 001 | Zhao Qi | 19 | 13688888888 | |
200001 | 002 | e_d_0 | Zhao Zhong | 20 | 13699999999 |
200002 | 002 | e_d_1 | Party building | 21 | 13600000000 |
Table 5-3 expands data model and expands field metadata table (ext_column_metadata)
ext_col_id | tenant_id | name | type |
e_d_0 | 002 | sex | char(2) |
e_d_1 | 002 | varchar(100) |
Table 5-4 expands data model and expands tables of data (ext_data)
ext_data_id | ext_col_id | value |
e_d_0 | e_c_0 | Male |
e_d_0 | e_c_1 | a@163.com |
e_d_1 | e_c_0 | Female |
e_d_1 | e_c_1 | b@163.com |
Table 5-5 key-value pair data model table metadata table (table_matadata)
table_id | tenant_id | name | enabled | info |
t_0 | 003 | user_info_c | yes | The table of tenant C |
Table 5-6 key-value pair data model field metadata table (column_metadata)
col_id | tenant_id | table_id | name | type | length | null | def_v | enabled |
c_0 | 003 | t_1 | user_id | varchar | 20 | yes | yes | |
c_1 | 003 | t_1 | father_name | varchar | 20 | yes | yes | |
c_2 | 003 | t_1 | birthday | date | no | yes |
Table 5-7 key-value pair data model value tables of data (data)
id | tenant_id | table_id | col_id | value | info |
d_0 | 003 | t_1 | c_0 | 300001 | |
d_1 | 003 | t_1 | c_0 | 300002 | |
d_2 | 003 | t_1 | c_1 | Ren Hang | |
d_3 | 003 | t_1 | c_1 | Hu Rong | |
d_4 | 003 | t_1 | c_3 | 1988-10-10 | |
d_5 | 003 | t_1 | c_3 | 2000-10-01 |
The method that tenant's structural data is stored in multi-tenant database that embodiment of the present invention provides, passes through setting
Structural data model, the models coupling basic data model, expansion table data model and key-value pair data model, overcomes
The shortcomings that single model is when storing multi-tenant data, can effectively store the basic data and self-defining data of tenant,
While reaching tenant's demand, meet the interests of service supplier.
It should be understood that the invention is not limited to above embodiment, it is all to various changes or modifications of the invention not
Be detached from the spirit and scope of the present invention, if these modification and variations belong to claim and equivalent technologies range of the invention it
Interior, then the present invention is also implied that comprising these modification and variations.
Claims (8)
1. storing the method for tenant's structural data in multi-tenant database characterized by comprising
(1) setting structure data model:
The structural data model is made of basic data model, expansion table data model and key-value pair data model;
The basic data model is used to store the basic information of tenant, and the expansion table data model is for storing tenant basis
The expansion information of information, the key-value pair data model are used to store the user-defined data table information of tenant;
(2) classify tenant:
The data type generated according to tenant classifies to the tenant in multi-tenant application;
(3) tenant data is stored:
According to classification as a result, to the data that different types of tenant generates, the different data in structural data model is used
Model is stored.
2. the method for tenant's structural data is stored in multi-tenant database as described in claim 1, it is characterised in that:
The basic data model includes tenant's table and multiple basic information tables.
3. the method for tenant's structural data is stored in multi-tenant database as described in claim 1, it is characterised in that:
The expansion packetization, which includes, expands field data and expansion field metadata.
4. the method for tenant's structural data is stored in multi-tenant database as described in claim 1, it is characterised in that:
The expansion table data model includes that a Zhang Tuo opens up tables of data and Zhang Tuo exhibition field metadata table.
5. the method for tenant's structural data is stored in multi-tenant database as described in claim 1, it is characterised in that:
The user-defined data table information includes table metadata information, field metadata information and Value Data information.
6. the method for tenant's structural data is stored in multi-tenant database as described in claim 1, it is characterised in that:
The key-value pair data model includes a table metadata table, a field metadata table and a Value Data table.
7. the method for tenant's structural data is stored in multi-tenant database as described in claim 1, which is characterized in that institute
The data type generated according to tenant is stated to classify to the tenant in multi-tenant application specifically:
The tenant for only generating basic data is defined as the first tenant;
The tenant for generating basic data and custom field data is defined as the second tenant;
The tenant for generating basic data, user-defined data table data and custom field data is defined as third tenant.
8. the method for tenant's structural data is stored in multi-tenant database as described in claim 1, which is characterized in that institute
State according to classification as a result, using the different data mould in structural data model to the data that different types of tenant generates
Type is stored specifically:
The basic data that the first tenant generates is stored using basic data model;
The basic data that the second tenant generates is stored using basic data model, stores the second tenant using expansion table data model
The custom field data of generation;
The basic data generated using basic data model storage third tenant, stores third tenant using expansion table data model
The custom field data of generation, the user-defined data table data generated using key-value pair data model storage third tenant.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610206330.5A CN105912597B (en) | 2016-03-31 | 2016-03-31 | The method of tenant's structural data is stored in multi-tenant database |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610206330.5A CN105912597B (en) | 2016-03-31 | 2016-03-31 | The method of tenant's structural data is stored in multi-tenant database |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105912597A CN105912597A (en) | 2016-08-31 |
CN105912597B true CN105912597B (en) | 2019-05-17 |
Family
ID=56745529
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610206330.5A Active CN105912597B (en) | 2016-03-31 | 2016-03-31 | The method of tenant's structural data is stored in multi-tenant database |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105912597B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106897429A (en) * | 2017-02-27 | 2017-06-27 | 和创(北京)科技股份有限公司 | SaaS system tenant information acquisition methods and apply its server |
CN107153701A (en) * | 2017-05-10 | 2017-09-12 | 焦点科技股份有限公司 | A kind of IT system management and method for managing and monitoring based on metadata |
CN109242259B (en) * | 2018-08-10 | 2020-12-11 | 华迪计算机集团有限公司 | Data integration method and system based on basic data resource library |
CN109800234A (en) * | 2019-01-25 | 2019-05-24 | 苏州科达科技股份有限公司 | Service platform database system, upgrade method, equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103399942A (en) * | 2013-08-14 | 2013-11-20 | 山大地纬软件股份有限公司 | Data engine system supporting SaaS multi-tenant function and working method of data engine system |
CN105095503A (en) * | 2015-08-31 | 2015-11-25 | 成都康赛信息技术有限公司 | Personalized dynamic data structure design method applied to SaaS cloud system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7529728B2 (en) * | 2003-09-23 | 2009-05-05 | Salesforce.Com, Inc. | Query optimization in a multi-tenant database system |
-
2016
- 2016-03-31 CN CN201610206330.5A patent/CN105912597B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103399942A (en) * | 2013-08-14 | 2013-11-20 | 山大地纬软件股份有限公司 | Data engine system supporting SaaS multi-tenant function and working method of data engine system |
CN105095503A (en) * | 2015-08-31 | 2015-11-25 | 成都康赛信息技术有限公司 | Personalized dynamic data structure design method applied to SaaS cloud system |
Non-Patent Citations (2)
Title |
---|
SaaS模式下的数据存储模型与模式扩展技术的研究与设计;乔建忠;《万方数据库 东北大学硕士学位论文》;20150415;全文 |
一种基于云的SaaS分布式多租户数据库研究;胡遵华等;《计算机应用与软件》;20150930;第32卷(第9期);第59-61,71页 |
Also Published As
Publication number | Publication date |
---|---|
CN105912597A (en) | 2016-08-31 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN105912597B (en) | The method of tenant's structural data is stored in multi-tenant database | |
US9686276B2 (en) | Cookieless management translation and resolving of multiple device identities for multiple networks | |
US20130166543A1 (en) | Client-based search over local and remote data sources for intent analysis, ranking, and relevance | |
US10331752B2 (en) | Methods and systems for determining query date ranges | |
US20140359029A1 (en) | Message index subdivided based on time intervals | |
KR20200099602A (en) | Layered graph data structure | |
CN111046237B (en) | User behavior data processing method and device, electronic equipment and readable medium | |
WO2019024060A1 (en) | Data storage method and device, and storage medium | |
CN107832323B (en) | Distributed realization system and method based on graph database | |
US9128967B2 (en) | Storing graph data in a column-oriented data store | |
US11010701B2 (en) | System and method for managing sales meetings | |
CN109710618A (en) | The mixing storage method and system of knowledge mapping data relationship separation | |
US9754015B2 (en) | Feature rich view of an entity subgraph | |
US20140379631A1 (en) | Transactional key-value database with searchable indexes | |
JP5499333B2 (en) | Information recommendation device, information recommendation method, and information recommendation program | |
US11036797B2 (en) | Efficient storage and utilization of a hierarchical data set | |
WO2022121227A1 (en) | Data storage method and apparatus, query method, electronic device, and readable medium | |
US8989359B2 (en) | Methods and systems for dynamically changing contact information | |
EP3136261A1 (en) | Method and device for data search | |
CN111435376A (en) | Information processing method and system, computer system, and computer-readable storage medium | |
CN110297818B (en) | Method and device for constructing data warehouse | |
JP2012120041A (en) | Telephone-directory-data integrating apparatus and method, and computer program therefor | |
US11442990B2 (en) | Asserted relationship data structure | |
US9430775B2 (en) | System and method for analyzing and tuning a marketing program | |
US20210234933A1 (en) | Sharing personalized entities among personal digital assistant users |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20230627 Address after: Building G1, No. 17, Software Road, Tianhe District, Guangzhou, Guangdong 510660 Patentee after: GUANGZHOU BINGO SOFTWARE CO.,LTD. Address before: 510631 School of computer science, South China Normal University, 55 West Zhongshan Road, Guangzhou, Guangdong Patentee before: SOUTH CHINA NORMAL University |
|
TR01 | Transfer of patent right |