# US 2024/0202102 A1 · Pre-Seeding Databases For Integration Testing

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

- Number: US 2024/0202102 A1
- Document ID: US20240202102A1
- Status: Published application
- Kind: A1
- Application number: 18/081,247
- Filed: 2022-12-14
- Published: 2024-06-20
- Earliest claimed: 2022-12-14
- Assignees: Google Inc.
- Applicants: Google LLC
- Inventors: Srinath Badrinath; Derek Karl Hunter; Benson Margulies
- Web page: https://patentgrep.com/patent/US20240202102A1

## CPC

- G06F 11/3696: {Methods or tools to render software testable}
- G06F 11/3698: Environments for analysis, debugging or testing of software
- G06F 7/08: Sorting, i.e. grouping record carriers in numerical or other ordered sequence according to the classification of at least some of the information they carry (by merging two or more sets of carriers in ordered sequence G06F7/16)
- G06F 11/1469: {Backup restoration techniques}
- G06F 16/219: {Managing data history or versioning (querying versioned data G06F16/2474; querying temporal data G06F16/2477)}
- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F 2201/80: Database-specific techniques
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Aspects of the disclosure are directed to pre-seeding test databases in a computing environment for software testing. A system manages a pool of pre-seeded databases to serve user devices with different database requirements for their integration testing needs. Pre-seeded databases can be served more efficiently over empty databases that are populated client-side. From a user perspective, databases appear ready instantly, ready for use as part of testing software using the pre-seeded databases as a stand-in for production data. Pre-seeding databases circumvents the issues of wasted time and potential error that are otherwise possible when databases are served and populated client-side. Pre-seeding data mitigates the need to seed the database during test-time, reducing the integration test cycle for software being tested. Aspects of the disclosure provide for real-time restoration of databases by fixing portions of the database in place instead of outright deletion and recreation of an entire database.

## Claims

### Claim 1

A method for populating test data in a test environment, the method comprising:
receiving, by one or more processors, a request from a device for a database comprising one or more rows of data, the request further comprising one or more parameters defining the database or data in the database;
determining, by the one or more processors and from a pool of one or more pre-seeded databases, that a pre-seeded database matches the one or more parameters within a predetermined tolerance, the pre-seeded database comprising one or more rows of data;
in response to the determination that the pool comprises the pre-seeded database matching the one or more parameters within the predetermined tolerance, assigning, by the one or more processors, the pre-seeded database to the device from which the request was received; and
providing, by the one or more processors, the data from the pre-seeded database in response to the request.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
determining, by the one or more processors, that the pool does not comprise the pre-seeded database, and in response, adding a database matching the one or more parameters within the predetermined tolerance to the pool.

### Claim 3 (depends on 1)

The method of claim 1, wherein the request is received from the test environment performing an integration test of software using the pre-seeded database.

### Claim 4 (depends on 1)

The method of claim 1,
wherein the method further comprises restoring, by the one or more processors, the pre-seeded database, the pre-seeded database modified at one or more rows of one or more tables, wherein restoring the pre-seeded database comprises restoring, using a source copy of the pre-seeded database, only the one or more modified rows.

### Claim 5 (depends on 1)

The method of claim 1, wherein the method further comprises receiving, by the one or more processors, the request as part of a test environment start-up procedure.

### Claim 6 (depends on 1)

The method of claim 1, further comprising:
receiving, by the one or more processors, a request for restoration of the pre-seeded database to a previous time, wherein the pre-seeded database has been modified since the previous time;
receiving, by the one or more processors, a changelog of modifications to the pre-seeded database;
identifying, by the one or more processors and from the changelog, one or more operators applied to the pre-seeded database since the previous time;
transforming, by the one or more processors and from the one or more operators, insert operators to delete operators, and delete or modify operators to copy operators; and
applying, by the one or more processors, the transformed operators to the pre-seeded database.

### Claim 7 (depends on 6)

The method of claim 6, wherein receiving the changelog further comprises determining that the changelog is available, and wherein the method further comprises:
in response to the determination that the changelog is not available, deleting, by the one or more processors, the pre-seeded database and re-creating the pre-seeded database from a saved source copy of the pre-seeded database.

### Claim 8 (depends on 6)

The method of claim 6, wherein applying the one or more transformed operators comprises:
applying, by the one or more processors, the transformed operators in parallel as groups based on common primary keys representing tables in the pre-seeded database targeted by the one or more transformed operators.

### Claim 9 (depends on 8)

