Database expansion method, device and system

By creating a new database group with one master and multiple slaves and performing data synchronization and sharding operations, the disk performance problem after database expansion was solved, achieving storage expansion and performance improvement.

CN114610816BActive Publication Date: 2025-12-12INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210437988.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-25
Publication Date
2025-12-12
Estimated Expiration
2042-04-25

AI Technical Summary

Technical Problem

Existing database expansion methods can cause disk performance issues when the mounted disk size exceeds 1TB, leading to a decrease in database performance.

Method used

A new database group with one master and multiple slaves is created based on the distributed database middleware (DBLE). This new database group is then mounted as a slave database to the master database of the current database group. After data synchronization, the data group is disconnected. Then, sharding is performed on the new and current database groups to ensure that each database is not overloaded.

Benefits of technology

It significantly expanded the database storage capacity while avoiding the disk performance issues associated with container libraries, thus improving database performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114610816B_ABST
    Figure CN114610816B_ABST
Patent Text Reader

Abstract

The application discloses a database capacity expansion method, device and system, and relates to the technical field of big data, wherein the method comprises the following steps: creating a new database group with one master and multiple slaves based on a distributed database middleware; mounting the new database group as a slave database to a master database of a current database group according to configuration information of a management console; disconnecting the new database group from the master database of the current database group in response to completion of data synchronization operation of each database in the new database group and the current database group; and performing a sharding operation on each database in the new database group and the current database group according to the configuration information of the management console, so as to determine the number of shards of the new database group and the current database group respectively. Through the application, the performance problem of a disk mounted by a container library can be avoided, and the performance of a database can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of big data, and particularly relates to a database expansion method, device and system. BACKGROUND

[0002] With the acceleration of the platform under the host of financial institutions, more and more business data is stripped from the host to the platform. Although distributed storage is used, the data storage volume grows rapidly. When the database cluster disk space usage rate approaches the threshold, expansion is needed. The existing method is to expand the size of the container library disk mounted in each set.

[0003] The method of expanding the size of the disk mount can solve the problem of insufficient storage space, but when the mount size exceeds 1T, it will gradually cause a certain degree of disk performance problem, thereby reducing the performance of the container library. SUMMARY

[0004] Therefore, the present application provides a database expansion method, device and system to solve at least one of the above problems.

[0005] According to a first aspect of the present application, a database expansion method is provided, which comprises:

[0006] creating a new database group with one master and multiple slaves based on a distributed database middleware (DBLE);

[0007] mounting the new database group as a slave database to the master database of the current database group according to the configuration information of a DBLE management console (DMP);

[0008] disconnecting the new database group from the master database of the current database group in response to the completion of the data synchronization operation of each database in the new database group and the current database group;

[0009] performing a sharding operation on each database in the new database group and the current database group according to the configuration information of the DMP to determine the number of shards of the new database group and the current database group, respectively.

[0010] Specifically, creating a new database group with one master and multiple slaves based on DBLE comprises:

[0011] creating a new database group with one master and multiple slaves based on DBLE according to the structure of the current database group, wherein the structure of the new database group with one master and multiple slaves is the same as that of the current database group.

[0012] Preferably, before mounting the new database group as a slave database to the master database of the current database group, the method further comprises:

[0013] judging a master-slave replication delay value of the current database group;

[0014] in response to the master-slave replication delay value of the current database group being zero, determining that a master-slave data synchronization operation of the current database group is completed.

[0015] Specifically, mounting the new database group as a slave database to a master database of the current database group comprises:

[0016] mounting the new database group as a slave database to a master database of the current database group, and judging whether synchronization function information of the new database group is normal;

[0017] in response to the judging result being normal, determining that the new database group is successfully mounted as a slave database to the master database of the current database group.

[0018] Specifically, performing a sharding operation on each database in the new database group and the current database group comprises:

[0019] performing a sharding operation on each database in the new database group to determine an available shard quantity of each database in the new database group;

[0020] performing a sharding operation on each database in the current database group to determine an available shard quantity of each database in the current database group.

