# US 2025/0094445 A1 · Performance Optimization In Raft-Based Asynchronous Database Transaction Replication

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

- Number: US 2025/0094445 A1
- Document ID: US20250094445A1
- Status: Published application
- Kind: A1
- Application number: 18/805,383
- Filed: 2024-08-14
- Published: 2025-03-20
- Earliest claimed: 2023-09-14
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: Lik Wong; Sampanna Salunke; Leonid Novak; Mark Dilman; Wei-Ming Hu
- Web page: https://patentgrep.com/patent/US20250094445A1

## CPC

- G06F 16/273: {Asynchronous replication or reconciliation}
- 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

Replication is improved in a globally distributed database, such as a replicated sharded database, which uses raft-based asynchronous database replication. Improvements include Raft log persistence, coordination of followers' processing speed, transaction outcome determination, and column name compression, and improved failover time through heartbeat consolidation and keeping apply processes of followers running across failovers.

## Claims

### Claim 1

A computer-implemented method comprising:
within a replication group that replicates a replication unit of a database, a leader for said replication unit sending via an in-memory queue a stream of LCRs (Logical Change Record) to a plurality of followers for said replication unit, wherein LCRs sent in said stream reflect transactions executed by said leader that change database data in said replication unit;
said leader storing LCRs in said stream in a persistent Raft log;
determining whether a lagging follower of said plurality of followers meets one or more criteria for detaching said lagging follower as a subscriber of said in-memory queue; and
in response to determining that said lagging follower meets said one or more criteria for detaching said lagging follower, detaching said lagging follower from said in-memory queue.

### Claim 2 (depends on 1)

The method of claim 1, wherein determining whether a lagging follower of said plurality of followers meets one or more criteria for detaching includes:
determining whether a number of LCRs in said in-memory queue not yet read by said lagging follower but read by one or more other followers of said plurality of followers; and
determining whether said number of LCRs is greater than a threshold number.

### Claim 3 (depends on 1)

The method of claim 1, wherein determining whether a lagging follower of said plurality of followers meets one or more criteria for detaching includes determining whether a lagging follower has remained behind reading LCRs from said in-memory queue for at least a threshold period of time.

### Claim 4 (depends on 1)

The method of claim 1, further including said lagging follower reading LCRs from said persistent Raft log in response to detaching said lagging follower.

### Claim 5 (depends on 4)

The method of claim 4, wherein determining whether a lagging follower of said plurality of followers meets one or more criteria for detaching includes determining there are sufficient followers for consensus without said lagging follower.

### Claim 6 (depends on 1)

The method of claim 1, further including:
said leader storing in a commit queue records indicating a number of pending commits;
sending an indication of said number of pending commits to a particular follower of said plurality of followers; and
said particular follower flushing to persistent storage a batch of LCRs from another in-memory queue for said particular follower based on said indication of said number of pending commits.

### Claim 7 (depends on 1)

The method of claim 1, further including:
in response to a particular follower of said plurality of followers determining that the particular follower has not received a post-commit LCR for a database transaction after a threshold period of time, said particular follower invoking a remote procedure call to obtain an outcome for said database transaction; and
said particular follower committing or rolling back a corresponding apply database transaction based on the outcome.

### Claim 8 (depends on 1)

The method of claim 1, wherein:
wherein a particular LCR in said stream specifies a change to a plurality of columns in a database table; and
wherein for each column of said plurality of columns, said particular LCR includes a hash value in lieu of a column name of said each column, said hash value being calculated according to a hash algorithm.

### Claim 9 (depends on 1)

The method of claim 1, wherein:
said leader runs on a first shard server that hosts a plurality of leaders that includes said leader, and said followers of said plurality of leaders run a respective shard server of a plurality of shard servers;
each leader of said plurality of leaders stores respective liveness data in a shared memory area of said shard server; and
a single process on said first shard server sending to each shard server of said plurality of shard servers a consolidated heartbeat message that consolidates liveness data stored by each leader of said plurality of leaders in said shared memory area.

### Claim 10 (depends on 1)

The method of claim 1, wherein during a failover for the replication group in which a follower of said plurality of followers becomes a new leader,
on said lagging follower:
a network receiver receiving a stream of LCRs from the new leader;
said network receiver storing the stream of LCRs to a local persistently stored local Raft log of said lagging follower; and
in lieu of receiving said stream of LCRs from said network receiver, an apply process of said lagging follower reading a stream of LCRs from said local Raft log to apply.

### Claim 11 (depends on 10)

The method of claim 10, after completing said failover, said network receiver forwarding LCRs to said apply process.

### Claim 12 (depends on 1)

The method of claim 1, wherein in response said leader determining that a file of said Raft log selected for writing a set of LCRs includes a minimum required log index for said plurality of followers, said leader waiting to write said set of LCRs at least until said file no longer includes said minimum required log index.

