WO2023050706A1 - Database multi-write method and apparatus, and related device - Google Patents

Database multi-write method and apparatus, and related device Download PDF

Info

Publication number
WO2023050706A1
WO2023050706A1 PCT/CN2022/078209 CN2022078209W WO2023050706A1 WO 2023050706 A1 WO2023050706 A1 WO 2023050706A1 CN 2022078209 W CN2022078209 W CN 2022078209W WO 2023050706 A1 WO2023050706 A1 WO 2023050706A1
Authority
WO
WIPO (PCT)
Prior art keywords
database
database cluster
data
write
cluster
Prior art date
Application number
PCT/CN2022/078209
Other languages
French (fr)
Chinese (zh)
Inventor
董善义
Original Assignee
苏州浪潮智能科技有限公司
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 苏州浪潮智能科技有限公司 filed Critical 苏州浪潮智能科技有限公司
Publication of WO2023050706A1 publication Critical patent/WO2023050706A1/en

Links

Images

Classifications

    • 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/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • 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/1448Management of the data involved in backup or backup restore
    • 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/24Querying
    • G06F16/245Query processing

Definitions

  • the present application relates to the technical field of databases, in particular to a database multi-writing method, and also relates to a database multi-writing device, system and computer-readable storage medium.
  • the purpose of this application is to provide a method for database multi-writing, which realizes code non-invasive, automatic database multi-writing, improves the efficiency of database multi-writing, and reduces research and development costs; another purpose of this application It provides a database multi-writing device, system and computer-readable storage medium, all of which have the above-mentioned beneficial effects.
  • the present application provides a method for multiple database writing, including:
  • the Envoy agent deployed in the first database cluster intercepts the write command
  • the method before determining the data to be written according to the write instruction, the method further includes:
  • the step of determining the data to be written according to the write instruction is executed.
  • the database multi-writing method also includes:
  • the first database cluster When the first database cluster receives a read instruction, obtain response information corresponding to the read instruction;
  • the response information corresponding to the read instruction it also includes:
  • the step of acquiring the response information corresponding to the read command is performed.
  • the database multi-writing method also includes:
  • the Envoy proxy is deployed in each database cluster, and the Envoy proxy in each database cluster is created through service grid technology and Wasm technology.
  • the establishing a connection with the second database cluster according to the pre-stored second database cluster information includes:
  • the present application also discloses a database multi-writing device, including:
  • An instruction interception module configured to intercept the write instruction by an Envoy agent deployed in the first database cluster when the first database cluster receives the write instruction
  • a data determination module configured to determine the data to be written according to the write instruction
  • the data multi-writing module is configured to establish a connection with the second database cluster according to the pre-stored second database cluster information, and write the data to be written into the second database cluster.
  • the present application also discloses a database multi-write device, including:
  • a processor configured to implement the steps of any one of the database multi-writing methods described above when executing the computer program.
  • the present application also discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any of the above-mentioned database multi-write method steps.
  • a database multi-write method provided by the present application includes that when the first database cluster receives a write command, the Envoy agent deployed in the first database cluster intercepts the write command; according to the write command Determine the data to be written; establish a connection with the second database cluster according to the prestored information of the second database cluster, and write the data to be written into the second database cluster.
  • the database multi-write method deploys the Envoy agent in each database cluster, and sets the relevant information of the standby database cluster corresponding to its own database cluster in the Envoy agent, so as to establish a connection with the standby database cluster based on this information.
  • the Envoy agent intercepts the data writing instructions received by its own database cluster, and after obtaining the data to be written, writes it to the standby database cluster, thereby realizing database reading and writing.
  • this implementation method can realize automatic database multi-writing without code modification, effectively improves the efficiency of database multi-writing, and reduces research and development costs at the same time.
  • a database multi-writing device, system, and computer-readable storage medium provided by the present application all have the above-mentioned beneficial effects, and will not be repeated here.
  • Fig. 1 is a schematic flow chart of a database multi-writing method provided by the present application
  • Fig. 2 is the implementation flowchart of a kind of database multi-writing and disaster recovery method provided by the application;
  • Fig. 3 is a schematic structural diagram of a database multi-writing device provided by the present application.
  • Fig. 4 is a schematic structural diagram of a database multi-writing system provided by the present application.
  • FIG. 5 is a schematic structural diagram of a computer-readable storage medium provided by the present application.
  • the core of this application is to provide a database multi-writing method, the database multi-writing method realizes code non-invasive, automatic database multi-writing, improves the efficiency of database multi-writing, and reduces research and development costs; another core of this application It provides a database multi-writing device, system and computer-readable storage medium, which also have the above-mentioned beneficial effects.
  • the embodiment of the present application provides a database multi-writing method.
  • Fig. 1 is a schematic flow chart of a method for multi-writing database provided by the present application, the method for multi-writing database may include:
  • This step aims to intercept the write command, which is the command that needs to write/store data to the corresponding database cluster, and is generally initiated by the client to the database cluster so that the data to be written can be stored in the database cluster.
  • Database cluster The interception operation can be implemented by the Envoy agent deployed in the database cluster.
  • Envoy is a self-organizing module designed for the L7 agent and communication bus of the service architecture, and has no direct dependence on the application server.
  • the Envoy agent deployed on the database cluster will intercept the command in order to use the write command Perform follow-up operations to achieve multiple writes to the database.
  • the Envoy agent intercepts the write command to store the data to be written to other database clusters at the same time based on the write command (here, generally, the standby database cluster of the current database cluster, that is, the standby database cluster of the first database cluster , that is, the second database cluster described below), however, it does not affect the data storage operation performed by the first database cluster based on the write instruction.
  • the above-mentioned Envoy agents are deployed in each database cluster, and the Envoy agents in each database cluster are created through Service Mesh technology and Wasm technology.
  • This optional embodiment provides a method for deploying an Envoy proxy, which is implemented through service grid technology and Wasm technology, wherein the service grid technology is used to implement data communication between Envoys, and Wasm technology is used to implement function settings and extensions.
  • Envoy agents are deployed in each database cluster through service grid technology and Wasm technology, so that all Envoys build a transparent service grid, and the applications in it only need to simply send and receive with the local Envoy information, does not need to focus on the entire network topology.
  • the service mesh is the infrastructure layer that handles the communication between services. It is responsible for reliably delivering requests through the complex service topology that constitutes modern cloud-native applications.
  • Service Mesh is usually in the form of an array of lightweight network agents To implement, these agents are deployed together with the application code, and the application does not need to be aware of the existence of the agent.
  • Wasm technology supports technicians to write machine code to run in the browser's virtual security sandbox, and even the upgraded Wasm is designed as a compilation target for other languages, allowing server-side code (such as C or C++ code, etc.) to be compiled In it, it can be combined with the service grid to expand its capabilities.
  • server-side code such as C or C++ code, etc.
  • This step aims to realize the determination of the data to be written based on the write instruction.
  • the client that initiates the write command can attach the data to be written to the write command, so that the Envoy proxy can obtain the data to be written by parsing the write command; of course, the client can also You can first initiate a write command to the first database cluster to inform the first database cluster to receive and store the data to be written, and then send the data to be written to the first database cluster, so that the Envoy agent can intercept the write After the command is executed, the data to be written sent to the first database cluster is acquired. It can be seen that the acquisition method of the data to be written is not unique, which is not limited in this application.
  • determining the data to be written according to the write instruction it may also include: parsing the write instruction to obtain the traffic protocol; judging whether the traffic protocol conforms to the database communication protocol; if the traffic protocol conforms to the database communication protocol, execute the step of determining the data to be written according to the write instruction.
  • the data multi-write method provided by this optional embodiment can determine whether to continue to perform the database multi-write operation by judging whether the write command conforms to the database communication protocol, thereby avoiding the database multi-write due to the write command not conforming to the database communication protocol In case of failure, save resource usage and time wastage.
  • the Envoy agent intercepts a write command, it first parses it to obtain its corresponding traffic protocol, and then judges whether the traffic protocol conforms to the database communication protocol.
  • the traffic protocol does not conform to the database communication protocol, it no longer Execute the multi-write operation of the database, just discard the write command; if the traffic protocol conforms to the database communication protocol, then perform the step of obtaining the data to be written based on the write command, so as to realize the multi-write function of the database.
  • S103 Establish a connection with the second database cluster according to the pre-stored second database cluster information, and write the data to be written into the second database cluster.
  • This step aims to write the data to be written into the second database cluster, which is the standby database cluster of the first database cluster.
  • the number of the second database clusters can be multiple, that is, the standby database cluster The number of can be multiple, so as to realize multiple backups of the data to be written.
  • the first database cluster and the second database cluster can be mutually standby database clusters, that is, through the Envoy agent in the first database cluster, the data information written in the first database cluster can be written into the second database cluster at the same time, through the second database cluster
  • the Envoy proxy of the second database cluster can simultaneously write the data information written into the second database cluster into the first database cluster.
  • the Envoy agent of each database cluster relevant information of its corresponding standby database cluster is preset, so as to establish a connection with the standby database cluster, thereby realizing the multi-write function of the database. That is to say, the Envoy agent deployed in the first database cluster pre-stores the relevant information of the second database cluster, that is, the above-mentioned pre-stored information of the second database cluster. Therefore, after obtaining the data to be written, it can be based on the pre-stored first The information of the second database cluster establishes a connection with the second database cluster, so that the data to be written is written into the second database cluster. So far, the multi-write operation of the database is completed.
  • the above-mentioned establishing a connection with the second database cluster according to the pre-stored second database cluster information may include: establishing a connection with the second database cluster according to the pre-stored address information of the second database cluster.
  • This optional embodiment provides a method for establishing a connection to a database cluster, which is implemented based on the address information of the database cluster, that is, the address information of the standby database cluster (such as the address information of the second database cluster pre-stored above) is stored in the Envoy agent in advance
  • the Envoy agent deployed in the first database cluster can establish a connection with the second database according to the pre-stored address information of the second database cluster, thereby realizing multiple writes to the database.
  • the database multi-write method may further include: when the first database cluster receives a read instruction, obtaining response information corresponding to the read instruction; determining whether the read operation is successful according to the response information; if the read If the fetch operation is unsuccessful, the read instruction is forwarded to the second database cluster; the read data fed back by the second database cluster according to the read instruction is obtained; and the read data is fed back to the initiator of the read instruction.
  • the database multi-write method provided by this optional embodiment can also implement read command interception, so that when the first database cluster fails to return to read data, it can read data from the second database cluster and return to the original read command.
  • Instruction-fetching client so as to realize the database backup disaster recovery function.
  • the client when it needs to read data from the first database cluster, it can initiate a read command to the first database cluster.
  • the Envoy agent deployed on the first database cluster will also intercept the read command. And obtain the response information of the first database cluster to the read command; further, judge whether the read operation is successful according to the response information, that is, judge whether the first database cluster successfully feeds back the read data to the client, if the read operation is successful, That is, if the first database cluster successfully feeds back the read data to the client, there is no need to perform other operations, and the read command can be discarded.
  • the read operation of the first database cluster fails, the read command can be sent to The second database cluster, so as to read the target data from the second database cluster, and return the read data to the client.
  • the read instruction before obtaining the response information corresponding to the read instruction, it may also include: parsing the read instruction to obtain the traffic protocol; judging whether the traffic protocol conforms to the database communication protocol; if the traffic protocol conforms to the database communication protocol , then execute the step of obtaining the response information corresponding to the read command.
  • the traffic protocol does not conform to the database communication protocol, it no longer Go to the second database cluster to read data, just discard the write command; if the traffic protocol conforms to the database communication protocol, then execute the step of reading data from the second database cluster based on the read command.
  • the database multi-writing method may further include: when the read data fed back by the second data cluster is not obtained, outputting an alarm prompt.
  • the database multi-writing method provided in this optional embodiment can also implement an alarm function. Specifically, when the first database cluster cannot feed back the read data to the client, and the Envoy agent of the first database cluster cannot obtain the read data from the second database cluster, it means that the first database cluster and the second database cluster At this time, an alarm prompt can be output to inform the technicians that the current database cluster is abnormal, so that the technicians can trace the source of the exception and maintain it in time.
  • the database multi-write method deploys the Envoy agent in each database cluster, and sets the relevant information of the standby database cluster corresponding to its own database cluster in the Envoy agent, so as to establish a connection with the standby database cluster based on this information.
  • the Envoy agent intercepts the data writing instructions received by its own database cluster, and after obtaining the data to be written, writes it to the standby database cluster, thereby realizing database reading and writing.
  • this implementation method can realize automatic database multi-writing without code modification, effectively improves the efficiency of database multi-writing, and reduces research and development costs at the same time.
  • the embodiment of the present application provides another database multi-writing method.
  • an Envoy agent is deployed on each instance of the database cluster (which can be a pod or a virtual machine or a physical machine), and then the Envoy agent is configured to realize the writing to the database cluster A.
  • Data is written to database cluster B at the same time; at the same time, if an exception or timeout occurs when querying the primary database, traffic can be automatically redirected to the backup database cluster.
  • the Envoy proxy has the ability to unpack the traffic, The ability to process and repacket.
  • the above-mentioned database communication protocol analysis process can be realized by writing c++ code, and then applying Wasm technology to make a filter (filter) in the form of Wasm and add it to the Envoy proxy to make the interception and analysis process of database traffic into the Envoy agent, so that it does not have
  • the Envoy proxy for related functions has the ability to parse database traffic.
  • istio the control plane of the service grid, you can dynamically add custom filters.
  • FIG. 2 is an implementation flow chart of a database multi-write and disaster recovery method provided by this application, including:
  • the client establishes a connection to database cluster A and performs write or read operations.
  • Database cluster A and database cluster B have enabled the Envoy proxy for service management;
  • the traffic is passed to the custom Wasm filter for processing database traffic for processing.
  • the processing flow is as follows:
  • the response information of the command is obtained to determine whether the read operation is executed successfully, and if it fails, the command is forwarded to the backup database cluster B to obtain the backup database cluster B. Backup data, so as to achieve the characteristics of database backup disaster recovery.
  • the database multi-write method deploys the Envoy proxy in each database cluster, and sets the relevant information of the standby database cluster corresponding to its own database cluster in the Envoy proxy, so as to establish a backup database cluster based on this information.
  • the Envoy agent intercepts the data writing instructions received by its own database cluster, and after obtaining the data to be written, writes it to the standby database cluster, thereby realizing database reading and writing.
  • this implementation method can realize automatic database multi-writing without code modification, effectively improves the efficiency of database multi-writing, and reduces research and development costs at the same time.
  • FIG. 3 is a schematic structural diagram of a database multi-writing device provided by the present application.
  • the database multi-writing device may include:
  • the instruction interception module 1 is used for when the first database cluster receives the write instruction, the Envoy proxy deployed in the first database cluster intercepts the write instruction;
  • a data determination module 2 configured to determine the data to be written according to the write instruction
  • the data rewriting module 3 is configured to establish a connection with the second database cluster according to the pre-stored information of the second database cluster, and write the data to be written into the second database cluster.
  • the database multi-writing device deploys the Envoy agent in each database cluster, and sets the relevant information of the standby database cluster corresponding to its own database cluster in the Envoy agent, so as to establish a backup database cluster based on this information.
  • the Envoy agent intercepts the data writing instructions received by its own database cluster, and after obtaining the data to be written, writes it to the standby database cluster, thereby realizing database reading and writing.
  • this implementation method can realize automatic database multi-writing without code modification, effectively improves the efficiency of database multi-writing, and reduces research and development costs at the same time.
  • the database multi-writing device may also include a protocol judging module, which is used to analyze the write command to obtain the traffic protocol before determining the data to be written according to the write command; to judge whether the traffic protocol is It complies with the database communication protocol; if the traffic protocol conforms to the database communication protocol, the step of determining the data to be written according to the write instruction is performed.
  • a protocol judging module which is used to analyze the write command to obtain the traffic protocol before determining the data to be written according to the write command; to judge whether the traffic protocol is It complies with the database communication protocol; if the traffic protocol conforms to the database communication protocol, the step of determining the data to be written according to the write instruction is performed.
  • the database multi-writing device may also include a data reading module, and the data reading module may include:
  • a response information acquisition unit configured to acquire response information corresponding to the read instruction when the first database cluster receives the read instruction
  • a read operation judging unit configured to determine whether the read operation is successful according to the response information
  • a read instruction forwarding unit configured to forward the read instruction to the second database cluster if the read operation is unsuccessful
  • a read data acquisition unit configured to acquire the read data fed back by the second database cluster according to the read instruction
  • the read data feedback unit is used to feed back the read data to the initiator of the read command.
  • the above-mentioned data reading module may also include a protocol judging unit, which is used to analyze the reading instruction and obtain the traffic protocol before obtaining the response information corresponding to the reading instruction; judge whether the traffic protocol conforms to A database communication protocol; if the traffic protocol conforms to the database communication protocol, then execute the step of obtaining the response information corresponding to the read command.
  • a protocol judging unit which is used to analyze the reading instruction and obtain the traffic protocol before obtaining the response information corresponding to the reading instruction; judge whether the traffic protocol conforms to A database communication protocol; if the traffic protocol conforms to the database communication protocol, then execute the step of obtaining the response information corresponding to the read command.
  • the data reading module may further include an alarm prompt module, configured to output an alarm prompt when the read data fed back by the second data cluster is not obtained.
  • the aforementioned Envoy agents are deployed in each database cluster, and the Envoy agents in each database cluster are created through service grid technology and Wasm technology.
  • the above data multi-writing module 3 may be specifically configured to establish a connection with the second database cluster according to the pre-stored address information of the second database cluster.
  • Figure 4 is a schematic structural diagram of a database multi-writing system provided by this application, the database multi-writing system may include:
  • memory 10 for storing computer programs
  • the processor 20 is configured to implement the steps of any one of the database multi-writing methods described above when executing the computer program.
  • FIG. 5 is a schematic structural diagram of a computer-readable storage medium provided by this application.
  • a computer program 602 is stored, and when the computer program 602 is executed by the processor, the steps of any one of the database multi-writing methods described above can be realized.
  • the computer-readable storage medium 601 may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc., which can store various programs.
  • the medium of the code may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc., which can store various programs.
  • the medium of the code may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc.
  • each embodiment in the description is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other.
  • the description is relatively simple, and for the related information, please refer to the description of the method part.
  • the steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both.
  • the software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM or known in the technical field in any other form of storage medium.

