# US 10,482,103 B2 · Key-value store for lightweight replication of metadata

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

- Number: US 10,482,103 B2
- Document ID: US10482103B2
- Status: Granted
- Kind: B2
- Application number: 15/592,075
- Filed: 2017-05-10
- Published: 2018-11-15
- Granted: 2019-11-19
- Earliest claimed: 2017-05-10
- Assignees: Sap SE
- Applicants: Sap SE
- Inventors: Joo Yeon Lee; Jaehwa Kim; Joongkoo Lee
- Web page: https://patentgrep.com/patent/US10482103B2

## CPC

- G06F 16/2329: {using versioning}
- G06F 16/2228: {Indexing structures}
- 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

Methods and systems are disclosed for managing replication of metadata in a master-slave database environment. While metadata is managed on a master node using database tables with transaction guarantees, metadata copies on the slave node are managed using a lightweight key-value store. In exemplary embodiments, master metadata database tables are mapped to respective key-value structures at one or more slave nodes. The key-value structures have entries pointing to respective metadata objects, which include copies of metadata items stored in the master metadata database tables. The key-value structures can be hierarchically organized under a parent key-value structure. Metadata object versions can be organized as a linked list to facilitate multi-version concurrency control. Methods are disclosed for building the key-value store, for retrieving metadata from the store, for updating the store, for providing multi-version concurrency control, and for pruning obsolete metadata versions. Variants are disclosed.

## Claims

### Claim 1

One or more computer-readable media having stored therein computer-executable instructions for causing one or more processors, when programmed thereby, to perform operations comprising, at a slave node in a database environment:
instantiating a key-value store to catalog locally stored metadata from a given metadata database table, among one or more metadata database tables at a master node in the database environment; and
adding, to the key-value store, a given key-value entry comprising a key and a value for a metadata object, wherein the metadata object includes a copy of a metadata item stored in the given metadata database table.

### Claim 2 (depends on 1)

The one or more computer-readable media of claim 1, wherein, in the given key-value entry, the key comprises an identifier of the metadata item stored in the given metadata database table.

### Claim 3 (depends on 1)

The one or more computer-readable media of claim 1, wherein, in the given key-value entry, the value is:
a reference to the metadata object;
the metadata object;
a reference to a sequential data structure that includes the metadata object; or
a placeholder.

### Claim 4 (depends on 1)

The one or more computer-readable media of claim 1, wherein the operations further comprise:
receiving a request for the metadata item;
based at least in part on the request, determining a metadata item search value;
looking up the metadata item search value in the key-value store to find the given key-value entry; and
using the given key-value entry to get the copy of the metadata item.

### Claim 5 (depends on 4)

The one or more computer-readable media of claim 4, wherein using the given key-value entry to get the copy of the metadata item comprises:
using the value in the given key-value entry as the copy of the metadata item;
using the value in the given key-value entry as a reference to get the metadata object and extracting the copy of the metadata item from the metadata object; or
using the value in the given key-value entry as a reference to get a sequential data structure, traversing the sequential data structure to get the metadata object, and extracting the copy of the metadata item from the metadata object.

### Claim 6 (depends on 1)

The one or more computer-readable media of claim 1, wherein the metadata object is a first version of the metadata object, the first version providing a first snapshot of the metadata item stored in the given metadata database table, and wherein the operations further comprise:
attaching a second version of the metadata object to the given key-value entry, the second version providing a second snapshot of the metadata item stored in the given database table, wherein the second snapshot is later than the first snapshot.

### Claim 7 (depends on 6)

The one or more computer-readable media of claim 6, wherein, in the given key-value entry, the value is a reference to a sequential data structure that includes the first version and the second version.

### Claim 8 (depends on 6)

The one or more computer-readable media of claim 6, wherein version data for the first version indicates a first timestamp range, and wherein version data for the second version indicates a second timestamp range after the first timestamp range.

