CN110019525A - A kind of method and apparatus of data-base capacity-enlarging - Google Patents

A kind of method and apparatus of data-base capacity-enlarging Download PDF

Info

Publication number
CN110019525A
CN110019525A CN201711276247.6A CN201711276247A CN110019525A CN 110019525 A CN110019525 A CN 110019525A CN 201711276247 A CN201711276247 A CN 201711276247A CN 110019525 A CN110019525 A CN 110019525A
Authority
CN
China
Prior art keywords
database
dilatation
data
routing rule
primary
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
Application number
CN201711276247.6A
Other languages
Chinese (zh)
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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201711276247.6A priority Critical patent/CN110019525A/en
Publication of CN110019525A publication Critical patent/CN110019525A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1464Management of the backup or restore process for networked environments
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • G06F11/1466Management of the backup or restore process to make the backup process non-disruptive
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Databases & Information Systems (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of expansion method of database and devices, are related to field of computer technology.One specific embodiment of this method includes: to establish the dilatation database of primary database;Wherein the dilatation database is synchronous with the holding of the data of the primary database;The routing rule of the dilatation database is configured according to preset rules, and original routing rule of the primary database is replaced according to the preset rules;Cancel synchronous between the dilatation database and the primary database.The embodiment can carry out dilatation while DB Backup for database, to reduce the time for occupying system service and cost, improve efficiency.

Description

A kind of method and apparatus of data-base capacity-enlarging
Technical field
The present invention relates to field of computer technology more particularly to a kind of method, apparatus of data-base capacity-enlarging, electronic equipment and Computer-readable medium.
Background technique
With the fast development of information technology, for a system, data volume and amount of access have the increasing of blowout It is long, with being continuously increased for data volume, it will lead to the memory space inadequate of existing database, data volume increases, and also causes to look into Inquiry amount increases, and the requirement to search efficiency is also higher, at this point, should just carry out dilatation from database level, it is empty to increase storage Between, form multiple database storage architecture.
Existing database expansion method needs halt system service, under data stationary state, by the portion in original database Divided data is transferred in the database of dilatation, is then then turned on service.
In realizing process of the present invention, at least there are the following problems in the prior art for inventor's discovery:
Existing method needs to interrupt system service, occupies the system service time, dilatation is at high cost, low efficiency.
Summary of the invention
In view of this, the embodiment of the present invention provides a kind of method and apparatus of data-base capacity-enlarging, it can be in DB Backup While for database carry out dilatation, thus reduce occupy system service time and cost, improve efficiency.
To achieve the above object, according to an aspect of an embodiment of the present invention, a kind of expansion method of database is provided, It include: the dilatation database for establishing primary database;Wherein the dilatation database is synchronous with the holding of the data of the primary database; The routing rule of the dilatation database is configured according to preset rules, and replaces the primary database according to the preset rules Original routing rule;Cancel synchronous between the dilatation database and the primary database.
Optionally, original routing rule of the primary database meets the preset rules, according to the preset rules The mark of data to be stored stores the data into corresponding database.
Optionally, after cancelling synchronous between the dilatation database and the primary database, the method also includes: Delete the data that replaced routing rule is not met in the primary database;It deletes described in not met in the dilatation database The data of the routing rule of dilatation database.
Optionally, the preset rules include: for any one data to be stored, according to the value of i by described wait store Data are stored into corresponding database;Wherein, A is the mark of the data to be stored, and i=f (A) %N, f (A) are predefined Mapping function, N are the sum of primary database and the quantity of dilatation database after dilatation, i=0,1,2 ..., N-1.
Optionally, before cancelling the synchronous step between the dilatation database and the primary database, the method Further include: whether the data transmission monitored in the primary database and the dilatation database is abnormal, abnormal if it exists, then cancels The routing rule of primary database described in the routing rule of the dilatation database and rollback.
To achieve the above object, other side according to an embodiment of the present invention provides a kind of dilatation dress of database It sets, comprising: synchronization module, for establishing the dilatation database of primary database;Wherein the dilatation database and the master data The data in library keep synchronizing;Routing module, for configuring the routing rule of the dilatation database, Yi Jigen according to preset rules Original routing rule of the primary database is replaced according to the preset rules;The synchronization module is also used in the routing module The routing rule of the dilatation database is configured according to preset rules, and replaces the primary database according to the preset rules Original routing rule after, cancel synchronous between the dilatation database and the primary database.
Optionally, original routing rule of the primary database meets the preset rules, according to the preset rules The mark of data to be stored stores the data into corresponding database.
Optionally, described device further include: cleaning modul, the synchronization module cancel the dilatation database with it is described After synchronization between primary database, for deleting the data for not meeting replaced routing rule in the primary database, with And delete the data that the routing rule of the dilatation database is not met in the dilatation database.
Optionally, the preset rules include: for any one data to be stored, according to the value of i by described wait store Data are stored into corresponding database;Wherein, A is the mark of the data to be stored, and i=f (A) %N, f (A) are predefined Mapping function, N are the sum of primary database and the quantity of dilatation database after dilatation, i=0,1,2 ..., N-1.
To achieve the above object, another aspect according to an embodiment of the present invention provides a kind of for data-base capacity-enlarging Electronic equipment, comprising: one or more processors;Storage device, for storing one or more programs, when one or Multiple programs are executed by one or more of processors, so that one or more of processors realize a kind of expansion of database Any method in appearance method.
Optionally, described device further include: monitoring modular, for the synchronization module cancel the dilatation database with Before synchronization between the primary database, whether the data transmission monitored in the primary database and the dilatation database is different Often, abnormal if it exists, then cancel the dilatation database routing rule and rollback described in primary database routing rule.
To achieve the above object, another aspect according to an embodiment of the present invention provides a kind of for data-base capacity-enlarging Computer-readable medium, be stored thereon with computer program, which is characterized in that one is realized when described program is executed by processor Any method in the expansion method of kind database.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that because using in the same of DB Backup When for database carry out dilatation technological means, so overcome occupy the system service time transfer data the technical issues of, into And reaching reduces the time for occupying system service and cost, the technical effect improved efficiency.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is a kind of schematic diagram of the key step of the expansion method of database according to an embodiment of the present invention;
Fig. 2 is a kind of preferred flow charts of the expansion method of database according to an embodiment of the present invention;
Fig. 3 is a kind of schematic diagram of the major part of the flash chamber of database according to an embodiment of the present invention;
Fig. 4 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 5 is adapted for the structural representation of the computer system for the terminal device or server of realizing the embodiment of the present invention Figure.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
Fig. 1 is a kind of schematic diagram of the key step of the expansion method of database according to an embodiment of the present invention, such as Fig. 1 institute Show:
Step S101 indicates to establish the dilatation database of primary database;Wherein the dilatation database and the primary database Data keep synchronize;The effect of this step can be played the role of data backup, be simultaneously for main Database copy Primary database dilatation is prepared, the time required to saving dilatation.Databus can be used, and (distributed data base of a low latency is same Step system) data are synchronized.
Step S102 indicates the routing rule that the dilatation database is configured according to preset rules, and according to described default Rule replaces original routing rule of the primary database;The effect of this step is the routing rule by increasing dilatation database With the routing rule of modification primary database, to make dilatation database have routing function as primary database, increasing has The quantity of the database of routing function provides service for system.
Wherein, original routing rule of the primary database will also meet the preset rules, and the preset rules are root The data are stored into corresponding database according to the mark of data to be stored, the routing rule in the embodiment of the present invention is unlimited In the routing rule for storage, which is also used to the operation such as access of data.The use of data to be stored can be chosen Family ID or source IP addresses, for any one data to be stored, store the data to be stored according to the value of i as mark Into corresponding database;Wherein, A is the mark of the data to be stored, and i=f (A) %N, f (A) are predefined mapping letter Number, N are the sum of primary database and the quantity of dilatation database after dilatation, i=0,1,2 ..., N-1.For example, existing master data Library 0 and primary database 1 establish corresponding dilatation database 2 and database 3 with data synchronizing function for it respectively, make a reservation for Adopted mapping function can construct a kind of Hash mapping, and the mark A of data to be stored is converted to the arbitrary number between 0~9, main number Original routing rule according to library 0 is f (A) %2=0, when the remainder for indicating that the f (A) of a certain data is divided exactly by 2 is 0, the data quilt It is stored in primary database 0, original routing rule of primary database 1 is f (A) %2=1, indicates what the f (A) of a certain data was divided exactly by 2 When remainder is 1, which is stored into primary database 1.When carrying out dilatation to primary database 0 and primary database 1, according to default rule Then, f (A) %4=2 is configured by the routing rule of dilatation database 2, indicates that the remainder that the f (A) of a certain data is divided exactly by 4 is 2 When, which is stored into dilatation database 2, similarly, f (A) %4=3 is configured by the routing rule of dilatation database 3, and, The routing rule of primary database 0 is replaced with into f (A) %4=0, the routing rule of primary database 1 is replaced with into f (A) %4=1, Four databases existing in this way all have respective routing rule, can provide clothes according to respective routing rule for system Business.The modification of routing rule can be realized using the method for the configuration of dynamic modification system, in the feelings that guarantee system is not restarted Under condition, the relevant configured parameter of system is modified, and is come into force.
Step S103 indicates to cancel synchronous between the dilatation database and the primary database, realization dilatation.This step Rapid effect is dilatation database to be stood alone as the database with routing function to provide service for system, and it is empty to save storage Between.
Before cancelling the synchronous step between the dilatation database and the primary database, the method also includes: Whether the data transmission monitored in the primary database and the dilatation database is abnormal, abnormal if it exists, then cancels the expansion The routing rule of primary database described in the routing rule of appearance database and rollback.The effect of this step is when improving dilatation There is abnormal timely rollback in serious forgiveness.Rollback can be carried out by the way of dynamic configuration routing rule.
After cancelling synchronous between the dilatation database and the primary database, the method also includes: delete institute State the data that replaced routing rule is not met in primary database;And it deletes in the dilatation database and does not meet the expansion Hold the data of the routing rule of database.Due to primary database be that data are synchronous before database, so according to respective After existing routing rule deletes incongruent data, remaining data are to meet the data of current routing rule, can be with It is used directly to provide service to system, does not need the step of shifting data under static state, be not take up the system service time, Dilatation cost has been saved, has been improved efficiency.
Database to be expanded can also be resettled for existing database at this time, keep data same with existing database Step for backing up to data, while preparing for data-base capacity-enlarging next time, further increases the effect of data-base capacity-enlarging Rate.
Fig. 2 is a kind of preferred flow charts of the expansion method of database according to an embodiment of the present invention, as shown in Figure 2:
The dilatation database of primary database is established in S201 expression, and the data and dilatation number of primary database are made using databus It keeps synchronizing according to the data in library, this process persistently carries out, until dilatation terminates.Primary database is two-way with dilatation database It is synchronous, the consistency of data when ensure that dilatation.
S202 indicates to increase the configuration information and routing rule of primary database and dilatation database.These newly-increased configurations Information equal Pending The Entry Into Force in this step, waits dynamic configuration for later use to control coming into force opportunity for these configuration informations.
S203 indicates gradually to enable increased configuration information and routing rule using dynamic configuration.Monitoring data are transmitted No normal, whether the data between primary database and dilatation database are synchronous normal.If there is any exception, then using dynamically matching It sets control and rolls back to original configuration information.This step improves the serious forgiveness of whole system, when occurring abnormal, can return in time Rolling.
When S204 indicates that the configuration information newly increased and routing rule all come into force and monitor without exception, cancel master data Library is synchronous with the data of dilatation database.
S205 is indicated according to the data for not meeting corresponding routing rule in deletion database.
S206 expression continues as existing Database database to be expanded.
Fig. 3 is a kind of schematic diagram of the major part of the flash chamber 300 of database according to an embodiment of the present invention, is such as schemed Shown in 3:
Synchronization module 301 is used to establish the dilatation database of primary database;Wherein the dilatation database and the main number It keeps synchronizing according to the data in library;The effect of this module is can to play the role of data backup, together for main Database copy Shi Weizhu data-base capacity-enlarging is prepared, the time required to saving dilatation.Databus (the distributed data of a low latency can be used Library synchronization system) data are synchronized.
Routing module 302 is used to configure the routing rule of the dilatation database according to preset rules, and according to described Preset rules replace original routing rule of the primary database;The effect of this module is the routing by increasing dilatation database The routing rule of rule and modification primary database increases to make dilatation database have routing function as primary database The quantity of database with routing function provides service for system.
Wherein, original routing rule of the primary database will also meet the preset rules, and the preset rules are root The data are stored into corresponding database according to the mark of data to be stored, the routing rule in the embodiment of the present invention is unlimited In the routing rule for storage, which is also used to the operation such as access of data.The use of data to be stored can be chosen Family ID or source IP addresses, for any one data to be stored, store the data to be stored according to the value of i as mark Into corresponding database;Wherein, A is the mark of the data to be stored, and i=f (A) %N, f (A) are predefined mapping letter Number, N are the sum of primary database and the quantity of dilatation database after dilatation, i=0,1,2 ..., N-1.For example, existing master data Library 0 and primary database 1 establish corresponding dilatation database 2 and database 3 with data synchronizing function for it respectively, make a reservation for Adopted mapping function can construct a kind of Hash mapping, and the mark A of data to be stored is converted to the arbitrary number between 0~9, main number Original routing rule according to library 0 is f (A) %2=0, when the remainder for indicating that the f (A) of a certain data is divided exactly by 2 is 0, the data quilt It is stored in primary database 0, original routing rule of primary database 1 is f (A) %2=1, indicates what the f (A) of a certain data was divided exactly by 2 When remainder is 1, which is stored into primary database 1.When carrying out dilatation to primary database 0 and primary database 1, according to default rule Then, f (A) %4=2 is configured by the routing rule of dilatation database 2, indicates that the remainder that the f (A) of a certain data is divided exactly by 4 is 2 When, which is stored into dilatation database 2, similarly, f (A) %4=3 is configured by the routing rule of dilatation database 3, and, The routing rule of primary database 0 is replaced with into f (A) %4=0, the routing rule of primary database 1 is replaced with into f (A) %4=1, Four databases existing in this way all have respective routing rule, can provide clothes according to respective routing rule for system Business.The modification of routing rule can be realized using the method for the configuration of dynamic modification system, in the feelings that guarantee system is not restarted Under condition, the relevant configured parameter of system is modified, and is come into force.
Synchronization module 301 is also used to be advised in routing module 302 according to the routing that preset rules configure the dilatation database Then, and according to the preset rules after the original routing rule for replacing the primary database, cancel the dilatation database It is synchronous between the primary database.The effect of this module is that dilatation database is stood alone as the database with routing function Service is provided for system, and saves memory space.
Device 300 may also include monitoring module, for cancelling the dilatation database and the master in the synchronization module Before synchronization between database, whether the data transmission monitored in the primary database and the dilatation database is abnormal, if There are exceptions, then cancel the dilatation database routing rule and rollback described in primary database routing rule.This module Effect be serious forgiveness when improving dilatation, there is abnormal timely rollback.Can by the way of dynamic configuration routing rule into Row rollback.
Device 300 can also include cleaning modul, cancel the dilatation database and the main number in the synchronization module After the synchronization between library, for deleting the data for not meeting replaced routing rule in the primary database, and, it deletes Except the data for the routing rule for not meeting the dilatation database in the dilatation database.Due to primary database and from database It is that data synchronize before, so remaining data are after according to respectively existing routing rule deletes incongruent data For the data for meeting current routing rule, it can be used directly to provide service to system, not need data under static state The step of transfer, is not take up the system service time, has saved dilatation cost, has improved efficiency.
Synchronization module 301 can also resettle database to be expanded for existing database at this time, protect with existing database It is synchronous to hold data, for being backed up to data, while preparing for data-base capacity-enlarging next time, further increases database expansion The efficiency of appearance.
Fig. 4 is shown can be using a kind of expansion method of database of the embodiment of the present invention or the exemplary system of device Framework 400.
As shown in figure 4, system architecture 400 may include terminal device 401,402,403, network 404 and server 405. Network 404 between terminal device 401,402,403 and server 405 to provide the medium of communication link.Network 404 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 401,402,403 and be interacted by network 404 with server 405, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 401,402,403 The application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 401,402,403 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 405 can be to provide the server of various services, such as utilize terminal device 401,402,403 to user The shopping class website browsed provides the back-stage management server supported.Back-stage management server can believe the product received The data such as breath inquiry request carry out the processing such as analyzing, and processing result (such as target push information, product information) is fed back to Terminal device.
It should be noted that a kind of expansion method of database provided by the embodiment of the present invention is generally by server 405 It executes, correspondingly, a kind of flash chamber of database is generally positioned in server 405.
It should be understood that the number of terminal device, network and server in Fig. 4 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Fig. 5 show the structural representation for being suitable for the computer system 500 for the terminal device for being used to realize the embodiment of the present invention Figure.Terminal device shown in fig. 5 is only an example, should not function to the embodiment of the present invention and use scope bring it is any Limitation.
As shown in figure 5, computer system 500 includes central processing unit (CPU) 501, it can be read-only according to being stored in Program in memory (ROM) 502 or be loaded into the program in random access storage device (RAM) 503 from storage section 508 and Execute various movements appropriate and processing.In RAM 503, also it is stored with system 500 and operates required various programs and data. CPU 501, ROM 502 and RAM 503 are connected with each other by bus 504.Input/output (I/O) interface 505 is also connected to always Line 504.
I/O interface 505 is connected to lower component: the importation 506 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 507 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 508 including hard disk etc.; And the communications portion 509 of the network interface card including LAN card, modem etc..Communications portion 509 via such as because The network of spy's net executes communication process.Driver 510 is also connected to I/O interface 505 as needed.Detachable media 511, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 510, in order to read from thereon Computer program be mounted into storage section 508 as needed.
Particularly, disclosed embodiment, the process of key step figure description above may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program generation for executing method shown in key step figure Code.In such embodiments, which can be downloaded and installed from network by communications portion 509, and/or It is mounted from detachable media 511.When the computer program is executed by central processing unit (CPU) 501, execute of the invention The above-mentioned function of being limited in system.
It should be noted that computer-readable medium shown in the present invention includes computer-readable signal media or computer Readable storage medium storing program for executing or the two any combination.Computer readable storage medium include but is not limited to electricity, magnetic, light, Electromagnetism, infrared ray, the system of semiconductor, any combination of device or device or above content.Computer readable storage medium Be specifically including but not limited to: electrical connection, portable computer diskette with one or more conducting wires, hard disk, random access are deposited Reservoir (RAM), read-only memory (ROM), erasable programmable read only memory (EPROM or flash memory), optical fiber, Portable, compact Disk read-only memory (CD-ROM), light storage device, magnetic memory device or above content any combination.In the present invention In, computer readable storage medium, which includes any, includes or the tangible medium of storage program, which can be commanded and execute system System, device or device use or in connection;Computer-readable signal media includes in a base band or conduct The data-signal that carrier wave a part is propagated, wherein carrying computer-readable program code, the data-signal of this propagation can To take various forms, including but not limited to electromagnetic signal, any combination of optical signal or above-mentioned signal.Computer-readable letter Number medium can also be any computer-readable medium other than computer readable storage medium, which can be with It sends, propagate or transmits for by the use of instruction execution system, device or device or program in connection.Meter The program code for including on calculation machine readable medium can transmit with any suitable medium, including but not limited to: wireless, electric wire, Any combination of optical cable, RF (radio frequency) etc. or above-mentioned medium.
Key step figure or block diagram in attached drawing, illustrate the system, method and calculating according to various embodiments of the invention The architecture, function and operation in the cards of machine program product, each box in key step figure or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should be noted that in some implementations as replacements, being marked in box The function of note can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are actually It can be performed in parallel, can also execute in the opposite order sometimes, execution sequence depends on the functions involved.Also it to infuse Meaning, each box in block diagram or key step figure with and combinations thereof, can the functions or operations as defined in executing it is special Hardware based system is realized, or can be realized using a combination of dedicated hardware and computer instructions.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet Include synchronization module, routing module, cleaning modul.Wherein, the title of these modules is not constituted under certain conditions to the module The restriction of itself, for example, synchronization module is also described as " for establishing the module of dilatation database ".
On the other hand, the embodiment of the invention also provides a kind of computer-readable medium, which can be with It is included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned meter Calculation machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, So that the equipment includes: to establish the dilatation database of primary database;The wherein number of the dilatation database and the primary database It is synchronized according to holding;The routing rule of the dilatation database is configured according to preset rules, and is replaced according to the preset rules Original routing rule of the primary database;Cancel synchronous between the dilatation database and the primary database.
Technical solution according to an embodiment of the present invention carries out dilatation while DB Backup because using for database Technological means, so overcome occupy the system service time transfer data the technical issues of, and then reach reduce occupancy system The time of service and cost, the technical effect improved efficiency.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (12)

1. a kind of expansion method of database characterized by comprising
Establish the dilatation database of primary database;Wherein the dilatation database is synchronous with the holding of the data of the primary database;
The routing rule of the dilatation database is configured according to preset rules, and replaces the main number according to the preset rules According to original routing rule in library;
Cancel synchronous between the dilatation database and the primary database.
2. the method according to claim 1, wherein original routing rule of the primary database meet it is described pre- If regular, the preset rules are to be stored the data into corresponding database according to the mark of data to be stored.
3. according to the method described in claim 2, it is characterized in that, cancelling between the dilatation database and the primary database Synchronization after, the method also includes:
Delete the data that replaced routing rule is not met in the primary database;
Delete the data that the routing rule of the dilatation database is not met in the dilatation database.
4. the preset rules include: according to the method described in claim 2, its spy is
For any one data to be stored, the data to be stored is stored into corresponding database according to the value of i;Its In, A is the mark of the data to be stored, and i=f (A) %N, f (A) they are predefined mapping function, and N is the master data after dilatation The sum of library and the quantity of dilatation database, i=0,1,2 ..., N-1.
5. the method according to claim 1, wherein cancelling between the dilatation database and the primary database Synchronization step before, the method also includes:
Whether the data transmission monitored in the primary database and the dilatation database is abnormal, abnormal if it exists, then cancels institute State dilatation database routing rule and rollback described in primary database routing rule.
6. a kind of flash chamber of database characterized by comprising
Synchronization module, for establishing the dilatation database of primary database;Wherein the dilatation database and the primary database Data keep synchronizing;
Routing module, for configuring the routing rule of the dilatation database according to preset rules, and according to the default rule Then replace original routing rule of the primary database;
The synchronization module is also used to configure the routing rule of the dilatation database according to preset rules in the routing module, And after replacing original routing rule of the primary database according to the preset rules, cancel the dilatation database and institute State the synchronization between primary database.
7. device according to claim 6, which is characterized in that original routing rule of the primary database meets described pre- If regular, the preset rules are to be stored the data into corresponding database according to the mark of data to be stored.
8. device according to claim 7, which is characterized in that described device further include:
Cleaning modul is used after the synchronization module cancels synchronous between the dilatation database and the primary database The data of replaced routing rule are not met in the deletion primary database, and, it deletes in the dilatation database not Meet the data of the routing rule of the dilatation database.
9. device according to claim 7, spy are, the preset rules include:
For any one data to be stored, the data to be stored is stored into corresponding database according to the value of i;Its In, A is the mark of the data to be stored, and i=f (A) %N, f (A) they are predefined mapping function, and N is the master data after dilatation The sum of library and the quantity of dilatation database, i=0,1,2 ..., N-1.
10. device according to claim 6, which is characterized in that described device further include:
Monitoring modular, for the synchronization module cancel between the dilatation database and the primary database it is synchronous it Before, whether the data transmission monitored in the primary database and the dilatation database is abnormal, and it is abnormal if it exists, then described in cancellation The routing rule of primary database described in the routing rule of dilatation database and rollback.
11. a kind of electronic equipment for data-base capacity-enlarging characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real Now such as method as claimed in any one of claims 1 to 5.
12. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor Such as method as claimed in any one of claims 1 to 5 is realized when row.
CN201711276247.6A 2017-12-06 2017-12-06 A kind of method and apparatus of data-base capacity-enlarging Pending CN110019525A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711276247.6A CN110019525A (en) 2017-12-06 2017-12-06 A kind of method and apparatus of data-base capacity-enlarging

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711276247.6A CN110019525A (en) 2017-12-06 2017-12-06 A kind of method and apparatus of data-base capacity-enlarging

Publications (1)

Publication Number Publication Date
CN110019525A true CN110019525A (en) 2019-07-16

Family

ID=67186870

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711276247.6A Pending CN110019525A (en) 2017-12-06 2017-12-06 A kind of method and apparatus of data-base capacity-enlarging

Country Status (1)

Country Link
CN (1) CN110019525A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112364104A (en) * 2021-01-13 2021-02-12 上海爱可生信息技术股份有限公司 Distributed database capacity expansion method, distributed database system and computer readable storage medium
CN113448940A (en) * 2020-03-24 2021-09-28 北京京东振世信息技术有限公司 Method and device for expanding database

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130268499A1 (en) * 2010-12-28 2013-10-10 Hitachi Solutions, Ltd. Information management method, and computer for providing information
CN105069109A (en) * 2015-08-07 2015-11-18 北京思特奇信息技术股份有限公司 Dilatation method and system of distributed database
US20160267132A1 (en) * 2013-12-17 2016-09-15 Hewlett-Packard Enterprise Development LP Abstraction layer between a database query engine and a distributed file system
CN107220259A (en) * 2016-03-22 2017-09-29 北京京东尚科信息技术有限公司 A kind of database extension system, equipment and the method for extending database

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130268499A1 (en) * 2010-12-28 2013-10-10 Hitachi Solutions, Ltd. Information management method, and computer for providing information
US20160267132A1 (en) * 2013-12-17 2016-09-15 Hewlett-Packard Enterprise Development LP Abstraction layer between a database query engine and a distributed file system
CN105069109A (en) * 2015-08-07 2015-11-18 北京思特奇信息技术股份有限公司 Dilatation method and system of distributed database
CN107220259A (en) * 2016-03-22 2017-09-29 北京京东尚科信息技术有限公司 A kind of database extension system, equipment and the method for extending database

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
开源中国: "实用高效,水平分库", 《开源中国》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113448940A (en) * 2020-03-24 2021-09-28 北京京东振世信息技术有限公司 Method and device for expanding database
CN113448940B (en) * 2020-03-24 2023-09-22 北京京东振世信息技术有限公司 Database capacity expansion method and device
CN112364104A (en) * 2021-01-13 2021-02-12 上海爱可生信息技术股份有限公司 Distributed database capacity expansion method, distributed database system and computer readable storage medium

Similar Documents

Publication Publication Date Title
CN109413127B (en) Data synchronization method and device
CN109189835A (en) The method and apparatus of the wide table of data are generated in real time
CN110019211A (en) The methods, devices and systems of association index
CN109150929B (en) Data request processing method and device under high concurrency scene
CN107506218A (en) The management method and management system of a kind of configuration file
CN109905286A (en) A kind of method and system of monitoring device operating status
CN110019062A (en) Method of data synchronization and system
CN110019539A (en) A kind of method and apparatus that the data of data warehouse are synchronous
CN110334145A (en) The method and apparatus of data processing
CN109413125A (en) The method and apparatus of dynamic regulation distributed system resource
CN109918425A (en) A kind of method and system realized data and import non-relational database
CN110019310A (en) Data processing method and system, computer system, computer readable storage medium
CN110166507A (en) More resource regulating methods and device
CN110019346A (en) A kind of data processing method and device based on double primary databases
CN112612467A (en) Method and device for processing micro front-end architecture based on qiankun
CN112925859A (en) Data storage method and device
CN110019525A (en) A kind of method and apparatus of data-base capacity-enlarging
CN112783887A (en) Data processing method and device based on data warehouse
CN113076186B (en) Task processing method, device, electronic equipment and storage medium
CN110109912A (en) A kind of identifier generation method and device
CN109947736A (en) The method and system calculated in real time
CN110020373A (en) The method and apparatus that static page is stored, browsed
CN110020271A (en) Method and system for cache management
CN110309157A (en) A kind of data synchronization updating method and apparatus
CN112711572B (en) Online capacity expansion method and device suitable for database and table division

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: 20190716