Abstract

Disclosed in the present application is a database multi-write method. The method comprises: when a first database cluster receives a write instruction, an Envoy proxy deployed in the first database cluster intercepting the write instruction; according to the write instruction, determining data to be written; and establishing a connection with a second database cluster according to pre-stored second database cluster information, and writing said data into the second database cluster. By means of the database multi-write method, non-intrusive and automatic database multi-write of a code is realized, thereby improving the database multi-write efficiency, and also reducing the research and development cost. Further disclosed in the present application are a database multi-write apparatus and system and a computer-readable storage medium, which all have the above beneficial effects.

Description

一种数据库多写方法、装置及相关设备A database multi-write method, device and related equipment
本申请要求在2021年09月30日提交中国专利局、申请号为202111156691.0、发明名称为“一种数据库多写方法、装置及相关设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of the Chinese patent application submitted to the China Patent Office on September 30, 2021, with the application number 202111156691.0, and the title of the invention is "a database multi-writing method, device and related equipment", the entire content of which is incorporated by reference in this application.
技术领域technical field
本申请涉及数据库技术领域,特别涉及一种数据库多写方法,还涉及一种数据库多写装置、系统及计算机可读存储介质。The present application relates to the technical field of databases, in particular to a database multi-writing method, and also relates to a database multi-writing device, system and computer-readable storage medium.
背景技术Background technique
在云计算时代,大量微服务应用被部署到云平台上,其存在大量的需要同时写入两个甚至多个数据库集群的情况,比如业务迁移、数据库升级、主备数据库等情况。目前,开发人员往往还是通过修改代码,在写入一个数据库集群的同时,将sql(Structured Query Language,结构化查询语言)在另一个数据库集群中同时写入,这样可以保持两个或多个数据库数据的一致性。然而,这些操作往往工作量巨大,造成了较高的研发成本和较低的工作效率。In the era of cloud computing, a large number of microservice applications are deployed on the cloud platform, and there are a large number of situations that need to be written to two or more database clusters at the same time, such as business migration, database upgrade, and active and standby databases. At present, developers often write sql (Structured Query Language, Structured Query Language) in another database cluster while writing to one database cluster by modifying the code, so that two or more databases can be kept Data Consistency. However, these operations often have a huge workload, resulting in high research and development costs and low work efficiency.
因此,如何实现快速高效的数据库多写是本领域技术人员亟待解决的问题。Therefore, how to realize fast and efficient multi-writing of the database is an urgent problem to be solved by those skilled in the art.
发明内容Contents of the invention
本申请的目的是提供一种数据库多写方法,该数据库多写方法实现了代码无侵入的、自动化的数据库多写,提高了数据库多写效率,同时降低了研发成本;本申请的另一目的是提供一种数据库多写装置、系统及计算机可读存储介质,均具有上述有益效果。The purpose of this application is to provide a method for database multi-writing, which realizes code non-invasive, automatic database multi-writing, improves the efficiency of database multi-writing, and reduces research and development costs; another purpose of this application It provides a database multi-writing device, system and computer-readable storage medium, all of which have the above-mentioned beneficial effects.
第一方面,本申请提供了一种数据库多写方法,包括:In the first aspect, the present application provides a method for multiple database writing, including:
当第一数据库集群接收到写入指令时,部署于所述第一数据库集群中的Envoy代理拦截所述写入指令;When the first database cluster receives the write command, the Envoy agent deployed in the first database cluster intercepts the write command;
根据所述写入指令确定待写入数据;determining data to be written according to the write instruction;
根据预存第二数据库集群信息与第二数据库集群建立连接,并将所述待写入数据写入所述第二数据库集群。Establishing a connection with the second database cluster according to the pre-stored second database cluster information, and writing the data to be written into the second database cluster.
可选的,所述根据所述写入指令确定待写入数据之前,还包括:Optionally, before determining the data to be written according to the write instruction, the method further includes:
对所述写入指令进行解析,获得流量协议;Analyzing the write command to obtain a traffic protocol;
判断所述流量协议是否符合数据库通信协议;Judging whether the traffic protocol conforms to the database communication protocol;
若所述流量协议符合数据库通信协议,则执行所述根据所述写入指令确定待写入数据的步骤。If the traffic protocol conforms to the database communication protocol, the step of determining the data to be written according to the write instruction is executed.
可选的,所述数据库多写方法还包括:Optionally, the database multi-writing method also includes:
当第一数据库集群接收到读取指令时,获取所述读取指令对应的响应信息;When the first database cluster receives a read instruction, obtain response information corresponding to the read instruction;
根据所述响应信息确定读取操作是否成功;determining whether the read operation is successful according to the response information;
若读取操作不成功,则将所述读取指令转发至所述第二数据库集群;If the read operation is unsuccessful, forward the read instruction to the second database cluster;
获取所述第二数据库集群根据所述读取指令反馈的读取数据;Acquiring the read data fed back by the second database cluster according to the read instruction;
将所述读取数据反馈至所述读取指令的发起端。Feedback the read data to the originator of the read command.
可选的,所述获取所述读取指令对应的响应信息之前,还包括:Optionally, before obtaining the response information corresponding to the read instruction, it also includes:
对所述读取指令进行解析,获得流量协议;Analyzing the read command to obtain a traffic protocol;
判断所述流量协议是否符合数据库通信协议;Judging whether the traffic protocol conforms to the database communication protocol;
若所述流量协议符合数据库通信协议,则执行所述获取所述读取指令对应的响应信息的步骤。If the traffic protocol conforms to the database communication protocol, the step of acquiring the response information corresponding to the read command is performed.
可选的,所述数据库多写方法还包括:Optionally, the database multi-writing method also includes:
当未获得所述第二数据集群反馈的所述读取数据时,输出告警提示。When the read data fed back by the second data cluster is not obtained, an alarm prompt is output.
可选的,所述Envoy代理部署于各数据库集群中,各所述数据库集群中的Envoy代理通过服务网格技术和Wasm技术创建。Optionally, the Envoy proxy is deployed in each database cluster, and the Envoy proxy in each database cluster is created through service grid technology and Wasm technology.
可选的,所述根据预存第二数据库集群信息与第二数据库集群建立连接,包括:Optionally, the establishing a connection with the second database cluster according to the pre-stored second database cluster information includes:
根据预存第二数据库集群地址信息与所述第二数据库集群建立连接。Establishing a connection with the second database cluster according to the pre-stored address information of the second database cluster.
第二方面,本申请还公开了一种数据库多写装置,包括:In the second aspect, the present application also discloses a database multi-writing device, including:
指令拦截模块,用于当第一数据库集群接收到写入指令时,部署于所述第一数据库集群中的Envoy代理拦截所述写入指令;An instruction interception module, configured to intercept the write instruction by an Envoy agent deployed in the first database cluster when the first database cluster receives the write instruction;
数据确定模块,用于根据所述写入指令确定待写入数据;A data determination module, configured to determine the data to be written according to the write instruction;
数据多写模块,用于根据预存第二数据库集群信息与第二数据库集群建立连接,并将所述待写入数据写入所述第二数据库集群。The data multi-writing module is configured to establish a connection with the second database cluster according to the pre-stored second database cluster information, and write the data to be written into the second database cluster.
第三方面,本申请还公开了一种数据库多写设备,包括:In the third aspect, the present application also discloses a database multi-write device, including:
存储器,用于存储计算机程序;memory for storing computer programs;
处理器,用于执行所述计算机程序时实现如上所述的任一种数据库多写方法的步骤。A processor, configured to implement the steps of any one of the database multi-writing methods described above when executing the computer program.
第四方面,本申请还公开了一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如上所述的任一种数据库多写方法的步骤。In the fourth aspect, the present application also discloses a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, any of the above-mentioned database multi-write method steps.
本申请所提供的一种数据库多写方法,包括当第一数据库集群接收到写入指令时,部署于所述第一数据库集群中的Envoy代理拦截所述写入指令;根据所述写入指令确定待写入数据;根据预存第二数据库集群信息与第二数据库集群建立连接,并将所述待写入数据写入所述第二数据库集群。A database multi-write method provided by the present application includes that when the first database cluster receives a write command, the Envoy agent deployed in the first database cluster intercepts the write command; according to the write command Determine the data to be written; establish a connection with the second database cluster according to the prestored information of the second database cluster, and write the data to be written into the second database cluster.
可见,本申请所提供的数据库多写方法,在各数据库集群中部署Envoy代理,并在Envoy代理中设置自身数据库集群对应的备用数据库集群的相关信息,以便基于该信息与备用数据库集群建立连接,在此基础上,通过Envoy代理对自身数据库集群接收到的数据写入指令进行拦截,并在获得待写入数据后,将其写入至备用数据库集群,从而实现数据库读写。显然,该种实现方式无需进行代码修改即可实现自动化的数据库多写,有效的提高了数据库多写效率,同时降低了研发成本。It can be seen that the database multi-write method provided by this application deploys the Envoy agent in each database cluster, and sets the relevant information of the standby database cluster corresponding to its own database cluster in the Envoy agent, so as to establish a connection with the standby database cluster based on this information. On this basis, the Envoy agent intercepts the data writing instructions received by its own database cluster, and after obtaining the data to be written, writes it to the standby database cluster, thereby realizing database reading and writing. Obviously, this implementation method can realize automatic database multi-writing without code modification, effectively improves the efficiency of database multi-writing, and reduces research and development costs at the same time.
本申请所提供的一种数据库多写装置、系统及计算机可读存储介质,均具有上述有益效果,在此不再赘述。A database multi-writing device, system, and computer-readable storage medium provided by the present application all have the above-mentioned beneficial effects, and will not be repeated here.
附图说明Description of drawings
为了更清楚地说明现有技术和本申请实施例中的技术方案,下面将对现有技术和本申请实施例描述中需要使用的附图作简要的介绍。当然,下面有关本申请实施例的附图描述的仅仅是本申请中的一部分实施例,对于本领域普通技术人员来说,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图,所获得的其他附图也属于本申请的保护范围。In order to illustrate the prior art and the technical solutions in the embodiments of the present application more clearly, the following briefly introduces the drawings that need to be used in the description of the prior art and the embodiments of the present application. Of course, the following drawings related to the embodiments of the application describe only a part of the embodiments of the application, and those of ordinary skill in the art can obtain other The accompanying drawings, and other obtained drawings also belong to the protection scope of the present application.
图1为本申请所提供的一种数据库多写方法的流程示意图;Fig. 1 is a schematic flow chart of a database multi-writing method provided by the present application;
图2为本申请所提供的一种数据库多写和容灾方法的实现流程图;Fig. 2 is the implementation flowchart of a kind of database multi-writing and disaster recovery method provided by the application;
图3为本申请所提供的一种数据库多写装置的结构示意图;Fig. 3 is a schematic structural diagram of a database multi-writing device provided by the present application;
图4为本申请所提供的一种数据库多写系统的结构示意图;Fig. 4 is a schematic structural diagram of a database multi-writing system provided by the present application;
图5为本申请所提供的一种计算机可读存储介质的结构示意图。FIG. 5 is a schematic structural diagram of a computer-readable storage medium provided by the present application.
具体实施方式Detailed ways
本申请的核心是提供一种数据库多写方法,该数据库多写方法实现了代码无侵入的、自动化的数据库多写,提高了数据库多写效率,同时降低了研发成本;本申请的另一核心是提供一种数据库多写装置、系统及计算机可读存储介质,也具有上述有益效果。The core of this application is to provide a database multi-writing method, the database multi-writing method realizes code non-invasive, automatic database multi-writing, improves the efficiency of database multi-writing, and reduces research and development costs; another core of this application It provides a database multi-writing device, system and computer-readable storage medium, which also have the above-mentioned beneficial effects.
为了对本申请实施例中的技术方案进行更加清楚、完整地描述,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行介绍。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to describe the technical solutions in the embodiments of the present application more clearly and completely, the technical solutions in the embodiments of the present application will be introduced below in conjunction with the drawings in the embodiments of the present application. Apparently, the described embodiments are only some of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the scope of protection of this application.
本申请实施例提供了一种数据库多写方法。The embodiment of the present application provides a database multi-writing method.
请参考图1,图1为本申请所提供的一种数据库多写方法的流程示意图,该数据库多写方法可包括:Please refer to Fig. 1, Fig. 1 is a schematic flow chart of a method for multi-writing database provided by the present application, the method for multi-writing database may include:
S101:当第一数据库集群接收到写入指令时,部署于第一数据库集群中的Envoy代理拦截写入指令;S101: When the first database cluster receives a write command, the Envoy agent deployed in the first database cluster intercepts the write command;
本步骤旨在实现写入指令的拦截,该写入指令即为需要向对应数据库集群写入/存储数据的指令,一般是由客户端向数据库集群发起,以便于将待写入数据存储至该数据库集群。其中,拦截操作可以由部署于数据库集群的Envoy代理实现,Envoy是一个面向服务架构的L7代理和通信总线而设计的一个自组织的模块,与应用Server并无直接依赖。在具体实现过程中,当某一数据库集群(如上第一数据库集群)接收到客户端发起的写入指令时,部署于该数据库集群的Envoy代理将会拦截该指令,以便于利用该写入指令执行后续操作,从而实现数据库多写。This step aims to intercept the write command, which is the command that needs to write/store data to the corresponding database cluster, and is generally initiated by the client to the database cluster so that the data to be written can be stored in the database cluster. Database cluster. Among them, the interception operation can be implemented by the Envoy agent deployed in the database cluster. Envoy is a self-organizing module designed for the L7 agent and communication bus of the service architecture, and has no direct dependence on the application server. In the specific implementation process, when a database cluster (such as the first database cluster above) receives a write command initiated by the client, the Envoy agent deployed on the database cluster will intercept the command in order to use the write command Perform follow-up operations to achieve multiple writes to the database.
需要说明的是,Envoy代理拦截写入指令旨在基于该写入指令将待写入数 据同时存储至其他数据库集群(这里一般为当前数据库集群的备用数据库集群,即第一数据库集群的备用数据库集群,即下述第二数据库集群),但是,并不影响第一数据库集群基于该写入指令执行数据存储操作。It should be noted that the Envoy agent intercepts the write command to store the data to be written to other database clusters at the same time based on the write command (here, generally, the standby database cluster of the current database cluster, that is, the standby database cluster of the first database cluster , that is, the second database cluster described below), however, it does not affect the data storage operation performed by the first database cluster based on the write instruction.
作为一种可选实施例,上述Envoy代理部署于各数据库集群中,各数据库集群中的Envoy代理通过服务网格(Service Mesh)技术和Wasm技术创建。As an optional embodiment, the above-mentioned Envoy agents are deployed in each database cluster, and the Envoy agents in each database cluster are created through Service Mesh technology and Wasm technology.
本可选实施例提供了一种Envoy代理的部署方法,即通过服务网格技术和Wasm技术实现,其中,服务网格技术用于实现各Envoy间的数据通信,Wasm技术用于实现各Envoy中的功能设置与扩展。具体而言,通过服务网格技术和Wasm技术将Envoy代理部署于各个数据库集群,由此,所有的Envoy构建了一个透明的服务网格,处于其中的应用只需要简单的与本地的Envoy进行收发信息,并不需要关注整个网络拓扑。This optional embodiment provides a method for deploying an Envoy proxy, which is implemented through service grid technology and Wasm technology, wherein the service grid technology is used to implement data communication between Envoys, and Wasm technology is used to implement function settings and extensions. Specifically, Envoy agents are deployed in each database cluster through service grid technology and Wasm technology, so that all Envoys build a transparent service grid, and the applications in it only need to simply send and receive with the local Envoy information, does not need to focus on the entire network topology.
其中,服务网格是处理服务间通信的基础设施层,其负责通过构成现代云原生应用程序的复杂服务拓扑来可靠地交付请求,在实践中,Service Mesh通常以轻量级网络代理阵列的形式实现,这些代理与应用程序代码部署在一起,对应用程序来说无需感知代理的存在。Among them, the service mesh is the infrastructure layer that handles the communication between services. It is responsible for reliably delivering requests through the complex service topology that constitutes modern cloud-native applications. In practice, Service Mesh is usually in the form of an array of lightweight network agents To implement, these agents are deployed together with the application code, and the application does not need to be aware of the existence of the agent.
其中,Wasm技术支持技术人员编写机器代码以在浏览器的虚拟安全沙箱中运行,甚至升级后的Wasm被设计为其它语言的编译目标,允许将服务器端代码(如C或C++代码等)编译到其中,可以与服务网格结合,扩展其能力。Among them, Wasm technology supports technicians to write machine code to run in the browser's virtual security sandbox, and even the upgraded Wasm is designed as a compilation target for other languages, allowing server-side code (such as C or C++ code, etc.) to be compiled In it, it can be combined with the service grid to expand its capabilities.
S102:根据写入指令确定待写入数据;S102: Determine the data to be written according to the write instruction;
本步骤旨在实现基于写入指令确定待写入数据。可以理解的是,发起写入指令的客户端可以将待写入数据附加于写入指令中,由此,Envoy代理即可通过对写入指令进行解析获得待写入数据;当然,客户端也可以先向第一数据库集群发起写入指令,以告知第一数据库集群接收待写入数据并存储,然后将待写入数据发送至第一数据库集群,由此,Envoy代理则可以在拦截写入指令后再获取发送至第一数据库集群的待写入数据。可见,待写入数据的获取方法并不唯一,本申请对此不做限定。This step aims to realize the determination of the data to be written based on the write instruction. It can be understood that the client that initiates the write command can attach the data to be written to the write command, so that the Envoy proxy can obtain the data to be written by parsing the write command; of course, the client can also You can first initiate a write command to the first database cluster to inform the first database cluster to receive and store the data to be written, and then send the data to be written to the first database cluster, so that the Envoy agent can intercept the write After the command is executed, the data to be written sent to the first database cluster is acquired. It can be seen that the acquisition method of the data to be written is not unique, which is not limited in this application.
作为一种可选实施例,上述根据写入指令确定待写入数据之前,还可以包括:对写入指令进行解析,获得流量协议;判断流量协议是否符合数据库通信协议;若流量协议符合数据库通信协议,则执行根据写入指令确定待写 入数据的步骤。As an optional embodiment, before determining the data to be written according to the write instruction, it may also include: parsing the write instruction to obtain the traffic protocol; judging whether the traffic protocol conforms to the database communication protocol; if the traffic protocol conforms to the database communication protocol, execute the step of determining the data to be written according to the write instruction.
本可选实施例所提供的数据多写方法,可以通过判断写入指令是否符合数据库通信协议来确定是否继续执行数据库多写操作,从而避免由于写入指令不符合数据库通信协议而造成数据库多写失败的情况,节省资源占用和时间浪费。具体而言,当Envoy代理拦截到写入指令时,首先对其进行解析获取其对应的流量协议,然后判断该流量协议是否符合数据库通信协议,若该流量协议不符合数据库通信协议,则不再执行数据库多写操作,丢弃该写入指令即可;如若该流量协议符合数据库通信协议,则再执行基于写入指令获取待写入数据的步骤,以实现数据库多写功能。The data multi-write method provided by this optional embodiment can determine whether to continue to perform the database multi-write operation by judging whether the write command conforms to the database communication protocol, thereby avoiding the database multi-write due to the write command not conforming to the database communication protocol In case of failure, save resource usage and time wastage. Specifically, when the Envoy agent intercepts a write command, it first parses it to obtain its corresponding traffic protocol, and then judges whether the traffic protocol conforms to the database communication protocol. If the traffic protocol does not conform to the database communication protocol, it no longer Execute the multi-write operation of the database, just discard the write command; if the traffic protocol conforms to the database communication protocol, then perform the step of obtaining the data to be written based on the write command, so as to realize the multi-write function of the database.
S103:根据预存第二数据库集群信息与第二数据库集群建立连接,并将待写入数据写入第二数据库集群。S103: Establish a connection with the second database cluster according to the pre-stored second database cluster information, and write the data to be written into the second database cluster.
本步骤旨在将待写入数据写入第二数据库集群,该第二数据库集群即为第一数据库集群的备用数据库集群,当然,该第二数据库集群的数量可以为多个,即备用数据库集群的数量可以为多个,以便于实现待写入数据的多重备份。此外,第一数据库集群和第二数据库集群可以互为备用数据库集群,即通过第一数据库集群中的Envoy代理可以实现将写入第一数据库集群的数据信息同时写入第二数据库集群,通过第二数据库集群的Envoy代理可以将写入第二数据库集群的数据信息同时写入第一数据库集群。This step aims to write the data to be written into the second database cluster, which is the standby database cluster of the first database cluster. Of course, the number of the second database clusters can be multiple, that is, the standby database cluster The number of can be multiple, so as to realize multiple backups of the data to be written. In addition, the first database cluster and the second database cluster can be mutually standby database clusters, that is, through the Envoy agent in the first database cluster, the data information written in the first database cluster can be written into the second database cluster at the same time, through the second database cluster The Envoy proxy of the second database cluster can simultaneously write the data information written into the second database cluster into the first database cluster.
具体而言,在每个数据库集群的Envoy代理中,均预先设置有其对应的备用数据库集群的相关信息,以便于与备用数据库集群建立连接,从而实现数据库多写功能。也就是说,部署于第一数据库集群的Envoy代理中预存有第二数据库集群的相关信息,即上述预存第二数据库集群信息,由此,在获得待写入数据之后,即可基于该预存第二数据库集群信息与第二数据库集群建立连接,从而将待写入数据写入第二数据库集群,至此,完成数据库多写操作。Specifically, in the Envoy agent of each database cluster, relevant information of its corresponding standby database cluster is preset, so as to establish a connection with the standby database cluster, thereby realizing the multi-write function of the database. That is to say, the Envoy agent deployed in the first database cluster pre-stores the relevant information of the second database cluster, that is, the above-mentioned pre-stored information of the second database cluster. Therefore, after obtaining the data to be written, it can be based on the pre-stored first The information of the second database cluster establishes a connection with the second database cluster, so that the data to be written is written into the second database cluster. So far, the multi-write operation of the database is completed.
作为一种可选实施例,上述根据预存第二数据库集群信息与第二数据库集群建立连接,可以包括:根据预存第二数据库集群地址信息与第二数据库集群建立连接。As an optional embodiment, the above-mentioned establishing a connection with the second database cluster according to the pre-stored second database cluster information may include: establishing a connection with the second database cluster according to the pre-stored address information of the second database cluster.
本可选实施例提供了一种数据库集群建立连接的实现方法,即基于数据库集群地址信息实现,也就是预先将备用数据库集群的地址信息(如上述预 存第二数据库集群地址信息)存储至Envoy代理中,由此,部署于第一数据库集群的Envoy代理即可根据预存第二数据库集群地址信息与第二数据库建立连接,从而实现数据库多写。This optional embodiment provides a method for establishing a connection to a database cluster, which is implemented based on the address information of the database cluster, that is, the address information of the standby database cluster (such as the address information of the second database cluster pre-stored above) is stored in the Envoy agent in advance In this way, the Envoy agent deployed in the first database cluster can establish a connection with the second database according to the pre-stored address information of the second database cluster, thereby realizing multiple writes to the database.
作为一种可选实施例,该数据库多写方法还可以包括:当第一数据库集群接收到读取指令时,获取读取指令对应的响应信息;根据响应信息确定读取操作是否成功;若读取操作不成功,则将读取指令转发至第二数据库集群;获取第二数据库集群根据读取指令反馈的读取数据;将读取数据反馈至读取指令的发起端。As an optional embodiment, the database multi-write method may further include: when the first database cluster receives a read instruction, obtaining response information corresponding to the read instruction; determining whether the read operation is successful according to the response information; if the read If the fetch operation is unsuccessful, the read instruction is forwarded to the second database cluster; the read data fed back by the second database cluster according to the read instruction is obtained; and the read data is fed back to the initiator of the read instruction.
本可选实施例所提供的数据库多写方法还可以实现读取指令拦截,以便于当第一数据库集群发生异常无法返回读取数据时,可以从第二数据库集群读取数据并返回至发起读取指令的客户端,从而实现数据库备份容灾功能。The database multi-write method provided by this optional embodiment can also implement read command interception, so that when the first database cluster fails to return to read data, it can read data from the second database cluster and return to the original read command. Instruction-fetching client, so as to realize the database backup disaster recovery function.
具体而言,当客户端需要从第一数据库集群读取数据时,则可以向第一数据库集群发起读取指令,此时,部署于第一数据库集群的Envoy代理同样会拦截该读取指令,并获取第一数据库集群对该读取指令的响应信息;进一步,根据该响应信息判断读取操作是否成功,即判断第一数据库集群是否成功向客户端反馈读取数据,若读取操作成功,即第一数据库集群成功向客户端反馈读取数据,则无需执行其他操作,丢弃该读取指令即可,反之,如若第一数据库集群的读取操作失败,则可以将该读取指令发送至第二数据库集群,以便于从第二数据库集群读取目标数据,并将读取数据返回至客户端。Specifically, when the client needs to read data from the first database cluster, it can initiate a read command to the first database cluster. At this time, the Envoy agent deployed on the first database cluster will also intercept the read command. And obtain the response information of the first database cluster to the read command; further, judge whether the read operation is successful according to the response information, that is, judge whether the first database cluster successfully feeds back the read data to the client, if the read operation is successful, That is, if the first database cluster successfully feeds back the read data to the client, there is no need to perform other operations, and the read command can be discarded. On the contrary, if the read operation of the first database cluster fails, the read command can be sent to The second database cluster, so as to read the target data from the second database cluster, and return the read data to the client.
作为一种可选实施例,上述获取读取指令对应的响应信息之前,还可以包括:对读取指令进行解析,获得流量协议;判断流量协议是否符合数据库通信协议;若流量协议符合数据库通信协议,则执行获取读取指令对应的响应信息的步骤。As an optional embodiment, before obtaining the response information corresponding to the read instruction, it may also include: parsing the read instruction to obtain the traffic protocol; judging whether the traffic protocol conforms to the database communication protocol; if the traffic protocol conforms to the database communication protocol , then execute the step of obtaining the response information corresponding to the read command.
如上所述,可以通过判断写入指令是否符合数据库通信协议来确定是否继续执行数据库多写操作,从而避免由于写入指令不符合数据库通信协议而造成数据库多写失败的情况,节省资源占用和时间浪费。基于此,同样可以通过判断读取指令是否符合数据库通信协议来确定是否执行对于第二数据库集群的数据读取操作,从而避免由于读取指令不符合数据库通信协议而造成无法从第二数据库集群读取数据的情况,节省资源占用和时间浪费。具体而言,当Envoy代理拦截到读取指令时,首先对其进行解析获取其对应的流量 协议,然后判断该流量协议是否符合数据库通信协议,若该流量协议不符合数据库通信协议,则不再去第二数据库集群读取数据,丢弃该写入指令即可;如若该流量协议符合数据库通信协议,则再执行基于读取指令从第二数据库集群读取数据的步骤。As mentioned above, it is possible to determine whether to continue to perform multiple database write operations by judging whether the write command conforms to the database communication protocol, thereby avoiding the failure of database multiple write operations due to the write command not conforming to the database communication protocol, saving resource usage and time waste. Based on this, it is also possible to determine whether to execute the data read operation for the second database cluster by judging whether the read command conforms to the database communication protocol, thereby avoiding the inability to read data from the second database cluster due to the read command not conforming to the database communication protocol. The situation of fetching data saves resource occupation and time waste. Specifically, when the Envoy agent intercepts a read command, it first parses it to obtain its corresponding traffic protocol, and then judges whether the traffic protocol conforms to the database communication protocol. If the traffic protocol does not conform to the database communication protocol, it no longer Go to the second database cluster to read data, just discard the write command; if the traffic protocol conforms to the database communication protocol, then execute the step of reading data from the second database cluster based on the read command.
作为一种可选实施例,该数据库多写方法还可以包括:当未获得第二数据集群反馈的读取数据时,输出告警提示。As an optional embodiment, the database multi-writing method may further include: when the read data fed back by the second data cluster is not obtained, outputting an alarm prompt.
本可选实施例所提供的数据库多写方法还可以实现告警功能。具体而言,当第一数据库集群无法向客户端反馈读取数据,且第一数据库集群的Envoy代理也无法从第二数据库集群中获得读取数据时,说明第一数据库集群以及第二数据库集群均发生异常,此时,即可输出告警提示,从而告知技术人员当前数据库集群发生异常,以便于技术人员可以及时进行异常溯源与维护。The database multi-writing method provided in this optional embodiment can also implement an alarm function. Specifically, when the first database cluster cannot feed back the read data to the client, and the Envoy agent of the first database cluster cannot obtain the read data from the second database cluster, it means that the first database cluster and the second database cluster At this time, an alarm prompt can be output to inform the technicians that the current database cluster is abnormal, so that the technicians can trace the source of the exception and maintain it in time.
可见,本申请所提供的数据库多写方法,在各数据库集群中部署Envoy代理,并在Envoy代理中设置自身数据库集群对应的备用数据库集群的相关信息,以便基于该信息与备用数据库集群建立连接,在此基础上,通过Envoy代理对自身数据库集群接收到的数据写入指令进行拦截,并在获得待写入数据后,将其写入至备用数据库集群,从而实现数据库读写。显然,该种实现方式无需进行代码修改即可实现自动化的数据库多写,有效的提高了数据库多写效率,同时降低了研发成本。It can be seen that the database multi-write method provided by this application deploys the Envoy agent in each database cluster, and sets the relevant information of the standby database cluster corresponding to its own database cluster in the Envoy agent, so as to establish a connection with the standby database cluster based on this information. On this basis, the Envoy agent intercepts the data writing instructions received by its own database cluster, and after obtaining the data to be written, writes it to the standby database cluster, thereby realizing database reading and writing. Obviously, this implementation method can realize automatic database multi-writing without code modification, effectively improves the efficiency of database multi-writing, and reduces research and development costs at the same time.
基于以上各实施例,本申请实施例提供了另一种数据库多写方法。Based on the above embodiments, the embodiment of the present application provides another database multi-writing method.
具体来说,本申请所提供的数据库多写方法,在数据库集群的每个实例(可以是pod或虚拟机物理机)上都部署一个Envoy代理,进而通过配置Envoy代理实现写入数据库集群A的数据同时写入到数据库集群B;同时,如果在查询主数据库的时候出现异常和超时的情况,则可以自动将流量重定向到备份数据库集群。Specifically, in the database multi-write method provided by this application, an Envoy agent is deployed on each instance of the database cluster (which can be a pod or a virtual machine or a physical machine), and then the Envoy agent is configured to realize the writing to the database cluster A. Data is written to database cluster B at the same time; at the same time, if an exception or timeout occurs when querying the primary database, traffic can be automatically redirected to the backup database cluster.
首先,数据库集群中Envoy代理的部署与配置过程如下:First, the deployment and configuration process of the Envoy agent in the database cluster is as follows:
1、利用服务网格技术,给数据库集群实例创建Envoy代理,以便于利用Envoy代理的流量劫持能力,将对数据库集群的请求流量劫持到Envoy代理中,其中,Envoy代理具有对流量进行解包、处理、再封包的能力。1. Use the service grid technology to create an Envoy proxy for the database cluster instance, so as to use the traffic hijacking capability of the Envoy proxy to hijack the request traffic for the database cluster to the Envoy proxy. The Envoy proxy has the ability to unpack the traffic, The ability to process and repacket.
2、配置对数据库通信协议(目前主要支持mysql协议)进行解析的功能, Envoy代理捕获到tcp连接后,根据Handshake packet(由Server向Client发送的初始化包)中的前4个字节,即可识别出流量包是否为数据库的流量,并且,根据解析后续client向server发送的执行命令的流量,可以获取相应的sql指令。由此,通过解析捕获到的数据库集群的响应信息即可识别命令是否执行成功,如果命令执行失败,则默认将相同的sql命令转发到备份数据库集群。2. Configure the function of parsing the database communication protocol (currently the mysql protocol is mainly supported). After the Envoy agent captures the tcp connection, according to the first 4 bytes in the Handshake packet (the initialization packet sent by the Server to the Client), you can Identify whether the traffic packet is the traffic of the database, and, according to the traffic of the execution command sent by the subsequent client to the server, the corresponding sql command can be obtained. Thus, by parsing the captured response information of the database cluster, it can be identified whether the command is executed successfully. If the command fails to be executed, the same sql command will be forwarded to the backup database cluster by default.
3、上述数据库通信协议解析过程可通过编写c++代码实现,然后应用Wasm技术,将对数据库流量的拦截解析过程制作成一个Wasm形式的filter(过滤器)添加到Envoy代理中,从而使得原本不具有相关功能的Envoy代理具备了解析数据库流量的能力。并且,使用服务网格的控制面istio可以做到自定义filter的动态添加,在istio的配置文件中,可以将备份的数据库作为一个参数在istio中进行配置,从而做到备份数据库ip地址的可配置。3. The above-mentioned database communication protocol analysis process can be realized by writing c++ code, and then applying Wasm technology to make a filter (filter) in the form of Wasm and add it to the Envoy proxy to make the interception and analysis process of database traffic into the Envoy agent, so that it does not have The Envoy proxy for related functions has the ability to parse database traffic. In addition, using istio, the control plane of the service grid, you can dynamically add custom filters. In the istio configuration file, you can configure the backup database as a parameter in istio, so that the IP address of the backup database can be controlled. configuration.
进一步,请参考图2,图2为本申请所提供的一种数据库多写和容灾方法的实现流程图,包括:Further, please refer to FIG. 2. FIG. 2 is an implementation flow chart of a database multi-write and disaster recovery method provided by this application, including:
1、Client向数据库集群A建立连接,执行写入或读取操作,数据库集群A和数据库集群B已开启服务治理的Envoy代理;1. The client establishes a connection to database cluster A and performs write or read operations. Database cluster A and database cluster B have enabled the Envoy proxy for service management;
2、Client向数据库集群A建立连接执行操作时,tcp流量被Envoy代理劫持,并传递给Envoy代理中的filter进行处理;2. When the Client establishes a connection to the database cluster A to perform operations, the tcp traffic is hijacked by the Envoy proxy and passed to the filter in the Envoy proxy for processing;
3、流量被传递给自定义的用于处理数据库流量的Wasm filter进行处理,其处理流程如下:3. The traffic is passed to the custom Wasm filter for processing database traffic for processing. The processing flow is as follows:
(1)根据从流量请求中解析得到的字节判断是否符合数据库通信协议,如果是则进行下一步,不是则直接跳过后面的处理;(1) According to the bytes parsed from the traffic request, it is judged whether it conforms to the database communication protocol, if so, proceed to the next step, and if not, directly skip the subsequent processing;
(2)根据备份数据库集群B的地址信息与备份数据库集群B建立连接;(2) Establish a connection with the backup database cluster B according to the address information of the backup database cluster B;
(3)如若获取到写类型的命令,则将其同时转发给数据库集群B,完成数据库多写操作;(3) If the command of the write type is obtained, it is forwarded to the database cluster B at the same time to complete the multi-write operation of the database;
(4)如若获取到读类型的命令,则获取该命令的响应信息,以判断读取操作是否执行成功,如果失败,则将该命令转发到备份数据库集群B,以获取备份数据库集群B中的备份数据,从而达到数据库备份容灾的特性。(4) If the command of the read type is obtained, the response information of the command is obtained to determine whether the read operation is executed successfully, and if it fails, the command is forwarded to the backup database cluster B to obtain the backup database cluster B. Backup data, so as to achieve the characteristics of database backup disaster recovery.
可见,本申请实施例所提供的数据库多写方法,在各数据库集群中部署Envoy代理,并在Envoy代理中设置自身数据库集群对应的备用数据库集群 的相关信息,以便基于该信息与备用数据库集群建立连接,在此基础上,通过Envoy代理对自身数据库集群接收到的数据写入指令进行拦截,并在获得待写入数据后,将其写入至备用数据库集群,从而实现数据库读写。显然,该种实现方式无需进行代码修改即可实现自动化的数据库多写,有效的提高了数据库多写效率,同时降低了研发成本。It can be seen that the database multi-write method provided by the embodiment of the present application deploys the Envoy proxy in each database cluster, and sets the relevant information of the standby database cluster corresponding to its own database cluster in the Envoy proxy, so as to establish a backup database cluster based on this information. On this basis, the Envoy agent intercepts the data writing instructions received by its own database cluster, and after obtaining the data to be written, writes it to the standby database cluster, thereby realizing database reading and writing. Obviously, this implementation method can realize automatic database multi-writing without code modification, effectively improves the efficiency of database multi-writing, and reduces research and development costs at the same time.
为解决上述技术问题,本申请还提供了一种数据库多写装置,请参考图3,图3为本申请所提供的一种数据库多写装置的结构示意图,该数据库多写装置可包括:In order to solve the above-mentioned technical problems, the present application also provides a database multi-writing device, please refer to FIG. 3, which is a schematic structural diagram of a database multi-writing device provided by the present application. The database multi-writing device may include:
指令拦截模块1,用于当第一数据库集群接收到写入指令时,部署于第一数据库集群中的Envoy代理拦截写入指令;The instruction interception module 1 is used for when the first database cluster receives the write instruction, the Envoy proxy deployed in the first database cluster intercepts the write instruction;
数据确定模块2,用于根据写入指令确定待写入数据;A data determination module 2, configured to determine the data to be written according to the write instruction;
数据多写模块3,用于根据预存第二数据库集群信息与第二数据库集群建立连接,并将待写入数据写入第二数据库集群。The data rewriting module 3 is configured to establish a connection with the second database cluster according to the pre-stored information of the second database cluster, and write the data to be written into the second database cluster.
可见,本申请实施例所提供的数据库多写装置,在各数据库集群中部署Envoy代理,并在Envoy代理中设置自身数据库集群对应的备用数据库集群的相关信息,以便基于该信息与备用数据库集群建立连接,在此基础上,通过Envoy代理对自身数据库集群接收到的数据写入指令进行拦截,并在获得待写入数据后,将其写入至备用数据库集群,从而实现数据库读写。显然,该种实现方式无需进行代码修改即可实现自动化的数据库多写,有效的提高了数据库多写效率,同时降低了研发成本。It can be seen that the database multi-writing device provided by the embodiment of the present application deploys the Envoy agent in each database cluster, and sets the relevant information of the standby database cluster corresponding to its own database cluster in the Envoy agent, so as to establish a backup database cluster based on this information. On this basis, the Envoy agent intercepts the data writing instructions received by its own database cluster, and after obtaining the data to be written, writes it to the standby database cluster, thereby realizing database reading and writing. Obviously, this implementation method can realize automatic database multi-writing without code modification, effectively improves the efficiency of database multi-writing, and reduces research and development costs at the same time.
作为一种可选实施例,该数据库多写装置还可以包括协议判断模块,用于在上述根据写入指令确定待写入数据之前,对写入指令进行解析,获得流量协议;判断流量协议是否符合数据库通信协议;若流量协议符合数据库通信协议,则执行根据写入指令确定待写入数据的步骤。As an optional embodiment, the database multi-writing device may also include a protocol judging module, which is used to analyze the write command to obtain the traffic protocol before determining the data to be written according to the write command; to judge whether the traffic protocol is It complies with the database communication protocol; if the traffic protocol conforms to the database communication protocol, the step of determining the data to be written according to the write instruction is performed.
作为一种可选实施例,该数据库多写装置还可以包括数据读取模块,该数据读取模块可以包括:As an optional embodiment, the database multi-writing device may also include a data reading module, and the data reading module may include:
响应信息获取单元,用于当第一数据库集群接收到读取指令时,获取读取指令对应的响应信息;A response information acquisition unit, configured to acquire response information corresponding to the read instruction when the first database cluster receives the read instruction;
读取操作判断单元,用于根据响应信息确定读取操作是否成功;A read operation judging unit, configured to determine whether the read operation is successful according to the response information;
读取指令转发单元,用于若读取操作未成功,则将读取指令转发至第二数据库集群;A read instruction forwarding unit, configured to forward the read instruction to the second database cluster if the read operation is unsuccessful;
读取数据获取单元,用于获取第二数据库集群根据读取指令反馈的读取数据;A read data acquisition unit, configured to acquire the read data fed back by the second database cluster according to the read instruction;
读取数据反馈单元,用于将读取数据反馈至读取指令的发起端。The read data feedback unit is used to feed back the read data to the initiator of the read command.
作为一种可选实施例,上述数据读取模块还可以包括协议判断单元,用于在上述获取读取指令对应的响应信息之前,对读取指令进行解析,获得流量协议;判断流量协议是否符合数据库通信协议;若流量协议符合数据库通信协议,则执行获取读取指令对应的响应信息的步骤。As an optional embodiment, the above-mentioned data reading module may also include a protocol judging unit, which is used to analyze the reading instruction and obtain the traffic protocol before obtaining the response information corresponding to the reading instruction; judge whether the traffic protocol conforms to A database communication protocol; if the traffic protocol conforms to the database communication protocol, then execute the step of obtaining the response information corresponding to the read command.
作为一种可选实施例,上述数据读取模块还可以包括告警提示模块,用于当未获得第二数据集群反馈的读取数据时,输出告警提示。As an optional embodiment, the data reading module may further include an alarm prompt module, configured to output an alarm prompt when the read data fed back by the second data cluster is not obtained.
作为一种可选实施例,上述Envoy代理部署于各数据库集群中,各数据库集群中的Envoy代理通过服务网格技术和Wasm技术创建。As an optional embodiment, the aforementioned Envoy agents are deployed in each database cluster, and the Envoy agents in each database cluster are created through service grid technology and Wasm technology.
作为一种可选实施例,上述数据多写模块3可具体用于根据预存第二数据库集群地址信息与第二数据库集群建立连接。As an optional embodiment, the above data multi-writing module 3 may be specifically configured to establish a connection with the second database cluster according to the pre-stored address information of the second database cluster.
对于本申请提供的装置的介绍请参照上述方法实施例,本申请在此不做赘述。For the introduction of the device provided in this application, please refer to the above method embodiment, and this application will not repeat it here.
为解决上述技术问题,本申请还提供了一种数据库多写系统,请参考图4,图4为本申请所提供的一种数据库多写系统的结构示意图,该数据库多写系统可包括:In order to solve the above technical problems, this application also provides a database multi-writing system, please refer to Figure 4, Figure 4 is a schematic structural diagram of a database multi-writing system provided by this application, the database multi-writing system may include:
存储器10,用于存储计算机程序; memory 10 for storing computer programs;
处理器20,用于执行计算机程序时可实现如上述任意一种数据库多写方法的步骤。The processor 20 is configured to implement the steps of any one of the database multi-writing methods described above when executing the computer program.
对于本申请提供的系统的介绍请参照上述方法实施例,本申请在此不做赘述。For the introduction of the system provided by this application, please refer to the above method embodiment, and this application will not repeat it here.
为解决上述问题,本申请还提供了一种计算机可读存储介质,请参考图5,图5为本申请所提供的一种计算机可读存储介质的结构示意图,该计算机可读存储介质601上存储有计算机程序602,计算机程序602被处理器执行时可实现 如上述任意一种数据库多写方法的步骤。In order to solve the above problems, this application also provides a computer-readable storage medium, please refer to FIG. 5 , which is a schematic structural diagram of a computer-readable storage medium provided by this application. A computer program 602 is stored, and when the computer program 602 is executed by the processor, the steps of any one of the database multi-writing methods described above can be realized.
该计算机可读存储介质601可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。The computer-readable storage medium 601 may include: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk, etc., which can store various programs. The medium of the code.
对于本申请提供的计算机可读存储介质的介绍请参照上述方法实施例,本申请在此不做赘述。For the introduction of the computer-readable storage medium provided by the present application, please refer to the foregoing method embodiments, and the present application does not repeat it here.
说明书中各个实施例采用递进的方式描述,每个实施例重点说明的都是与其他实施例的不同之处,各个实施例之间相同相似部分互相参见即可。对于实施例公开的装置而言,由于其与实施例公开的方法相对应,所以描述的比较简单,相关之处参见方法部分说明即可。Each embodiment in the description is described in a progressive manner, each embodiment focuses on the difference from other embodiments, and the same and similar parts of each embodiment can be referred to each other. As for the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and for the related information, please refer to the description of the method part.
专业人员还可以进一步意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、计算机软件或者二者的结合来实现,为了清楚地说明硬件和软件的可互换性,在上述说明中已经按照功能一般性地描述了各示例的组成及步骤。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Professionals can further realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software or a combination of the two. In order to clearly illustrate the possible For interchangeability, in the above description, the composition and steps of each example have been generally described according to their functions. Whether these functions are executed by hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art may use different methods to implement the described functions for each specific application, but such implementation should not be regarded as exceeding the scope of the present application.
结合本文中所公开的实施例描述的方法或算法的步骤可以直接用硬件、处理器执行的软件模块,或者二者的结合来实施。软件模块可以置于随机存储器(RAM)、内存、只读存储器(ROM)、电可编程ROM、电可擦除可编程ROM、寄存器、硬盘、可移动磁盘、CD-ROM或技术领域内所公知的任意其它形式的存储介质中。The steps of the methods or algorithms described in connection with the embodiments disclosed herein may be directly implemented by hardware, software modules executed by a processor, or a combination of both. The software module can be placed in random access memory (RAM), internal memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM or known in the technical field in any other form of storage medium.
以上对本申请所提供的技术方案进行了详细介绍。本文中应用了具体个例对本申请的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本申请的方法及其核心思想。应当指出,对于本技术领域的普通技术人员来说,在不脱离本申请原理的前提下,还可以对本申请进行若干改进和修饰,这些改进和修饰也落入本申请的保护范围内。The technical solution provided by the present application has been introduced in detail above. In this paper, specific examples are used to illustrate the principles and implementation methods of the present application, and the descriptions of the above embodiments are only used to help understand the methods and core ideas of the present application. It should be pointed out that those skilled in the art can make some improvements and modifications to the application without departing from the principle of the application, and these improvements and modifications also fall within the protection scope of the application.