### Claim 9 (depends on 6)

The one or more computer-readable media of claim 6, wherein the operations further comprise:
receiving a request for the metadata item, the request including a timestamp;
based at least in part on the request, determining a metadata item search value;
looking up the metadata item search value in the key-value store to find the given key-value entry; and
based at least in part on comparisons of the timestamp of the request to a timestamp limit of the first version and/or a timestamp limit of the second version, determining the copy of the metadata item from the second version, wherein the second version is valid at the timestamp of the request.

### Claim 10 (depends on 1)

The one or more computer-readable media of claim 1, wherein the given metadata database table at the master node supports guaranteed database transactions, and wherein the key-value store at the slave node supports non-guaranteed operations.

### Claim 11 (depends on 10)

The one or more computer-readable media of claim 10, wherein the key-value store is managed as a read-only cache.

### Claim 12 (depends on 1)

The one or more computer-readable media of claim 1, wherein the operations further comprise:
for each of one or more metadata database tables, among the one or more metadata database tables at the master node, instantiating a respective key-value structure within the key-value store.

### Claim 13 (depends on 12)

The one or more computer-readable media of claim 12, wherein the one or more metadata database tables include the given metadata database table, and the operations further comprise:
instantiating a parent key-value structure; and
adding, to the parent key-value structure, a parent key-value entry for the given metadata database table, the parent key-value entry comprising:
a key; and
a value for the key-value structure for the given metadata database table.

### Claim 14 (depends on 1)

The one or more computer-readable media of claim 1, wherein the slave node is a first slave node, and wherein the operations further comprise, at a second slave node in the database environment:
instantiating a second key-value store to catalog locally stored metadata from another metadata database table, among the one or more metadata database tables at the master node, that is not replicated at the first slave node; and
adding, to the second key-value store, a second key-value entry comprising a second key and a second value for a second metadata object, wherein the second metadata object includes a copy of a second metadata item stored in the other metadata database table.

### Claim 15 (depends on 1)

The one or more computer-readable media of claim 1, wherein the operations further comprise:
receiving a request for the metadata item, wherein adding the given key-value entry is performed in response to the receiving the request.

### Claim 16

A computer system comprising one or more processors and memory, wherein the computer system implements a name server configured to perform operations of a slave node in a database environment, the operations comprising:
instantiating a key-value structure for a given metadata database table, among one or more metadata database tables at a master node in the database environment; and
adding, to the key-value structure for the given metadata database table, a given key-value entry, the given key-value entry comprising a key and a value for a metadata object, wherein the metadata object includes a copy of a metadata item stored in the given metadata database table.

### Claim 17

A method comprising:
at a slave node in a database environment:
instantiating a key-value store to catalog locally stored metadata from a given metadata database table, among one or more metadata database tables at a master node in the database environment; and
adding, to the key-value store, a given key-value entry comprising a key and a value for a metadata object, wherein the metadata object includes a copy of a metadata item stored in the given metadata database table.

### Claim 18 (depends on 17)

The method of claim 17, wherein, in the given key-value entry:
the key comprises an identifier of the metadata item stored in the given metadata database table; and
the value comprises:
a reference to the metadata object;
the metadata object;
a reference to a sequential data structure that includes the metadata object; or
a placeholder.

### Claim 19 (depends on 17)

The method of claim 17, further comprising:
receiving a request for the metadata item;
based at least in part on the request, determining a metadata item search value;
looking up the metadata item search value in the key-value store to find the given key-value entry; and
using the given key-value entry to get the copy of the metadata item.

### Claim 20 (depends on 17)

The method of claim 17, wherein the metadata object is a first version of the metadata object, the first version providing a first snapshot of the metadata item stored in the given metadata database table, and further comprising:
attaching a second version of the metadata object to the given key-value entry, the second version providing a second snapshot of the metadata item stored in the given database table, wherein the second snapshot is later than the first snapshot.