### Claim 13

One or more non-transitory storage media storing sequences of instructions that, when executed by one or more computing devices, cause:
within a replication group that replicates a replication unit of a database, a leader for said replication unit sending via an in-memory queue a stream of LCRs (Logical Change Record) to a plurality of followers for said replication unit, wherein LCRs sent in said stream reflect transactions executed by said leader that change database data in said replication unit;
said leader storing LCRs in said stream in a persistent Raft log;
determining whether a lagging follower of said plurality of followers meets one or more criteria for detaching said lagging follower as a subscriber of said in-memory queue; and
in response to determining that said lagging follower meets said one or more criteria for detaching said lagging follower, detaching said lagging follower from said in-memory queue.

### Claim 14 (depends on 13)

The one or more non-transitory storage of claim 13, wherein determining whether a lagging follower of said plurality of followers meets one or more criteria for detaching includes:
determining whether a number of LCRs in said in-memory queue not yet read by said lagging follower but read by one or more other followers of said plurality of followers; and
determining whether said number of LCRs is greater than a threshold number.

### Claim 15 (depends on 13)

The one or more non-transitory storage of claim 13, wherein determining whether a lagging follower of said plurality of followers meets one or more criteria for detaching includes determining whether a lagging follower has remained behind reading LCRs from said in-memory queue for at least a threshold period of time.

### Claim 16 (depends on 13)

The one or more non-transitory storage of claim 13, wherein the one or more sequences of instructions include instructions, that when executed by one or more computing devices, cause said lagging follower reading LCRs from said persistent Raft log in response to detaching said lagging follower.

### Claim 17 (depends on 16)

The one or more non-transitory storage of claim 16, wherein determining whether a lagging follower of said plurality of followers meets one or more criteria for detaching includes determining there are sufficient followers for consensus without said lagging follower.

### Claim 18 (depends on 13)

The one or more non-transitory storage of claim 13, wherein the one or more sequences of instructions include instructions, that when executed by one or more computing devices, cause:
said leader storing in a commit queue records indicating a number of pending commits;
sending an indication of said number of pending commits to a particular follower of said plurality of followers; and
said particular follower flushing to persistent storage a batch of LCRs from another in-memory queue for said particular follower based on said indication of said number of pending commits.

### Claim 19 (depends on 13)

The one or more non-transitory storage of claim 13, wherein the one or more sequences of instructions include instructions, that when executed by one or more computing devices, cause:
in response to a particular follower of said plurality of followers determining that the particular follower has not received a post-commit LCR for a database transaction after a threshold period of time, said particular follower invoking a remote procedure call to obtain an outcome for said database transaction; and
said particular follower committing or rolling back a corresponding apply database transaction based on the outcome.

### Claim 20 (depends on 13)

The one or more non-transitory storage of claim 13, wherein the one or more sequences of instructions include instructions, that when executed by one or more computing devices, cause:
wherein a particular LCR in said stream specifies a change to a plurality of columns in a database table; and
wherein for each column of said plurality of columns, said particular LCR includes a hash value in lieu of a column name of said each column, said hash value being calculated according to a hash algorithm.

### Claim 21 (depends on 13)

The one or more non-transitory storage of claim 13, wherein:
said leader runs on a first shard server that hosts a plurality of leaders that includes said leader, and said followers of said plurality of leaders run a respective shard server of a plurality of shard servers;
each leader of said plurality of leaders stores respective liveness data in a shared memory area of said shard server; and
a single process on said first shard server sending to each shard server of said plurality of shard servers a consolidated heartbeat message that consolidates liveness data stored by each leader of said plurality of leaders in said shared memory area.

### Claim 22 (depends on 13)

The one or more non-transitory storage of claim 13, wherein during a failover for the replication group in which a follower of said plurality of followers becomes a new leader,
on said lagging follower:
a network receiver receiving a stream of LCRs from the new leader;
said network receiver storing the stream of LCRs to a local persistently stored local Raft log of said lagging follower; and
in lieu of receiving said stream of LCRs from said network receiver, an apply process of said lagging follower reading a stream of LCRs from said local Raft log to apply.

### Claim 23 (depends on 22)

The one or more non-transitory storage of claim 22, wherein the one or more sequences of instructions include instructions, that when executed by one or more computing devices, cause after completing said failover, said network receiver forwarding LCRs to said apply process.

### Claim 24 (depends on 13)

The one or more non-transitory storage of claim 13, wherein in response said leader determining that a file of said Raft log selected for writing a set of LCRs includes a minimum required log index for said plurality of followers, said leader waiting to write said set of LCRs at least until said file no longer includes said minimum required log index.