Claims (10)

  1. 一种数据库多写方法,其特征在于,包括:A database multi-writing method is characterized in that, comprising:
    当第一数据库集群接收到写入指令时,部署于所述第一数据库集群中的Envoy代理拦截所述写入指令;When the first database cluster receives the write command, the Envoy proxy deployed in the first database cluster intercepts the write command;
    根据所述写入指令确定待写入数据;determining data to be written according to the write instruction;
    根据预存第二数据库集群信息与第二数据库集群建立连接,并将所述待写入数据写入所述第二数据库集群。Establishing a connection with the second database cluster according to the pre-stored second database cluster information, and writing the data to be written into the second database cluster.
  2. 根据权利要求1所述的数据库多写方法,其特征在于,所述根据所述写入指令确定待写入数据之前,还包括:The database multi-writing method according to claim 1, wherein before determining the data to be written according to the writing instruction, further comprising:
    对所述写入指令进行解析,获得流量协议;Analyzing the write command to obtain a traffic protocol;
    判断所述流量协议是否符合数据库通信协议;Judging whether the traffic protocol conforms to the database communication protocol;
    若所述流量协议符合数据库通信协议,则执行所述根据所述写入指令确定待写入数据的步骤。If the traffic protocol conforms to the database communication protocol, the step of determining the data to be written according to the write instruction is executed.
  3. 根据权利要求1所述的数据库多写方法,其特征在于,还包括:The database multi-writing method according to claim 1, further comprising:
    当第一数据库集群接收到读取指令时,获取所述读取指令对应的响应信息;When the first database cluster receives a read instruction, obtain response information corresponding to the read instruction;
    根据所述响应信息确定读取操作是否成功;determining whether the read operation is successful according to the response information;
    若读取操作不成功,则将所述读取指令转发至所述第二数据库集群;If the read operation is unsuccessful, forward the read instruction to the second database cluster;
    获取所述第二数据库集群根据所述读取指令反馈的读取数据;Acquiring the read data fed back by the second database cluster according to the read instruction;
    将所述读取数据反馈至所述读取指令的发起端。Feedback the read data to the initiator of the read command.
  4. 根据权利要求3所述的数据库多写方法,其特征在于,所述获取所述读取指令对应的响应信息之前,还包括:The database multi-writing method according to claim 3, wherein, before obtaining the response information corresponding to the read instruction, further comprising:
    对所述读取指令进行解析,获得流量协议;Analyzing the read command to obtain a traffic protocol;
    判断所述流量协议是否符合数据库通信协议;Judging whether the traffic protocol conforms to the database communication protocol;
    若所述流量协议符合数据库通信协议,则执行所述获取所述读取指令对应的响应信息的步骤。If the traffic protocol conforms to the database communication protocol, the step of acquiring the response information corresponding to the read command is executed.
  5. 根据权利要求3所述的数据库多写方法,其特征在于,还包括:The database multi-writing method according to claim 3, further comprising:
    当未获得所述第二数据集群反馈的所述读取数据时,输出告警提示。When the read data fed back by the second data cluster is not obtained, an alarm prompt is output.
  6. 根据权利要求1所述的数据库多写方法,其特征在于,所述Envoy代理部署于各数据库集群中,各所述数据库集群中的Envoy代理通过服务网格 技术和Wasm技术创建。The database multi-writing method according to claim 1, wherein the Envoy agent is deployed in each database cluster, and the Envoy agent in each database cluster is created by service grid technology and Wasm technology.
  7. 根据权利要求1所述的数据库多写方法,其特征在于,所述根据预存第二数据库集群信息与第二数据库集群建立连接,包括:The database multi-writing method according to claim 1, wherein said establishing a connection with the second database cluster according to the pre-stored information of the second database cluster comprises:
    根据预存第二数据库集群地址信息与所述第二数据库集群建立连接。Establishing a connection with the second database cluster according to the pre-stored address information of the second database cluster.
  8. 一种数据库多写装置,其特征在于,包括:A database multi-writing device is characterized in that it comprises:
    指令拦截模块,用于当第一数据库集群接收到写入指令时,部署于所述第一数据库集群中的Envoy代理拦截所述写入指令;An instruction interception module, configured to intercept the write instruction by an Envoy agent deployed in the first database cluster when the first database cluster receives the write instruction;
    数据确定模块,用于根据所述写入指令确定待写入数据;A data determination module, configured to determine the data to be written according to the write instruction;
    数据多写模块,用于根据预存第二数据库集群信息与第二数据库集群建立连接,并将所述待写入数据写入所述第二数据库集群。The data multi-writing module is configured to establish a connection with the second database cluster according to the pre-stored second database cluster information, and write the data to be written into the second database cluster.
  9. 一种数据库多写系统,其特征在于,包括:A database multi-write system is characterized in that it comprises:
    存储器,用于存储计算机程序;memory for storing computer programs;
    处理器,用于执行所述计算机程序时实现如权利要求1至7任一项所述的数据库多写方法的步骤。A processor, configured to implement the steps of the database multi-writing method according to any one of claims 1 to 7 when executing the computer program.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至7任一项所述的数据库多写方法的步骤。A computer-readable storage medium, characterized in that, a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the multi-write database according to any one of claims 1 to 7 is realized method steps.