The method of claim 8, wherein applying the one or more transformed operators comprises:
generating, by the one or more processors, a directed acyclic graph of the tables corresponding to the common primary keys, wherein nodes of the directed acyclic graph represent the tables and edges of the directed acyclic graph represent dependencies between tables;
topological sorting, by the one or more processors, the directed acyclic graph;
applying, by the one or more processors, copy operators in the one or more transformed operators to the pre-seeded database; and
applying, by the one or more processors, the delete operators in the order of the topological sorted directed acyclic graph.

### Claim 10

A system comprising one or more processors, the one or more processors configured to:
receive a request from a device for a database comprising one or more rows of data, the request further comprising one or more parameters defining the database or data in the database;
determine from a pool of one or more pre-seeded databases, that a pre-seeded database matches the one or more parameters within a predetermined tolerance, the pre-seeded database comprising one or more rows of data;
in response to the determination that the pool comprises the pre-seeded database matching the one or more parameters within the predetermined tolerance, assign the pre-seeded database to the device from which the request was received; and
provide the data from the pre-seeded database in response to the request.

### Claim 11 (depends on 10)

The system of claim 10, wherein the one or more processors are further configured to:
determine that the pool does not comprise the pre-seeded database, and in response, add a database matching the one or more parameters within the predetermined tolerance to the pool.

### Claim 12 (depends on 10)

The system of claim 10, wherein the request is received from a test environment performing an integration test of software using the pre-seeded database.

### Claim 13 (depends on 10)

The system of claim 10, wherein the one or more processors are further configured to restore the pre-seeded database, the pre-seeded database modified at one or more rows of one or more tables, wherein in restoring the pre-seeded database the one or more processors are configured to restore, using a source copy of the pre-seeded database, only the one or more modified rows.

### Claim 14 (depends on 10)

The system of claim 10, wherein the one or more processors are further configured to receive the request as part of a test environment start-up procedure.

### Claim 15 (depends on 10)

The system of claim 10, wherein the one or more processors are further configured to:
receive a request for restoration of the pre-seeded database to a previous time, wherein the pre-seeded database has been modified since the previous time;
receive a changelog of modifications to the pre-seeded database;
identify, from the changelog, one or more operators applied to the pre-seeded database since the previous time;
transform, from the one or more operators, insert operators to delete operators, and delete or modify operators to copy operators; and
apply the transformed operators to the pre-seeded database.

### Claim 16 (depends on 15)

The system of claim 15, wherein in receiving the changelog, the one or more processors are further configured to determine that the changelog is available, and wherein the one or more processors are further configured to:
in response to the determination that the changelog is not available, delete the pre-seeded database and re-create the pre-seeded database from a saved source copy of the pre-seeded database.

### Claim 17 (depends on 16)

The system of claim 16, wherein in applying the one or more transformed operators, the one or more processors are configured to:
apply the transformed operators in parallel as groups based on common primary keys representing tables in the pre-seeded database targeted by the one or more transformed operators.

### Claim 18 (depends on 17)

The system of claim 17, wherein in applying the one or more transformed operators, the one or more processors are configured to:
generate a directed acyclic graph of the tables corresponding to the common primary keys, wherein nodes of the directed acyclic graph represent the tables and edges of the directed acyclic graph represent dependencies between tables;
topological sort the directed acyclic graph;
apply copy operators in the one or more transformed operators to the pre-seeded database; and
apply the delete operators in the order of the topological sorted directed acyclic graph.

### Claim 19

One or more non-transitory computer-readable storage media storing instructions that are operable, when executed by one or more processors, to cause the one or more processors to perform operations comprising:
receiving, by one or more processors, a request from a device for a database comprising one or more rows of data, the request further comprising one or more parameters defining the database or data in the database;
determining, by the one or more processors and from a pool of one or more pre-seeded databases, that a pre-seeded database matches the one or more parameters within a predetermined tolerance, the pre-seeded database comprising one or more rows of data;
in response to the determination that the pool comprises the pre-seeded database matching the one or more parameters within the predetermined tolerance, assigning, by the one or more processors, the pre-seeded database to the device from which the request was received; and
providing, by the one or more processors, the data from the pre-seeded database in response to the request.

### Claim 20 (depends on 19)

The computer-readable storage media of claim 19, wherein the operations further comprise:
determining, by the one or more processors, that the pool does not comprise the pre-seeded database, and in response, adding a database matching the one or more parameters within the predetermined tolerance to the pool.