[0021] Further, after performing the sharding operation on each database in the new database group and the current database group, the method further comprises:

[0022] deleting an unavailable shard after the sharding operation on each database in the new database group and the current database group.

[0023] According to a second aspect of the present application, a database expansion device is provided, and the device comprises:

[0024] a new group creation unit configured to create a new database group with one master and multiple slaves based on a distributed database middleware (DBLE);

[0025] a mounting unit configured to mount the new database group as a slave database to a master database of a current database group according to configuration information of a DBLE management console (DMP);

[0026] a disconnection unit configured to disconnect the new database group from the master database of the current database group in response to a data synchronization operation between each database in the new database group and the current database group being completed.

[0027] A fragmentation unit is configured to perform a fragmentation operation on each database in the new database group and the current database group according to configuration information of the DMP, so as to determine the number of fragments of the new database group and the current database group, respectively.

[0028] According to a third aspect of the present application, a database expansion system is provided, which comprises the database expansion device and a distributed database middleware (DBLE) system, wherein the DBLE system comprises a DBLE management console (DMP) configured to set configuration information of a database group.

[0029] According to a fourth aspect of the present application, an electronic device is provided, which comprises a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.

[0030] According to a fifth aspect of the present application, a computer readable storage medium is provided, which stores a computer program, wherein the computer program is executable on a processor to implement the steps of the above method.

[0031] According to the above technical solution, the new database group is created based on the DBLE, and the new database group is mounted as a slave database to the master database of the current database group, then the data synchronization operation is performed with the current database group, after the data synchronization operation is completed, the new database group is disconnected from the master database of the current database group, and then the fragmentation operation is performed on each database in the new database group and the current database group. In this way, the expansion is performed by creating the new database group, and the new database group and the current database group are not overloaded by the fragmentation operation, so that the performance problem of the disk mounted by the container library can be avoided, and the performance of the database can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0032] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor.

[0033] Figure 1 is a flowchart of a database expansion method according to an embodiment of the present application;

[0034] Figure 2 is an example diagram of a database structure according to an embodiment of the present application;

[0035] Figure 3 is a detailed flowchart of a database expansion method according to an embodiment of the present application;

[0036] Figure 4 is a structural block diagram of a database expansion system according to an embodiment of the present application;

[0037] Figure 5 is a structural block diagram of a database expansion device 2 according to an embodiment of the present application;

[0038] Figure 6 is a schematic block diagram of a system configuration of an electronic device 600 according to an embodiment of the present application. DETAILED DESCRIPTION

[0039] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.

[0040] Although the method of expanding the disk mounting size can solve the problem of insufficient storage space, when the mounting size exceeds 1T, it will gradually cause a certain degree of disk performance problem, reducing the performance of the database. Based on this, the embodiments of the present application provide a database expansion scheme, which can greatly expand the database storage and will not cause disk performance problems.

[0041] It should be noted that the acquisition, storage, use, processing and the like of data in the technical solutions of the present application comply with the relevant provisions of national laws and regulations. The embodiments of the present application will be described in detail below with reference to the drawings.

[0042] Figure 1 is a database expansion method according to an embodiment of the present application, as shown in Figure 1 , the method comprises:

[0043] Step 101, creating a new database group of one master and multiple slaves based on a distributed database middleware (DBLE).

[0044] Step 102, according to the configuration information of a DBLE management console (Data Management Platform, DMP), mounting the new database group as a slave database to the master database of the current database group.

[0045] Among them, the DMP can provide functions such as configuration file management, database container management, establishment of master-slave relationship, high availability, service start and stop, etc.

[0046] In actual operation, before step 102 is performed, it is necessary to judge the master-slave replication delay value of the current database group; when the master-slave replication delay value of the current database group is zero, it indicates that there is no data being replicated between the master and slave databases of the current database group, at this time, it is determined that the master-slave data synchronization operation of the current database group is completed. Then, step 102 can be performed.

[0047] When the new database group is mounted as a slave database to the master database of the current database group, it is necessary to judge whether the synchronization function information of the new database group is normal; when the judgment result is normal, it is determined that the new database group is successfully mounted as a slave database to the master database of the current database group.

