Multi-tenancy architecture is the technology that can make an application shared by multiply enterprises and clients,thereby it can improve the utility of hardware and reduce the costs of enterprise,meanwhile the data of application can be isolated very well.In the scenario when an application has already migrated to multi-tenancy architecture,there was a big problem that partition existing database from single tenant to multiple tenants.However,the existing solutions can partition database from single tenant to multi-tenants under shared database shared schema multi-tenancy architecture,but they have three outstanding problems(1)the efficiency is low;(2)the partition process is hard to meet business requirements;(3)the multi-tenancy integrated rule of data is hard to ensure after partition.In order to resolve these problems,a new system was designed by this thesis which name is data partition system based on shared database shared schema multi-tenancy architecture,the system is based on one company's IT Asset Manager system.First,improve partition efficiency by removing unnecessary foreign links of tables and optimizing code.Second,make sure the partition can meet the business requirements by choosing the foreign links between tables from user interface and introducing a configurable template of business model.Third,ensure the multi-tenancy integrated rule of data by introducing a temporary column to store the tenant information of every record in the process of partition,besides the user can check and repair the records break the multi-tenancy integrated rule of entire database after all partition work.The major works of this paper including:1)System analysis and design.Analyze and design the data partition process at first,then discuss about how to improve partition work efficiency,how to meet the logic of business requirement and how to meet the multi-tenancy integrated rule.Describe the adopted solution by this paper specifically and design the function modules of this system at last.2)System implementation.Based on the design of function modules of this system,major describe about the implementations including add new temporary tenant column,update temporary tenant column,update real tenant column and check multi-tenancy consistency.3)System test and validation.Design the methods of function test and performance test of this system,analyze the test result and compare with other solutions after mock test on the database of one customer.After implemented this system,it has very large performance improvement and can meet the business requirements without any data violate the multi-tenancy integrated rule in the process of partitioning database from single tenant to multi-tenants.At last,it can prove that this system is a workable solution based on shared database shared schema multitenancy architecture when partitioning database from single tenant to multi-tenants. |