PCT/CN2022/078209 2021-09-30 2022-02-28 Database multi-write method and apparatus, and related device WO2023050706A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202111156691.0 2021-09-30
CN202111156691.0A CN113590595A (en) 2021-09-30 2021-09-30 Database multi-writing method and device and related equipment

Publications (1)

Publication Number Publication Date
WO2023050706A1 true WO2023050706A1 (en) 2023-04-06

Family

ID=78242649

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/078209 WO2023050706A1 (en) 2021-09-30 2022-02-28 Database multi-write method and apparatus, and related device

Country Status (2)

Country Link
CN (1) CN113590595A (en)
WO (1) WO2023050706A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113590595A (en) * 2021-09-30 2021-11-02 苏州浪潮智能科技有限公司 Database multi-writing method and device and related equipment
CN114466027B (en) * 2022-01-26 2023-08-04 苏州浪潮智能科技有限公司 Cloud primary database service providing method, system, equipment and medium
CN115242807A (en) * 2022-06-30 2022-10-25 深圳震有科技股份有限公司 Data access method in 5G communication system and related equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104219085A (en) * 2014-08-07 2014-12-17 深圳市同洲电子股份有限公司 Proxy server and data processing method and system of database
CN107295080A (en) * 2017-06-19 2017-10-24 北京百度网讯科技有限公司 Date storage method and server applied to distributed server cluster
CN109508259A (en) * 2018-11-16 2019-03-22 郑州云海信息技术有限公司 A kind of method and apparatus of data storage
CN112866406A (en) * 2021-02-04 2021-05-28 建信金融科技有限责任公司 Data storage method, system, device, equipment and storage medium
CN113590595A (en) * 2021-09-30 2021-11-02 苏州浪潮智能科技有限公司 Database multi-writing method and device and related equipment

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102158540A (en) * 2011-02-18 2011-08-17 广州从兴电子开发有限公司 System and method for realizing distributed database
CN113396407A (en) * 2018-12-04 2021-09-14 泽乌科技公司 System and method for augmenting database applications using blockchain techniques
CN110096552A (en) * 2019-05-07 2019-08-06 广州虎牙信息科技有限公司 A kind of read-write method of business datum, device, equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104219085A (en) * 2014-08-07 2014-12-17 深圳市同洲电子股份有限公司 Proxy server and data processing method and system of database
CN107295080A (en) * 2017-06-19 2017-10-24 北京百度网讯科技有限公司 Date storage method and server applied to distributed server cluster
CN109508259A (en) * 2018-11-16 2019-03-22 郑州云海信息技术有限公司 A kind of method and apparatus of data storage
CN112866406A (en) * 2021-02-04 2021-05-28 建信金融科技有限责任公司 Data storage method, system, device, equipment and storage medium
CN113590595A (en) * 2021-09-30 2021-11-02 苏州浪潮智能科技有限公司 Database multi-writing method and device and related equipment