[0048] Step 103, in response to the completion of the data synchronization operation of each database in the new database group and the current database group, the new database group is disconnected from the master database of the current database group.

[0049] Step 104, according to the configuration information of the DMP, performing a sharding operation on each database in the new database group and the current database group to determine the number of shards of the new database group and the current database group, respectively.

[0050] In actual operation, 1 shard corresponds to one database (database) instance.

[0051] Specifically, a sharding operation is performed on each database in the new database group to determine the available number of shards of each database in the new database group; a sharding operation is performed on each database in the current database group to determine the available number of shards of each database in the current database group.

[0052] After performing the sharding operation, the unavailable shards in each database in the new database group and the current database group can be deleted.

[0053] By creating a new database group based on DBLE, mounting the new database group as a slave database to the master database of the current database group, then performing data synchronization operation with the current database group, after the data synchronization operation is completed, the new database group is disconnected from the master database of the current database group, and then performing a sharding operation on each database in the new database group and the current database group, in this way, not only the capacity expansion is performed by creating a new database group, but also the overloading use of each database in the new database group and the current database group is avoided through the sharding operation, thereby avoiding the performance problem of the disk mounted by the container library, and improving the performance of the database.

[0054] In actual operation, when creating a new database group in step 101, a new master-slave database group can be created based on DBLE according to the structure of the current database group, wherein the master-slave structure of the new database group is the same as the structure of the current database group.

[0055] For better understanding of the present application, the embodiments of the present application are described in detail below in combination with Figure 2 the database structure shown in the drawings.

[0056] As Figure 2 shown, the database structure includes: old group structure 100, new group mounting structure 200, data synchronization structure 300 and data distribution structure 400. Wherein, the old group (set): master library M1, slave library S1; the new group (set): master library M2, slave library S2. For simplicity of description, it is assumed that the system contains 1 old group, one master and three slaves, and needs to be expanded by one time storage space. The specific expansion method includes:

[0057] Firstly, four container libraries (i.e. databases) are newly created, including new group master library M2 and three new group slave libraries S2, and are managed to DMP, a new group and corresponding database instances are added, the high availability mode of the new group is started, and the master-slave replication of the new group master library M2 and the new group slave library S2 is normal. Then, the new group master library M2 is taken as one of the slave libraries of the old group master library M1, and is mounted to the old group master library M1, and the full data of the old group master library M1 is synchronized to the new group master library M2, and the full data of the new group master library M2 is synchronized to the three new group slave libraries S2. From now on, the data stored in the new group master library M2 and the three new group slave libraries S2 is completely consistent with the data of the old group master library M1 and the three old group slave libraries S1.

[0058] Subsequently, the application side online task is stopped, the old library master library M1 has no data update, and the data of all container libraries of the old and new groups remains unchanged. At this time, the new group master library M2 is unloaded from the old group master library M1 and disconnected, and the new group master library M2 and the new group slave library S2 are equivalent to a complete copy of the old group master library M1 and the old group slave library S1.

[0059] Then, through the schema (schema) configuration file of DMP, some shards are configured, for example, each container library contains 10 shards, the first half of the shards 1-5 are configured to the old group container library, and the remaining shards, i.e. the second half of the shards 6-10 are configured to the new group container library. After restarting the service, although the old group master library M1 and the new group master library M2 both have complete full shards, they only update data on the shards for which the configuration is effective. At this time, the old group only bears the data volume of the original first half of the shards, and the new group only bears the data volume of the second half of the shards.

[0060] In actual operation, the schema configuration file can specify the correspondence between the shards and the container library. For example, the schema configuration file originally has shards 1~10, which are configured to the old container library. In the embodiment of the application, the schema configuration file still has shards 1~10, but shards 1~5 are configured to the old container library, and shards 6~10 are configured to the new container library.

[0061] In the embodiment of the application, although the old library still has shards 1~10, only shards 1~5 are available, and shards 6~10 become redundant; although the new library also has shards 1~10, only shards 6~10 are available, and shards 1~5 become redundant.

