# US 2015/0149409 A1 · Dml replication with logical log shipping

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2015/0149409 A1
- Document ID: US20150149409A1
- Status: Published application
- Kind: A1
- Application number: 14/302,320
- Filed: 2014-06-11
- Published: 2015-05-28
- Earliest claimed: 2013-11-22
- Assignees: Sap SE
- Inventors: Joo Yeon Lee; Juchang Lee; Kyu Hwan Kim; Chul Won Lee; Yong Sik Kwon; Sang Kyun Cha
- Web page: https://patentgrep.com/patent/US20150149409A1

## CPC

- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Technologies are described for performing replication within a database environment. For example, replication of database data can be performed using data manipulation language (DML) statements and logical logs. A database node can execute a DML statement, create a logical log comprising the DML statement, and insert the logical log into a logical log queue. The logical log can be sent to one or more other database nodes for execution of the DML statement stored within the logical log. Logical logs can be grouped for sending to other nodes. Logical logs can be executed on a first node and one or more other nodes within the same transaction boundary. Execution of DML statements can be decoupled from sending, receiving, grouping, and/or processing of logical logs.

## Claims

### Claim 1

A method, implemented at least in part by a master node comprising a processing unit and memory, for performing replication within a database environment using data manipulation language (DML) statements and logical logs, the method comprising:
receiving a DML statement;
executing the DML statement at the master node;
creating a logical log comprising the DML statement;
inserting the logical log into a logical log queue; and
sending the logical log, retrieved from the logical log queue, to at least one slave node for execution of the DML statement at the at least one slave node.

### Claim 2 (depends on 1)

The method of claim 1, wherein executing the DML statement at the master node comprises:
obtaining parameter values used by the DML statement; and
evaluating nondeterministic functions used by the DML statement to obtain nondeterministic values.

### Claim 3 (depends on 1)

The method of claim 1, the logical log further comprising:
a transaction identifier;
parameter values used by the DML statement; and
nondeterministic values used by the DML statement.

### Claim 4 (depends on 1)

The method of claim 1, wherein executing the DML statement at the master node is performed within a transaction boundary, and wherein the execution of the DML statement at the at least one slave node is performed within the transaction boundary.

### Claim 5 (depends on 4)

The method of claim 4, wherein execution of the DML statement at the master node and at the at least one slave node within the transaction boundary supports rollback of the DML statement at the master node and the at least one slave node.

### Claim 6 (depends on 1)

The method of claim 1, wherein a first thread performs the executing, the creating, and the inserting, and wherein a second thread performs the sending.

### Claim 7 (depends on 1)

The method of claim 1, wherein execution of the DML statement at the master node is performed by a structured query language (SQL) executor thread, and wherein sending the logical log to the at least one slave node is performed by a replication handler thread.

### Claim 8 (depends on 1)

The method of claim 1, further comprising:
grouping the logical log with other logical logs in the logical log queue for sending to the at least one slave node.

### Claim 9 (depends on 8)

The method of claim 8, wherein the logical log and the other logical logs in the logical log queue are grouped based at least in part on which database tables are replicated at the at least one slave node.

### Claim 10

A computer-readable storage medium storing computer-executable instructions for causing a computing device to execute a method for performing replication within a database environment using data manipulation language (DML) statements and logical logs, the method comprising:
for each of a plurality of DML statements:
receiving the DML statement;
executing the DML statement;
creating a logical log comprising the DML statement; and
inserting the logical log into a logical log queue;
grouping the plurality of logical logs in the logical log queue into one or more logical log groups based at least in part upon database tables replicated by each of a plurality of slave nodes; and
for each of the logical log groups, sending the logical log group to one or more slave nodes, of the plurality of slave nodes, that are associated with the logical log group for execution of the DML statements in the logical log group.

### Claim 11 (depends on 10)

The computer-readable storage medium of claim 10 wherein each logical log in the logical log queue that modifies a first database table is grouped together in a first logical log group and sent to each slave node that replaces the first database table.

### Claim 12 (depends on 11)

The computer-readable storage medium of claim 11 wherein at least one of the slave nodes does not replicate the first database table, and wherein the first logical log group is not sent to the at least one slave node that does not replicate the first database table.

### Claim 13 (depends on 10)

The computer-readable storage medium of claim 10 wherein a first slave node replicates a first database table, wherein a second slave node replicates a second database table, wherein logical logs in the logical log queue that have DML statements modifying the first database table are grouped together for sending to the first slave node, and wherein logical logs in the logical log queue that have DML statements modifying the second database table are grouped together for sending to the second slave node.

### Claim 14

A database environment comprising:
a master node; and
a plurality of slave nodes;
the database environment configured to perform operations for replicating database information using data manipulation language (DML) statements and logical logs, the operations comprising:
at the master node:
receiving a DML statement;
executing the DML statement;
creating a logical log comprising the DML statement;
inserting the logical log into a logical log queue; and
sending the logical log from the logical log queue to at least one slave node of the plurality of slave nodes for execution of the DML statement at the at least one slave node; and
by the at least one slave node:
receiving the logical log; and
executing the DML statement contained in the logical log.

### Claim 15 (depends on 14)

The database environment of claim 14, wherein executing the DML statement at the master node comprises:
obtaining parameter values used by the DML statement; and
evaluating nondeterministic functions used by the DML statement to obtain nondeterministic values.

### Claim 16 (depends on 14)

The database environment of claim 14, the logical log further comprising:
a transaction identifier;
parameter values used by the DML statement; and
nondeterministic values used by the DML statement.

### Claim 17 (depends on 14)

The database environment of claim 14, wherein executing the DML statement at the master node is performed within a transaction boundary associated with a transaction, wherein the execution of the DML statement at the at least one slave node is performed within the transaction boundary, and wherein partial rollback of the DML statement is supported by the transaction at the master node and at the at least one slave node.

### Claim 18 (depends on 14)

The database environment of claim 14, wherein a first thread executing at the master node executes the DML statement, creates the logical log, and inserts the logical log into the logical log queue, wherein second thread executing at the master node sends the logical log to the at least one slave node, and wherein the first thread is free to perform other operations after inserting the logical log into the logical log queue.

### Claim 19 (depends on 14)

The database environment of claim 14, further comprising, at the master node:
grouping the logical log with other logical logs in the logical log queue for sending to the at least one slave node.

### Claim 20 (depends on 19)

The database environment of claim 19, wherein the logical log and the other logical logs in the logical log queue are grouped based at least in part on which database tables are replicated at the at least one slave node.
