# US 2021/0240689 A1 · Updating a Multi-Tenant Database Concurrent with Tenant Cloning

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

- Number: US 2021/0240689 A1
- Document ID: US20210240689A1
- Status: Published application
- Kind: A1
- Application number: 16/779,321
- Filed: 2020-01-31
- Published: 2021-08-05
- Earliest claimed: 2020-01-31
- Assignees: salesforce.com, inc.
- Applicants: salesforce.com, inc.
- Inventors: Stephane Geneix; Simon Y. Wong; Randy Spalten
- Web page: https://patentgrep.com/patent/US20210240689A1

## CPC

- G06F 16/2343: {Locking methods, e.g. distributed locking or locking implementation details}
- G06F 11/1451: {by selection of backup contents}
- G06F 2201/80: Database-specific techniques
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure is directed to updating a multi-tenant database concurrent with tenant cloning. In some embodiments, a computer system receives a request to perform an update operation on a multi-tenant database. The update operation includes updating database entries for a plurality of tenants. Responsive to receiving the request, the update operation is initiated. Performing the update operation includes accessing a list identifying database entries awaiting the updating. During the accessing of the list, the update operation holds a lock. When the lock becomes available for acquisition, a clone process is permitted to create, during performance of the update operation, a clone of a tenant's data within the database.

## Claims

### Claim 1

A method, comprising:
receiving, at a computer system, a request to perform an update operation on a multi-tenant database that includes updating database entries for a plurality of database tenants;
in response to receiving the request, initiating performance of the update operation, wherein performing the update operation includes:
accessing, by the update operation, a list identifying database tenants having database entries awaiting the updating;
holding, by the update operation, a lock while the update operation accesses the list; and
when the lock becomes available for acquisition, permitting a clone process to create, during performance of the update operation, a clone of a tenant's data within the database.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
re-acquiring the lock by the update operation upon completing updating of the database tenants identified in the list;
determining if any additional tenants have been added to the list during performance of the operation;
releasing the lock subsequent to determining if any additional tenants have been added; and
responsive to determining that additional tenants have been added, updating the additional tenants.

### Claim 3 (depends on 2)

The method of claim 2, wherein the additional tenants are clones created by cloning one or more database tenants.

### Claim 4 (depends on 1)

The method of claim 1, further comprising:
prior to performing the updating of a particular database tenant, creating a clone of the particular tenant concurrent with the update operation performing the updating on another database tenant; and
generating an indication that the updating is to be performed by the update operation on the clone.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
subsequent to the update operation performing the updating on a particular tenant, creating a clone of the particular tenant; and
generating an indication that the updating is not to be performed by the update operation on the clone.

### Claim 6 (depends on 1)

The method of claim 1, further comprising inhibiting the clone process from adding an entry to the list while the update operation is holding the lock.

### Claim 7 (depends on 1)

The method of claim 1, wherein the updating is an atomic operation.

### Claim 8 (depends on 1)

The method of claim 1, wherein creating the clone is an atomic operation.

### Claim 9 (depends on 1)

The method of claim 1, wherein the lock, when held by the clone process, permits the clone process to create a clone and to add an indication to the list that the operation is to be performed on the clone.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
determining, responsive to receiving the request to perform the operation, determining if the clone process is presently creating a clone corresponding of a particular tenant; and
acquiring the lock, by the update process, subsequent to the clone process completing creating the clone.

### Claim 11

A non-transitory computer readable medium having program instructions stored thereon that are capable of causing a computing system to implement operations comprising:
receive a request to perform an update on tenants of a multi-tenant database; and
perform the update, using an update process, on the tenants of the multi-tenant database, wherein performing the update includes:
acquiring a lock, by the update process, to inhibit any tenant of the database from duplicating their respective data;
accessing, using the update process, a list of entries in the database, wherein each of the entries corresponds to a tenant of the database;
releasing the lock subsequent to completing the accessing; and
permitting a clone process to create a clone of a tenant's data within the database concurrent with the update process performing the update.

### Claim 12 (depends on 11)

The computer readable medium of claim 11, wherein performing the update further includes:
re-acquiring the lock subsequent to the update process completing performance of the update process on the entries in the list;
determining if the update process is to be performed on clones created by the clone process;
releasing the lock; and
performing the update process on the clones designated as not previously updated.

### Claim 13 (depends on 11)

The computer readable medium of claim 11, wherein the program instructions are capable of causing the computing system to:
prior to having performed the update on a particular tenant, cause the clone process to create a clone of the particular tenant; and
generate an indication that the update process is to perform the update on the clone of the particular tenant, wherein generating the indication includes the clone process acquiring the lock.

### Claim 14 (depends on 11)

The computer readable medium of claim 11, wherein the program instructions are capable of causing the computing system to:
subsequent to having performed the update on a particular tenant, cause the clone process to create a clone of the particular tenant; and
generate an indication that the update process is not to perform the update on the clone of the particular tenant.

### Claim 15 (depends on 11)

The computer readable medium of claim 11, wherein performing the update further comprises:
determining, responsive to receiving the request, if the clone process is creating a duplicate of a particular tenant;
acquiring the lock responsive to the clone process completing creating the duplicate of the particular tenant.

### Claim 16 (depends on 11)

The computer readable medium of claim 11, wherein:
performing the update process on a particular tenant comprises performing a first atomic operation with respect to the particular tenant; and
performing the clone process on the particular tenant comprises performing a second atomic operation with respect to the particular tenant.

### Claim 17

A method comprising:
receiving, at a computer system, a request to perform an operation on a multi-tenant database that includes updating database entries for a plurality of database tenants;
performing the operation on the multi-tenant database, wherein performing the operation includes:
accessing, by a process associated with the operation, a list of tenants in the database, wherein accessing includes using a lock to inhibit any tenant of the multi-tenant database from duplicating their respective data;
releasing the lock in response to the process completing access to the list, wherein a duplication process is permitted acquire the lock and duplicate a tenant's data within the database subsequent to releasing the lock;
performing the operation on tenants in the list;
re-acquiring the lock by the process in response to performing the operation on tenants in the list;
determining, in response to re-acquiring the lock, if any duplicate tenants have been created by the duplication process; and
performing the operation on any duplicate tenants.

### Claim 18 (depends on 17)

The method of claim 17, further comprising the duplication process acquiring the lock when creating a duplicate of a particular tenant.

### Claim 19 (depends on 17)

The method of claim 17, further comprising:
prior to the operation updating a particular tenant, the duplication process creating a duplicate of the particular tenant concurrent with the operation being performed on another tenant; and
generating an indication that the operation is to be performed on the duplicate of the particular tenant.

### Claim 20 (depends on 17)

The method of claim 17, further comprising inhibiting the duplication process from creating a duplicate of a particular tenant when the operation is being performed on the particular tenant.
