CN106469224A - A kind of expansible data model for SaaS platform - Google Patents
A kind of expansible data model for SaaS platform Download PDFInfo
- Publication number
- CN106469224A CN106469224A CN201610850928.8A CN201610850928A CN106469224A CN 106469224 A CN106469224 A CN 106469224A CN 201610850928 A CN201610850928 A CN 201610850928A CN 106469224 A CN106469224 A CN 106469224A
- Authority
- CN
- China
- Prior art keywords
- data
- field
- record
- extension
- extended field
- 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
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/21—Design, administration or maintenance of databases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Software Systems (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The invention discloses a kind of expansible data model for SaaS platform, including shared data table and extension record table;Described shared data table forming process is as follows:Data required for application program is analyzed, finds out all of common denominator data field, general character field is put into shared data table, described shared log storage lease ID, extended field ID and each shared field information;Every record in shared data table is referred to as master record, and the extended field of all master records is stored in growth data table;Described extension record table forming process is as follows:The individual character field of each tenant puts into growth data table, and wherein, the number of individual character field does not limit;Described extension record table storage lease ID, extended field ID, extension column name, extension record value, extension columns data type;Extendible data model proposed by the present invention can solve the problems, such as that data type is shared and the reduction completely of user data model simultaneously.
Description
Technical field
The present invention relates to database technology, more particularly, to a kind of expansible data model for SaaS platform.
Background technology
Software services (SaaS) as the ingredient of cloud computing service type, is that one kind utilizes Internet with altogether
Mode of enjoying provides the software pattern of service for multiple tenant.In this pattern, provide application software, support by SaaS operator
Software (operating system, database), hardware server, attendant and later maintenance, upgrade service.And each user need not purchase
Buy software and hardware, only need to be rented online so that it may obtain corresponding software service.
Tenant accesses the SaaS service being deployed in cloud by Internet, for the number needed for finishing service logic
According to also being stored in cloud data base.Different according to the business demand of user, following several ways can provide the user data base:
1. one data base of each tenant.This mode can fully meet the requirement to Data expansion for the user, and data is pacified
Full property and isolation are good, but do not have data sharing between tenant completely, are suitable for more complicated system and to security request data
Relatively higher system, such as ERP, banking system etc..
2. many tenant share a data base, respectively using different patterns.Which isolates each use in mode
User data, user can arbitrarily be changed to the data model in one's own pattern and be expanded, not mutual between user
Shared data.Relatively with former mode, each server can support more tenants. hardware cost relative reduction, save
Server resource, economic and practical strengthens.But safeguard more complicated, such as data base's error, no matter whether the data of the exterior and the interior
Damage, need to recover the table of all tenants, need to take a long time.It is relatively specific for tenant security level required is compared
Height, and the few situation of tables of data of each tenant.
3. many tenant shared data banks and pattern.This data framework allows a table can comprise a lot of tenants
Data record, distinguished by ID between tenant.Therefore degree of share highest, but data isolation degree is minimum, corresponding peace
Full rank is relatively low.One server can farthest support the quantity of tenant.SaaS software house has minimum
Hardware cost data backup cost, economic serviceability is good, meets very much the application feature of SaaS.
Needing, with shared data bank and mode access data base, the problem solving is to realize all leases to public data
User's is shared;The particular data being specific to user is realized mutually isolated;The individual demand data of different user is realized
Dynamic expansion.Data model dynamic expansion is particularly important, if can not be according to the demand of user, dynamic expansion data attribute, and SaaS
Application will lose its reliss.The representational Data expansion model having been proposed that has:Expanding data arranges, tables of data is had an X-rayed,
Name-value to, data slicer, Dynamic expansion XML node etc..
Content of the invention
The technical problem to be solved in the present invention is for defect of the prior art, provide a kind of for SaaS platform
Expansible data model.
The technical solution adopted for the present invention to solve the technical problems is:A kind of expansible data mould for SaaS platform
Type, including shared data table and extension record table;
Described shared data table forming process is as follows:Data required for application program is analyzed, finds out all of general character
Data field, general character field is put into shared data table, ID, extended field ID are leased in described shared log storage and each is common
Enjoy field information;Every record in shared data table is referred to as master record, and the extended field of all master records is stored in extending
In tables of data;
Described extension record table forming process is as follows:The individual character field of each tenant puts into growth data table, wherein, individual character
The number of field does not limit;Described extension record table storage lease ID, extended field ID, extension column name, extension record value,
Extension columns data type;
Described lease ID is used for distinguishing the data of different user;
Described extended field ID is used for inquiring about the extended field of each data record, and wherein, if it is empty, representing should for extended field ID
Record no extended field;Each record in growth data table represents a tenant corresponding main note in shared data table
The expansion field of record, extension record table associates the master record of shared data table with extended field ID;
Described extension column name is used for representing the title of extended field;Described extension record value is used for representing extended field value, institute
State extension columns data type for representing the data type of extended field;
In described extension record table, the data type of extended field is described by data type table, the extension record value in extension record
Field is set to sql_ variant type, represents the value that can store arbitrary data types, and extension columns data type field is altogether
Enjoy using the data type in data type table, thus the real data type of the field value that is expanded.
By such scheme, described extended field can be any amount and data type, and that is, same data type may
Can be used by the expansion field of different names in multiple different pieces of information models.
The beneficial effect comprise that:Existing several Data expansion pattern be directed to specific apply, can one
Determine degree and solve the problems, such as data extending, but also have respective shortcoming, especially can not solve data type and share and number of users
According to the problem of model reduction completely, proposed by the present invention a kind of for SaaS platform be data model can preferably solve this two
Individual problem.
Brief description
Below in conjunction with drawings and Examples, the invention will be further described, in accompanying drawing:
Fig. 1 is the growth data model structure schematic diagram of the embodiment of the present invention;
Fig. 2 is the extended model instance data schematic diagram of the embodiment of the present invention;
Fig. 3 is the tenant 1 data model retrieving algorithm schematic diagram of the embodiment of the present invention;
Fig. 4 is the data switching logic layer schematic diagram of the embodiment of the present invention.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, with reference to embodiments, to the present invention
It is further elaborated.It should be appreciated that specific embodiment described herein, only in order to explain the present invention, is not used to limit
Determine the present invention.
A kind of expansible data model for SaaS platform, including shared data table and extension record table;
Described shared data table forming process is as follows:Data required for application program is analyzed, finds out all of general character
Data field, general character field is put into shared data table, ID, extended field ID are leased in described shared log storage and each is common
Enjoy field information;Every record in shared data table is referred to as master record, and the extended field of all master records is stored in extending
In tables of data;
Described extension record table forming process is as follows:The individual character field of each tenant puts into growth data table, wherein, individual character
The number of field does not limit;Described extension record table storage lease ID, extended field ID, extension column name, extension record value,
Extension columns data type;
Described lease ID is used for distinguishing the data of different user;
Described extended field ID is used for inquiring about the extended field of each data record, and wherein, if it is empty, representing should for extended field ID
Record no extended field;Each record in growth data table represents a tenant corresponding main note in shared data table
The expansion field of record, extension record table associates the master record of shared data table with " extended field ID ";
Described extension column name is used for representing the title of extended field;Described extension record value is used for representing extended field value, institute
State extension columns data type for representing the data type of extended field;
In described extension record table, the data type of extended field is described by data type table, " the extension record in extension record
Value " field is set to sql_ variant type, represents the value that can store arbitrary data types, " extension columns data type " word
The shared data type using in data type table of section, thus the real data type of the field value that is expanded.User's extension
Field can be any amount and data type, and same data type may be not of the same name by multiple different pieces of information models
The expansion field claiming uses.If data type can not share use, it is necessary for each extended field interpolation one and represents its number
According to the metadata of type, even in same data model, using two different extensions of the title of same data type
Field is it is also desirable to two metadata record represent the data type of extended field.Share and can be dispensed not using data type
Necessary metadata record, simplifies the design of growth data model.
Above-mentioned data model method of reducing is:
1st, the specific data structure model of each tenant should be able to be reduced by growth data model completely, user application
Directly the data model after reduction is operated, without its actual storage organization of care.Will be complete for growth data model
The algorithm of reduction is entirely:
select * from
((select <Master record arranges>,<Extension record arranges>,
case <Data type arranges> when 'DataTypeID' then convert(DataType,<Growth data value>)
[ ...n ] ELSE <Growth data value> END
from t_Main m join t_Extension ex on m.TenantID = ex.TenantID and
m.ExRecordID = ex.ExRecordID join t_DataType dt on ex.DataTypeID =
dt.DataTypeID where m.TenantID = @tenantID) as pivotSource
pivot
(aggregate_function (ExValue ) FOR ExColumnName IN ( <ExColumn_list> )))
as restoredTable
Retrieving algorithm obtains according to " lease ID " connection shared data table of tenant, growth data table, data type table first
To its data record list, then pass through the data structure of pivot technology also original subscriber, and will be with reduction process
The extended field value of sql_variant type storage is converted to the data type of reality, and the data after reduction can be with strongly-typed
The mode of data set is supplied to application logical layer, conveniently programs and carries out data type checking.
The operational approach of above-mentioned data model is:
1st, process operation data:
Data model after reduction can be illustrated in be added on user interface layer, change, deletion action.The record palpus adding
Decomposed according to extended model, shared field forms master record and is saved in shared data table, and extended field is decomposed into many
In growth data table, the real data type of extended field is obtained bar record storage by inquiring about data type table.Modification note
During record, shared data table and growth data table must be updated respectively according to the field name of modified values, during deletion record, share number
Need to delete according to the record in the master record of table and growth data table simultaneously.Add, modification, the data integrity of deletion action and
Concordance can be ensured by affair mechanism.
2nd, data switching logic layer:
A data switching logic layer can be set up between tenant data model and growth data model, this data conversion is patrolled
Collecting layer provides transparent operate interface to Business Logic, and Business Logic is operated to data by call operation interface,
User operation is converted to the programmed logic updating extended model data by data switching logic layer, and data switching logic layer also is responsible for
Extended model data is reduced to user model data completely.
The demand to " course " data model for four tenant as shown in fig. 1 on the left-hand side, extendible data model extracts
, to shared data table, the data of different user is with TenantID differentiation, each data for two fields of CourseID, CourseName
The extended field of record, is obtained by ExRecordID inquiry, and ExRecordID can be sky, represents record no extended field.
Every record in shared data table is referred to as master record.The extended field of all master records is stored in growth data table, expands
Each record in exhibition tables of data represents the expansion field of a tenant corresponding master record in shared data table, extension
Record distinguishes different users with TenantID, associates the master record of shared data table with ExRecordID, with
ExColumnName represents the title of extended field, represents extended field value with ExValue, and DataTypeID represents extended field
Data type.The growth data model of " course " table of four tenant is shown on the right side of Fig. 1, the reality of growth data model
Number of cases is according to as shown in Figure 2.
The TenantID first according to tenant for the data convert algorithm couples shared data table, growth data table, data
Type list obtains its data record list, then passes through the data structure of pivot technology also original subscriber, and was reducing
In journey, the extended field value being stored with sql_variant type is converted to the data type of reality, the data after reduction is permissible
It is supplied to application logical layer in the way of strongly typed Dataset, conveniently program and carry out data type checking.According to instance data
The algorithm of model structure of reduction tenant 1 and reduction result are as shown in Figure 3.
For data manipulation it is assumed that tenant 1 needs to insert a data(' C003 ', ' Art ', ' Jack ', 5,1),
Business Logic directly invokes the interpolation data translation interface in data switching logic layer, will by interpolation data translation interface
(' T100 ', ' C003 ', ' Art ', ' Ex003 ')Enter shared data table, by (' T100 ', ' Ex003 ', ' Jack ', ' DT005 '),
(' T100 ', ' Ex003 ', 1, ' DT001 '), (' T100 ', ' Ex003 ', 1, ' DT003 ') insertion growth data table, extension record
Data type ID of ID ' Ex003 ' and each extended field by relative program Boolean query, be calculated.Modification, deletion data
Operation operates similar to adding.Business Logic, data switching logic layer, growth data layer relation as shown in Figure 4.
It should be appreciated that for those of ordinary skills, can be improved according to the above description or be converted,
And all these modifications and variations all should belong to the protection domain of claims of the present invention.
Claims (2)
1. a kind of expansible data model for SaaS platform is it is characterised in that include shared data table and extension record table;
Described shared data table forming process is as follows:Data required for application program is analyzed, finds out all of general character
Data field, general character field is put into shared data table, ID, extended field ID are leased in described shared log storage and each is common
Enjoy field information;Every record in shared data table is referred to as master record, and the extended field of all master records is stored in extending
In tables of data;
Described extension record table forming process is as follows:The individual character field of each tenant puts into growth data table, wherein, individual character
The number of field does not limit;Described extension record table storage lease ID, extended field ID, extension column name, extension record value,
Extension columns data type;
Described lease ID is used for distinguishing the data of different user;
Described extended field ID is used for inquiring about the extended field of each data record, and wherein, if it is empty, representing should for extended field ID
Record no extended field;Each record in growth data table represents a tenant corresponding main note in shared data table
The expansion field of record, extension record table associates the master record of shared data table with extended field ID;
Described extension column name is used for representing the title of extended field;Described extension record value is used for representing extended field value, institute
State extension columns data type for representing the data type of extended field;
In described extension record table, the data type of extended field is described by data type table, the extension record value in extension record
Field is set to sql_ variant type, represents the value that can store arbitrary data types, and extension columns data type field is altogether
Enjoy using the data type in data type table, thus the real data type of the field value that is expanded.
2. expansible data model according to claim 1 is it is characterised in that described extended field can be any amount
And data type.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610850928.8A CN106469224A (en) | 2016-09-26 | 2016-09-26 | A kind of expansible data model for SaaS platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610850928.8A CN106469224A (en) | 2016-09-26 | 2016-09-26 | A kind of expansible data model for SaaS platform |
Publications (1)
Publication Number | Publication Date |
---|---|
CN106469224A true CN106469224A (en) | 2017-03-01 |
Family
ID=58230215
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610850928.8A Pending CN106469224A (en) | 2016-09-26 | 2016-09-26 | A kind of expansible data model for SaaS platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106469224A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108073709A (en) * | 2017-12-20 | 2018-05-25 | 上海达梦数据库有限公司 | A kind of operating method of data record, device, equipment and storage medium |
WO2019205790A1 (en) * | 2018-04-23 | 2019-10-31 | 华为技术有限公司 | Data operating method and device |
CN111831964A (en) * | 2019-04-10 | 2020-10-27 | 阿里巴巴集团控股有限公司 | Data report information processing method and device and computer system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102200977A (en) * | 2010-03-23 | 2011-09-28 | 国际商业机器公司 | Method and system for extending database table under multi-tenant environment |
CN104462421A (en) * | 2014-12-12 | 2015-03-25 | 中国科学院声学研究所 | Multi-tenant expanding method based on Key-Value database |
-
2016
- 2016-09-26 CN CN201610850928.8A patent/CN106469224A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102200977A (en) * | 2010-03-23 | 2011-09-28 | 国际商业机器公司 | Method and system for extending database table under multi-tenant environment |
CN104462421A (en) * | 2014-12-12 | 2015-03-25 | 中国科学院声学研究所 | Multi-tenant expanding method based on Key-Value database |
Non-Patent Citations (1)
Title |
---|
刘黎志 等: "一个用于SaaS平台的可扩展数据模型", 《制造业自动化》 * |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108073709A (en) * | 2017-12-20 | 2018-05-25 | 上海达梦数据库有限公司 | A kind of operating method of data record, device, equipment and storage medium |
WO2019205790A1 (en) * | 2018-04-23 | 2019-10-31 | 华为技术有限公司 | Data operating method and device |
CN110399368A (en) * | 2018-04-23 | 2019-11-01 | 华为技术有限公司 | A kind of data manipulation method and device |
CN110399368B (en) * | 2018-04-23 | 2022-08-19 | 华为技术有限公司 | Method for customizing data table, data operation method and device |
CN111831964A (en) * | 2019-04-10 | 2020-10-27 | 阿里巴巴集团控股有限公司 | Data report information processing method and device and computer system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN101170416B (en) | Network data storage system and data access method | |
US8694557B2 (en) | Extensibility of metaobjects | |
CN104160381B (en) | Managing method and system for tenant-specific data sets in a multi-tenant environment | |
CN104067216B (en) | System and method for implementing expansible data storage service | |
CN102200977B (en) | Method and system for extending database table under multi-tenant environment | |
CN104021145B (en) | The method and apparatus that a kind of mixed service concurrently accesses | |
CN107368588B (en) | Heterogeneous resource isomorphism method and device | |
US7523141B2 (en) | Synchronization operations involving entity identifiers | |
CN109144994A (en) | Index updating method, system and relevant apparatus | |
US20120109926A1 (en) | Scoped database connections | |
US9922086B1 (en) | Consistent query of local indexes | |
CN109906448A (en) | Promote the operation on pluggable database using individual logical time stamp service | |
CN102170457A (en) | Method and device for providing service for tenants of application | |
JP2001051879A (en) | Method and system for improved access to nonrelational database | |
CN106446126A (en) | Massive space information data storage management method and storage management device | |
CN109542861B (en) | File management method, device and system | |
CN101945126A (en) | Forest resource heterogeneous data distributed management system | |
CN105426373A (en) | Database synchronization method and device | |
CN106415534B (en) | The method and apparatus of contingency table subregion in a kind of distributed data base | |
US20080104008A1 (en) | Common data broker method, system, and program product | |
KR101400214B1 (en) | Appratus for providing a hybrid c interface | |
CN105635311A (en) | Method for synchronizing resource pool information in cloud management platform | |
CN106469224A (en) | A kind of expansible data model for SaaS platform | |
CN114296836B (en) | Remote configuration system | |
CN103473332A (en) | Data archive repository with virtual test architecture |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170301 |