[0062] In actual operation, the shard can be regarded as a database instance in the container library, which saves actual data. It is assumed that the old library originally has 10 available shards, and in the embodiment of the application, the old library and the new library each have 10 shards, but after the configuration through the schema file, the old library has 5 available shards (the other 5 shards are inaccessible, and the storage space is released after being deleted), and the new library also has 5 available shards (the other 5 shards are inaccessible, and the storage space is released after being deleted), and the number of live shards of the new and old libraries adds up to 10.

[0063] Figure 3 is the expansion flowchart of the database structure shown in Figure 2 , as shown in Figure 3 , the flowchart includes:

[0064] Step 301, creating N groups of new container libraries, each group (set) having one master and three slaves.

[0065] Step 302, putting the new container into the DMP (DBLE management console).

[0066] Step 303, adding a group and a database instance, and starting the high-availability mode of the new group. Based on the open source framework DBLE, after setting the master and slave and configuring the related parameters, the high-availability mode can be started, the data is copied from the master to the slave in quasi-real time, and the normal replication of the master and slave is ensured.

[0067] Step 304, judging whether the master-slave replication delay of the corresponding old library is 0. As long as there is data synchronization, a certain replication processing time is needed, that is, there is a delay. The master-slave replication delay is 0, which indicates that there is no data replication, and the synchronization has been completed.

[0068] Step 305, if not, continue to execute step 304; if yes, mounting the master of the new library to the master of the currently running old library.

[0069] Step 306, check whether the values of Slave_IO_Running and Slave_SQL_Running of the new master library are YES. The values of Slave_IO_Running and Slave_SQL_Running represent IO (Input Output) read and write and SQL (Structured Query Language) services, and the two values are YES, indicating that the master-slave relationship is normal, otherwise, the mounting is abnormal and needs to be mounted again.

[0070] Step 307, if not, continue to execute step 306; if yes, check whether all new container libraries are processed. That is, judge whether the values of Slave_IO_Running and Slave_SQL_Running of all new container libraries are YES. If yes, it indicates that the master-slave relationship processing is normal.

[0071] Step 308, if not, continue to execute steps 303-307; if yes, judge whether the master-slave replication delay of all groups is 0.

[0072] Step 309, if not, continue to execute step 308; if yes, the application side stops the online task.

[0073] Step 310, the master of the new library is unloaded from the master of the old library.

[0074] Step 311, modify the schema configuration file of DBLE, so that the relationship of the new library is parallel to the old library, the total number of shards is unchanged, but the number of shards borne by each set is reduced by half.

[0075] Step 312, according to the configuration of the schema file, delete the redundant shards in the new library and the old library respectively.

[0076] Step 313, the application side starts the online task.

[0077] Since half of the shards of the old group and half of the shards of the new group are redundant, after being deleted respectively, the space can be released.

[0078] As can be seen from the above description, the number of database groups (sets) is doubled, and the storage capacity is doubled; the shards of each group are taken as a set, that is, the original full amount of shards is obtained, and thus the expansion of the distributed database cluster is realized. Generally, the expansion processing method of the multi-group database cluster can be similar.

[0079] The database expansion method provided by the embodiment of the application has the following advantages:

[0080] (1) The storage capacity of the database cluster can be greatly expanded;

[0081] (2) The disk mounting size of each group container library can be controlled in an optimal range, and the disk performance problem can be controlled;

[0082] (3) The re-allocation of old data is flexible.

[0083] Based on the similar inventive concept, the embodiment of the present application also provides a database expansion system, as shown in the figure, the system comprises a distributed database middleware (DBLE) system 1 and a database expansion device 2, wherein the DBLE system comprises a DBLE management console (DMP) 11, and the DMP is used for setting the configuration information of the database group. Preferably, the database expansion device 2 can be used to realize the process of the above-mentioned database expansion method. Figure 4

[0084] Figure 5 It is a structure block diagram of the database expansion device 2, as shown in the figure, the database expansion device 2 comprises a new group creation unit 21, a mounting unit 22, a disconnecting unit 23 and a sharding unit 24, wherein: Figure 5

