Movatterモバイル変換


[0]ホーム

URL:


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 PDF

Info

Publication number
CN105912597B
CN105912597BCN201610206330.5ACN201610206330ACN105912597BCN 105912597 BCN105912597 BCN 105912597BCN 201610206330 ACN201610206330 ACN 201610206330ACN 105912597 BCN105912597 BCN 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
Application number
CN201610206330.5A
Other languages
Chinese (zh)
Other versions
CN105912597A (en
Inventor
范冰冰
胡遵华
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.)
Guangzhou Bingo Software Co Ltd
Original Assignee
South China Normal University
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 South China Normal UniversityfiledCriticalSouth China Normal University
Priority to CN201610206330.5ApriorityCriticalpatent/CN105912597B/en
Publication of CN105912597ApublicationCriticalpatent/CN105912597A/en
Application grantedgrantedCritical
Publication of CN105912597BpublicationCriticalpatent/CN105912597B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

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

The method of tenant's structural data is stored in multi-tenant database
Technical field
The present invention relates to cloud computing application technical field, especially one kind, and tenant's structuring is stored in multi-tenant databaseThe 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 wayResource needed for user or service.Software as a Service (SaaS), i.e. software are serviced, and are the big bases of cloud computing threeOne 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 toThe tenant to use same or similar SaaS to service makes it generate certain scale effect using the same application example.IUsing 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: theOne kind is basic data, mainly includes basic data metadata and basic data Value Data, basic data model can be used to carry outStorage, for realizing all tenants require using service;Another kind of is self-defining data comprising user-defined data table and is made by oneselfAdopted field, for realizing tenant's individual demand.
Wherein, since database designer can not predict the customized demand of each tenant in advance, and each tenantPersonal needs are again different, so that self-defining data flexibility is very big.Storage method in the prior art is more or less allIt has some limitations, is not able to satisfy tenant's structural data memory requirement, therefore, a kind of new method is needed, to meetThe 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 effectiveThe 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 groupAt;
The basic data model is used to store the basic information of tenant, and the expansion table data model is for storing tenantThe 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 usedData 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 wordSection metadata table.
As a kind of specific embodiment, the user-defined data table information includes table metadata information, field metadata informationWith Value Data information.
As a kind of specific embodiment, the key-value pair data model includes a table metadata table, a field memberTables 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 intoRow 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, makeIt 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 secondThe custom field data that tenant generates;
The basic data generated using basic data model storage third tenant, stores third using expansion table data modelThe 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 settingStructural data model, the models coupling basic data model, expansion table data model and key-value pair data model, overcomesThe 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 eachThe 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 inventionThink 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 subjectMono- tenant of Cheng Zuowei, the soft and hardware resource of shared system between multiple tenants, is divided into three big components, background system, foregroundSystem and database, the application system logical architecture is referring to Fig. 1, from figure 1 it appears that the system includes ftp server101, 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 groupAt.
Wherein, the basic data model is used to store the basic information of tenant, and basic data model is arranged two tables, and oneOpen 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 expandingField 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 exhibitionField metadata table.Wherein, tables of data (ext_data) setting ext_data_id (expanding data ID, major key), ext_ are expandedCol_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) andType (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 cellData information, field metadata information and Value Data information, the key-value pair data model need to be arranged three tables, include oneTable metadata table, a field metadata table and a Value Data table.Wherein, table metadata table (table_matadata) is arrangedWhether id (table id, major key), tenant_id (tenant ID, external key), name (table name), enabled (come into force), info (table descriptionInformation) field, field metadata table (column_metadata) setting col_id (column ID, major key), tenant_id (tenantID, 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 DataId (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 settingAccording 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 generateData type classifies to the tenant in multi-tenant application specifically: the tenant for only generating basic data is defined as the first rentFamily;The tenant for generating basic data and custom field data is defined as the second tenant;Basic data, user-defined data table will be generatedThe 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_idnametelephoneaddressemail
001A13666666666Nanchangpty@163.com
002B13888888888ShenZhen,GuangDongxy@163.com
003C13999999999Beihai Fisheries Base Guangxi Provinceabc@163.com
Table 4-2 is the user message table (user_info) of tenant A
user_idtenant_idnameagetelephone
100001001Zhang Xi1813677777777
100002001Zhao Qi1913688888888
Table 4-3 is the user message table (user_info_B) of tenant B
user_idtenant_idnameagetelephonesexemail
200001002Zhao Zhong2013699999999Malea@163.com
200002002Party building2113600000000Femaleb@163.com
Table 4-4 is the user message table (my_user) of tenant C
user_idtenant_idfather_namebirthday
300001003Ren Hang1988-10-10
300002003Hu Rong2000-10-01
Wherein, for tenant A, basic data is only generated, first kind tenant is belonged to.For tenant B, need to existing tablePart 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 usedData model is stored.Its specifically: the basic data that the first tenant generates is stored using basic data model;Use basisData model stores the basic data that the second tenant generates, and stores the customized of the second tenant generation using expansion table data modelField data;The basic data generated using basic data model storage third tenant, uses expansion table data model storage theThe 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 modelStorage, 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 baseThe 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 tableData 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 embodimentSchematic diagram after BEKV model.
Table 5-1 basic data model tenant information table (tenant_info)
tenant_idnametelephoneaddressemail
001A13666666666Nanchangpty@163.com
002B13888888888ShenZhen,GuangDongxy@163.com
003C13999999999Beihai Fisheries Base Guangxi Provinceabc@163.com
The user message table (user_info) of table 5-2 basic data model tenant
user_idtenant_idext_data_idnameagetelephone
100001001Zhang Xi1813677777777
100002001Zhao Qi1913688888888
200001002e_d_0Zhao Zhong2013699999999
200002002e_d_1Party building2113600000000
Table 5-3 expands data model and expands field metadata table (ext_column_metadata)
ext_col_idtenant_idnametype
e_d_0002sexchar(2)
e_d_1002emailvarchar(100)
Table 5-4 expands data model and expands tables of data (ext_data)
ext_data_idext_col_idvalue
e_d_0e_c_0Male
e_d_0e_c_1a@163.com
e_d_1e_c_0Female
e_d_1e_c_1b@163.com
Table 5-5 key-value pair data model table metadata table (table_matadata)
table_idtenant_idnameenabledinfo
t_0003user_info_cyesThe table of tenant C
Table 5-6 key-value pair data model field metadata table (column_metadata)
col_idtenant_idtable_idnametypelengthnulldef_venabled
c_0003t_1user_idvarchar20yesyes
c_1003t_1father_namevarchar20yesyes
c_2003t_1birthdaydatenoyes
Table 5-7 key-value pair data model value tables of data (data)
idtenant_idtable_idcol_idvalueinfo
d_0003t_1c_0300001
d_1003t_1c_0300002
d_2003t_1c_1Ren Hang
d_3003t_1c_1Hu Rong
d_4003t_1c_31988-10-10
d_5003t_1c_32000-10-01
The method that tenant's structural data is stored in multi-tenant database that embodiment of the present invention provides, passes through settingStructural data model, the models coupling basic data model, expansion table data model and key-value pair data model, overcomesThe 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 notBe 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 itInterior, then the present invention is also implied that comprising these modification and variations.

Claims (8)

CN201610206330.5A2016-03-312016-03-31The method of tenant's structural data is stored in multi-tenant databaseActiveCN105912597B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201610206330.5ACN105912597B (en)2016-03-312016-03-31The method of tenant's structural data is stored in multi-tenant database

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201610206330.5ACN105912597B (en)2016-03-312016-03-31The method of tenant's structural data is stored in multi-tenant database

Publications (2)

Publication NumberPublication Date
CN105912597A CN105912597A (en)2016-08-31
CN105912597Btrue CN105912597B (en)2019-05-17

Family

ID=56745529

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201610206330.5AActiveCN105912597B (en)2016-03-312016-03-31The method of tenant's structural data is stored in multi-tenant database

Country Status (1)

CountryLink
CN (1)CN105912597B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106897429A (en)*2017-02-272017-06-27和创(北京)科技股份有限公司SaaS system tenant information acquisition methods and apply its server
CN107153701A (en)*2017-05-102017-09-12焦点科技股份有限公司A kind of IT system management and method for managing and monitoring based on metadata
CN109242259B (en)*2018-08-102020-12-11华迪计算机集团有限公司Data integration method and system based on basic data resource library
CN109800234A (en)*2019-01-252019-05-24苏州科达科技股份有限公司Service platform database system, upgrade method, equipment and storage medium
CN115794811B (en)*2022-10-192025-07-08燕山大学Data table field expansion method supporting multi-tenant shared data storage

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103399942A (en)*2013-08-142013-11-20山大地纬软件股份有限公司Data engine system supporting SaaS multi-tenant function and working method of data engine system
CN105095503A (en)*2015-08-312015-11-25成都康赛信息技术有限公司Personalized dynamic data structure design method applied to SaaS cloud system

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US7529728B2 (en)*2003-09-232009-05-05Salesforce.Com, Inc.Query optimization in a multi-tenant database system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103399942A (en)*2013-08-142013-11-20山大地纬软件股份有限公司Data engine system supporting SaaS multi-tenant function and working method of data engine system
CN105095503A (en)*2015-08-312015-11-25成都康赛信息技术有限公司Personalized dynamic data structure design method applied to SaaS cloud system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SaaS模式下的数据存储模型与模式扩展技术的研究与设计;乔建忠;《万方数据库 东北大学硕士学位论文》;20150415;全文
一种基于云的SaaS分布式多租户数据库研究;胡遵华等;《计算机应用与软件》;20150930;第32卷(第9期);第59-61,71页

Also Published As

Publication numberPublication date
CN105912597A (en)2016-08-31

Similar Documents

PublicationPublication DateTitle
CN105912597B (en)The method of tenant's structural data is stored in multi-tenant database
CN110168529B (en)Data storage method, device and storage medium
CN104142940B (en)Information recommendation processing method and processing device
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
US20140359029A1 (en)Message index subdivided based on time intervals
WO2017107826A1 (en)Service information pushing method and device
US11010701B2 (en)System and method for managing sales meetings
US20140379631A1 (en)Transactional key-value database with searchable indexes
US11036797B2 (en)Efficient storage and utilization of a hierarchical data set
CN108200196B (en) Data storage, query method and system based on distributed architecture
US9754015B2 (en)Feature rich view of an entity subgraph
CN107832323B (en)Distributed realization system and method based on graph database
CN104462421A (en)Multi-tenant expanding method based on Key-Value database
JP2024082272A5 (en)
CN102103633B (en)The method and system of infosystem performance is improved based on using forestland
CN110888672B (en) Method and system for implementing expression engine based on metadata architecture
US11442990B2 (en)Asserted relationship data structure
CN113961636A (en)Object relation query method and device, computer equipment and storage medium
CN110119427B (en)Data management method and related product
CN103838873B (en)The method and system that a kind of application matching owner's information is searched for automatically
US9430775B2 (en)System and method for analyzing and tuning a marketing program
CN102184105A (en)Data processing method based on modularity and data center system
CN109460442A (en)A kind of statistical method of multidimensional data, electronic equipment and storage medium
CN116910115A (en)Group query method, device, computer equipment and storage medium

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant
TR01Transfer 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

TR01Transfer of patent right
CP03Change of name, title or address

Address after:510000 Guangdong Province Guangzhou City Tianhe District Sicheng Road No. 45

Patentee after:GUANGZHOU BINGO SOFTWARE CO.,LTD.

Country or region after:China

Address before:Building G1, No. 17, Software Road, Tianhe District, Guangzhou, Guangdong 510660

Patentee before:GUANGZHOU BINGO SOFTWARE CO.,LTD.

Country or region before:China

CP03Change of name, title or address

[8]ページ先頭

©2009-2025 Movatter.jp