Also Published As

Publication number Publication date
CN113590595A (en) 2021-11-02

Similar Documents

Publication Publication Date Title
WO2023050706A1 (en) Database multi-write method and apparatus, and related device
WO2019184164A1 (en) Method for automatically deploying kubernetes worker node, device, terminal apparatus, and readable storage medium
WO2020151181A1 (en) Cross-platform data updating method and apparatus based on block chain, and computer device
US11057464B1 (en) Synchronization of data between local and remote computing environment buffers
WO2018121334A1 (en) Web application service providing method, apparatus, electronic device and system
CN111385147B (en) Fault simulation method, device and computer readable storage medium
WO2021082081A1 (en) Method, system and device for dynamically modifying nginx configuration parameters, and storage medium
CN111314212B (en) API gateway based on Netty and plug-in mechanism and control method
CN111258627A (en) Interface document generation method and device
US20170033980A1 (en) Agent manager for distributed transaction monitoring system
CN112527647B (en) NS-3-based Raft consensus algorithm test system
WO2023197874A1 (en) Application access method and apparatus, and device and medium
CA3138764A1 (en) Data processing method, device, computer equipment and storage medium
CN112559143A (en) Task scheduling method and system and computing device
CN113835836A (en) System, method, computer device and medium for dynamically publishing container service
WO2020024978A1 (en) Device, method, apparatus, and readable storage medium for virtual machine migration
CN113268308B (en) Information processing method, device and storage medium
WO2018023966A1 (en) Method and device for determining caching strategy
WO2021093671A1 (en) Task processing method, system, apparatus and device, and computer readable storage medium
CN112527376A (en) Method for realizing DevOps automation based on reverse proxy service
WO2022121492A1 (en) File transmission method and apparatus, computer device, and storage medium
WO2022099913A1 (en) Interface configuration method and apparatus, and device and medium
WO2021078176A1 (en) Storage process running method and apparatus, database system, and storage medium
CN112134910B (en) Network request debugging method, device, equipment and storage medium
CN114896258B (en) Transaction data synchronization method and device, computer equipment and storage medium

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22874109

Country of ref document: EP

Kind code of ref document: A1