[0085] The new group creation unit 21 is used for creating a new database group with one master and multiple slaves based on the distributed database middleware (DBLE).

[0086] Specifically, the new group creation unit 21 can create a new database group with one master and multiple slaves based on the DBLE according to the structure of the current database group, wherein the one master and multiple slaves structure of the new database group is the same as the structure of the current database group.

[0087] The mounting unit 22 is used for mounting the new database group as a slave database to the master database of the current database group according to the configuration information of the DBLE management console DMP.

[0088] Specifically, the mounting unit 22 can mount the new database group as a slave database to the master database of the current database group, and judge whether the synchronization function information of the new database group is normal; in response to the judgment result being normal, it is determined that the new database group is successfully mounted as a slave database to the master database of the current database group.

[0089] The disconnecting unit 23 is used for disconnecting the new database group from the master database of the current database group in response to the completion of the data synchronization operation of each database in the new database group and the current database group.

[0090] The sharding unit 24 is used for performing a sharding operation on each database in the new database group and the current database group according to the configuration information of the DMP, so as to respectively determine the sharding quantity of the new database group and the current database group.

[0091] ​​Specifically, the sharding unit 24 is configured to perform sharding operation on each database in the new database group to determine the available number of shards of each database in the new database group, and perform sharding operation on each database in the current database group to determine the available number of shards of each database in the current database group.

[0092] The new database group is created by the new group creating unit 21 based on the DBLE, the mounting unit 22 mounts the new database group as a slave database to the master database of the current database group, and then performs data synchronization operation with the current database group. After the data synchronization operation is completed, the disconnection unit 23 disconnects the new database group from the master database of the current database group. Then, the sharding unit 24 performs sharding operation on each database in the new database group and the current database group. In this way, the capacity expansion is realized by creating a new database group, and the databases in the new database group and the current database group are not overloaded by sharding operation, so that the performance problem of the disk mounted by the container library can be avoided, and the performance of the database can be improved.

[0093] In actual operation, the database capacity expansion device 2 further includes a master-slave replication delay judgment unit and a synchronization determination unit, wherein:

[0094] The master-slave replication delay judgment unit is configured to judge the master-slave replication delay value of the current database group.

[0095] The synchronization determination unit is configured to determine that the master-slave data synchronization operation of the current database group is completed in response to the master-slave replication delay value of the current database group being zero.

[0096] In one embodiment, the database capacity expansion device 2 further includes a deletion unit configured to delete the unavailable shards after the sharding operation of each database in the new database group and the current database group.

[0097] The specific execution process of each unit can be referred to the description in the method embodiments, which will not be repeated here.

[0098] In actual operation, each unit can be combined or set individually, and the present application is not limited thereto.

[0099] The present embodiment also provides an electronic device, which can be a desktop computer, a tablet computer, a mobile terminal, and the like. The electronic device can be implemented according to the method embodiments and the database capacity expansion device / system embodiments, the contents of which are incorporated herein, and the repeated parts will not be repeated.

[0100] Figure 6 is a schematic block diagram of the system configuration of the electronic device 600 of the present embodiment. As shown in the figure, the electronic device 600 includes a processor 610, a memory 620, a power supply 630, a communication interface 640, and a user interface 650.Figure 6 As shown, the electronic device 600 may include a central processing unit 150 and a memory 140; the memory 140 is coupled to the central processing unit 150. It is worth noting that this figure is exemplary; other types of structures may be used to supplement or replace this structure to achieve telecommunications functions or other functions.

[0101] In one embodiment, the database expansion function can be integrated into the central processing unit 150. The central processing unit 150 can be configured to perform the following control:

[0102] Create a new database group with one master and multiple slaves based on the distributed database middleware (DBLE);

[0103] Based on the configuration information of the DBLE Management Console (DMP), the new database group is designated as the primary database that is mounted from the database to the current database group;

[0104] In response to the completion of data synchronization operations between each database in the new database group and the current database group, the new database group is disconnected from the master database of the current database group;

