# US 2023/0409601 A1 · Apparatus and Method for Managing Storage of a Primary Database and a Replica Database

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

- Number: US 2023/0409601 A1
- Document ID: US20230409601A1
- Status: Published application
- Kind: A1
- Application number: 17/836,105
- Filed: 2022-06-09
- Published: 2023-12-21
- Earliest claimed: 2022-06-09
- Assignees: Futurewei Technologies, Inc.
- Applicants: Futurewei Technologies, Inc.
- Inventors: Qingqing ZHOU; Yang SUN; Guogen ZHANG
- Web page: https://patentgrep.com/patent/US20230409601A1

## CPC

- G06F 16/275: {Synchronous replication}
- G06F 16/215: Improving data quality; Data cleansing, e.g. de-duplication, removing invalid entries or correcting typographical errors
- G06F 16/221: {Column-oriented storage; Management thereof}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

System and method embodiments are provided for using different storage formats for a primary database and its replicas in a database managed replication (DMR) system. As such, the advantages of both formats can be combined with suitable design complexity and implementation. In an embodiment, data is arranged in a sequence of rows and stored in a first storage format at the primary database. The data arranged in the sequence of rows is also stored in a second storage format at the replica database. The sequence of rows is determined according to the first storage format or the second storage format. The first storage format is a row store (RS) and the second storage format is a column store (CS), or vice versa. In an embodiment, the sequence of rows is determined to improve compression efficiency at the CS.

## Claims

### Claim 1

A method, at a computation node of a database system, for managing storage of a primary database and a replica database, the method comprising:
storing data arranged in a sequence of rows in a first storage format at the primary database; and
storing the data arranged in the sequence of rows in a second storage format at the replica database, wherein the sequence of rows is determined according to one of the first storage format and the second storage format.

### Claim 2 (depends on 1)

The method of claim 1, wherein the first storage format is a row store (RS) and the second storage format is a column store (CS), and wherein the sequence of rows is determined to improve compression efficiency at the CS.

### Claim 3 (depends on 1)

The method of claim 1, wherein storing the data in the primary database includes storing each group of rows in a plurality of groups of rows in the data into a heap file of a fixed length, and wherein storing the data in the replica database includes storing a fixed number of columns in each group of rows into a corresponding compression unit (CU) of a fixed number of entries.

### Claim 4 (depends on 3)

The method of claim 3, wherein the heap file includes a sequence number indicating a first row in the group of rows.

### Claim 5 (depends on 3)

The method of claim 3, wherein the heap file storing the group of rows includes or is associated with a CU descriptor pointing to the corresponding CU storing the group of rows.

### Claim 6 (depends on 5)

The method of claim 5, wherein the CU descriptor includes a deletion bitmap field for flagging deleted rows, where each bit represents a row in the CU.

### Claim 7 (depends on 5)

The method of claim 5, wherein the CU descriptor indicates a total number of rows in the corresponding CU.

### Claim 8 (depends on 1)

The method of claim 1, wherein the first storage format is a column store (CS) and the second storage format is a row store (RS), and wherein the sequence of rows is determined to improve compression efficiency at the CS.

### Claim 9

A method, at a computation node of a database system, for managing storage of a primary database and a replica database, the method comprising:
compressing a plurality of columns in a plurality of rows of a data table into a compression unit (CU) for a column store (CS), wherein the rows are ordered in a sequence suitable for the CS; and
inserting the rows of the CU into a heap file for a row store (RS), wherein the rows are ordered in the RS in the sequence of the CS.

### Claim 10 (depends on 9)

The method of claim 9 further comprising inserting the CU in the CS with a start sequence indicating a first row in the CU, and a number of rows in the CU.

### Claim 11 (depends on 9)

The method of claim 9 further comprising adding a CU descriptor with the heap file in the CS, wherein the CU descriptor points to the CU in the CS, and indicates a number of rows in the CU.

### Claim 12 (depends on 9)

The method of claim 9 further comprising repeating the compression and insertion steps until all rows in the data table are stored in the CS and the RS.

### Claim 13 (depends on 9)

The method of claim 9, wherein the CS is maintained at the primary database and the RS is maintained at the replica database.

### Claim 14 (depends on 9)

The method of claim 9, wherein the RS is maintained at the primary database and the CS is maintained at the replica database.

### Claim 15

A network component for managing storage of a primary database and a replica database, the network component comprising:
at least one processor coupled to a memory; and
a non-transitory computer readable storage medium storing programming for execution by the at least one processor, the programming including instructions to:
store data arranged in a sequence of rows in a first storage format at the primary database; and
store the data arranged in the sequence of rows in a second storage format at the replica database, wherein the sequence of rows is determined according to one of the first storage format and the second storage format.

### Claim 16 (depends on 15)

The network component of claim 15, wherein the first storage format is a row store (RS) and the second storage format is a column store (CS), and wherein the sequence of rows is determined to improve compression efficiency at the CS.

### Claim 17 (depends on 16)

The network component of claim 16, wherein the instructions to store the data in the primary database includes instructions to store each group of rows in a plurality of groups of rows in the data into a corresponding heap file of a fixed length, and wherein the instructions to store the data in the replica database includes instructions to store a fixed number of columns in each group of rows into a corresponding compression unit (CU) of a fixed number of entries.

### Claim 18 (depends on 17)

The network component of claim 17, wherein the heap file includes a sequence number indicating a first row in the group of rows.

### Claim 19 (depends on 17)

The network component of claim 17, wherein the heap file storing the group of rows includes or is associated with a CU descriptor that points to the corresponding CU storing the group of rows, includes a deletion bitmap field for flagging deleted rows where each bit represents a row in the CU, and indicates a total number of rows in the corresponding CU.

### Claim 20 (depends on 15)

The network component of claim 15, wherein the first storage format is a column store (CS) and the second storage format is a row store (RS), and wherein the sequence of rows is determined to improve compression efficiency at the CS.