[0105] Based on the configuration information of the DMP, sharding operations are performed on each database in the new database group and the current database group to determine the number of shards for the new database group and the current database group, respectively.

[0106] As described above, the electronic device provided in this application creates a new database group based on DBLE and uses the new database group as the master database mounted from the current database group. It then performs data synchronization with the current database group. After the data synchronization is complete, the new database group is disconnected from the master database of the current database group. Subsequently, sharding is performed on each database in both the new and current database groups. This achieves both expansion by creating a new database group and prevents overloading of each database in both the new and current database groups through sharding, thereby avoiding disk performance issues associated with container library mounting and improving database performance.

[0107] In another embodiment, the database expansion device / system can be configured separately from the central processing unit 150. For example, the database expansion device / system can be configured as a chip connected to the central processing unit 150, and the database expansion function can be implemented through the control of the central processing unit.

[0108] like Figure 6 As shown, the electronic device 600 may also include: a communication module 110, an input unit 120, an audio processor 130, a display 160, and a power supply 170. It is worth noting that the electronic device 600 does not necessarily need to include these components.Figure 6 All components shown in FIG. 6; in addition, the electronic device 600 can further include Figure 6 components not shown in FIG. 6, reference can be made to the prior art.

[0109] As shown in FIG. 6, the central processing unit 150, which is sometimes also referred to as a controller or operating control, can include a microprocessor or other processor device and / or logic device, which receives input and controls the operation of the various components of the electronic device 600. Figure 6

[0110] The memory 140, for example, can be one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. Information relating to failures can be stored, in addition to programs for executing the information. The central processing unit 150 can execute the programs stored in the memory 140 to achieve information storage or processing, etc.

[0111] The input unit 120 provides input to the central processing unit 150. The input unit 120 is, for example, a key or touch input device. The power supply 170 is used to provide power to the electronic device 600. The display 160 is used to display display objects such as images and text. The display can be, for example, an LCD display, but is not limited thereto.

[0112] The memory 140 can be a solid state memory, such as a read only memory (ROM), a random access memory (RAM), a SIM card, etc. It can also be a memory that saves information even when power is off, can be selectively erased, and is provided with more data, examples of which are sometimes referred to as EPROM, etc. The memory 140 can also be some other type of device. The memory 140 includes a buffer memory 141 (sometimes referred to as a buffer). The memory 140 can include an application / function storage section 142 for storing application programs and function programs or for storing a flow for operating the electronic device 600 by the central processing unit 150.

[0113] The memory 140 can further include a data storage section 143 for storing data such as contacts, digital data, pictures, sounds, and / or any other data used by the electronic device. A driver program storage section 144 of the memory 140 can include various driver programs of the electronic device for communication functions and / or for performing other functions of the electronic device (such as a messaging application, an address book application, etc.).

[0114] ​The communication module 110 is a transmitter / receiver 110 that transmits and receives signals via the antenna 111. The communication module (transmitter / receiver) 110 is coupled to the central processor 150 to provide input signals and receive output signals, as is the case with conventional mobile communication terminals.

[0115] Based on different communication technologies, a plurality of communication modules 110, such as a cellular network module, a Bluetooth module, and / or a wireless LAN module, etc., can be provided in the same electronic device. The communication module (transmitter / receiver) 110 is also coupled to the speaker 131 and the microphone 132 via the audio processor 130 to provide audio output via the speaker 131 and receive audio input from the microphone 132, thereby implementing the usual telecommunication functions. The audio processor 130 can include any suitable buffers, decoders, amplifiers, etc. In addition, the audio processor 130 is also coupled to the central processor 150, thereby enabling recording on the local device via the microphone 132 and playing stored sounds on the local device via the speaker 131.

[0116] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the database expansion method.

[0117] In conclusion, the embodiment of the present application provides a database expansion scheme, which overcomes the deficiencies in the prior art database cluster expansion technology, and is simple and easy to implement, and can expand the database cluster without causing disk performance problems.

[0118] The preferred embodiments of the present application have been described above with reference to the accompanying drawings. Many features and advantages of the embodiments are apparent from the detailed specification, and it is therefore intended by the appended claims to cover all such features and advantages of the embodiments within their true spirit and scope. Further, since numerous modifications and changes can be made to the embodiments by those having ordinary skill in the art without departing from the scope of the application, it is not intended that the application be limited to the exact construction and operation described herein, and accordingly, all suitable modifications and equivalents should be considered as falling within the scope of the application.

[0119] Those skilled in the art will appreciate that embodiments of the present application can be devised for a method, a system, or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, etc.) embodying computer readable program code thereon.

[0120] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks

[0121] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks

[0122] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks

[0123] The principles and implementations of the present application are described in the specific embodiments, the above description of the embodiments is only to help understand the method of the present application and its core idea; at the same time, for those skilled in the art, according to the idea of the present application, the specific implementation and application range will be changed, and the above description of the present application should not be understood as the limitation of the present application.

Claims

1. A database scaling method, characterized by, The method comprises: According to the structure of the current database group, a new database group of one master and multiple slaves is created based on DBLE, wherein the one master and multiple slaves structure of the new database group is the same as the structure of the current database group; According to the configuration information of the DBLE management console DMP, the new database group is mounted as a slave database to the master database of the current database group; wherein the DMP is used to establish the master-slave relationship, high availability mode and start-stop service of the database group; In response to the completion of the data synchronization operation of each database in the new database group and the current database group, the new database group is disconnected from the master database of the current database group; According to the configuration information of the DMP, the sharding operation is performed on each database in the new database group to determine the available shard number of each database in the new database group; the sharding operation is performed on each database in the current database group to determine the available shard number of each database in the current database group; After the sharding operation of each database in the new database group and the current database group, the method further comprises: The unsharded databases after the sharding operation of each database in the new database group and the current database group are deleted.

2. The method of claim 1, wherein, Before mounting the new database group as a slave database to the master database of the current database group, the method further comprises: Judging the master-slave replication delay value of the current database group; In response to the master-slave replication delay value of the current database group being zero, it is determined that the master-slave data synchronization operation of the current database group is completed.

3. The method of claim 1, wherein, Mounting the new database group as a slave database to the master database of the current database group comprises: Mounting the new database group as a slave database to the master database of the current database group, and judging whether the synchronization function information of the new database group is normal; In response to the judgment result being normal, it is determined that the new database group is successfully mounted as a slave database to the master database of the current database group.

4. The database scaling apparatus according to claim 1, wherein The device comprises: A new group creation unit is configured to create a new database group of one master and multiple slaves based on DBLE according to the structure of the current database group, wherein the one master and multiple slaves structure of the new database group is the same as the structure of the current database group; A mounting unit is configured to mount the new database group as a slave database to the master database of the current database group according to the configuration information of the DBLE management console DMP; wherein the DMP is used to establish the master-slave relationship, high availability mode and start-stop service of the database group; A disconnection unit is configured to disconnect the new database group from the master database of the current database group in response to the completion of the data synchronization operation of each database in the new database group and the current database group; A sharding unit is configured to perform sharding operation on each database in the new database group according to the configuration information of the DMP to determine the available shard number of each database in the new database group; perform sharding operation on each database in the current database group to determine the available shard number of each database in the current database group; The device further comprises: A deleting unit is configured to delete the unavailable shards after the operation of each database shard in the new database group and the current database group.

5. A database scaling system, comprising: The system comprises the database expansion device of claim 4 and a distributed database middleware DBLE system, wherein the DBLE system comprises a DBLE management console DMP configured to set configuration information of a database group.

6. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, The processor implements the steps of the method of any one of claims 1 to 3 when executing the program.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program implements the steps of the method of any one of claims 1 to 3 when executed by the processor.

Citation Information

Patent Citations

  • Distributive database data backup piece deployment method and device

    CN106372161A

  • Distributed database online expansion method and device

    CN110489494A

  • Distributed database expansion method, distributed database system and computer readable storage medium

    CN112364104A