IP Library Granted Patent US 10,901,855
Granted Patent B2
US 10,901,855 · App. 16/014,773 · Granted Jan 26, 2021

On-demand multitenant data backup and restore

Inventors: Rachel L. Jarvie (Durham, NC); Qingyan Wang (Sudbury, MA)
Assignee: International Business Machines Corporation
G06F11/1451G06F16/2329G06F16/2358G06F16/2379G06F16/283G06F16/284G06F2201/80G06F2201/805G06F2201/82
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 10,901,855
App. No.
16/014,773
Granted
Jan 26, 2021
Kind
B2
Abstract

Methods, systems, and computer program products are provided. Tenant data of a multitenant relational database system is backed up by adding a value of a current version identifier for the tenant data to previous valid version identifiers for the tenant data, and changing the value of the current version identifier for the tenant data to a next previously-unused value. The tenant data is restored by changing the value of the current version identifier to a value of one of the previous valid version identifiers, and deleting, from the previous valid version identifiers, previous valid version identifiers that are not less recent than the changed value of the current version identifier. The tenant is provided with a view of the tenant data included in only a latest valid version of each respective record from among all valid versions of the each respective record.

Claims (95)

1. A computer-implemented method of backing up and restoring data on demand in a multitenant relational database system, the method comprising:

in response to receiving from a tenant device a request to backup tenant data of a tenant of the multitenant relational database system performing:

adding a value of a current version identifier associated with the tenant to a list of previous valid version identifiers associated with the tenant, each respective current version identifier and each respective list of previous valid version identifiers being associated with a respective tenant of a plurality of tenants, and

changing the value of the current version identifier associated with the tenant to a next previously-unused version identifier value associated with the tenant; and

in response to receiving from the tenant device a request to restore the tenant data of the tenant of the multitenant relational database system performing:

changing the value of the current version identifier associated with the tenant to a value of one of the previous valid version identifiers associated with the tenant, and

deleting, from the previous valid version identifiers associated with the tenant, ones of the previous valid version identifiers that are not less recent than the changed value of the current version identifier associated with the tenant resulting in the ones of the previous valid version identifiers that are more recent than the changed value of the current version identifier no longer being valid version identifiers for the tenant; and

providing the tenant device with access to the tenant data included in only a latest valid version of each respective record from among all valid versions of the each respective record, wherein

performing a backup of the tenant data of the tenant and performing a restore of the tenant data of the tenant affects only the tenant data accessible by the tenant without affecting accessibility of tenant data of other tenants by the other tenants.

2. The computer-implemented method of claim 1 , further comprising:

in response to receiving from the tenant device a request to access a record of the tenant data of the tenant of the multitenant relational database system, performing, by a computer:

accessing a version of the record having a most recent valid version identifier from among all valid versions of the record for the tenant, and

returning a copy of the version of the record to the tenant device; and

when the accessed version of the record has a delete flag that indicates that the accessed version of the record is deleted, discarding the accessed version of the record.

3. The computer-implemented method of claim 1 , further comprising:

in response to receiving a request from the tenant device to add a new record to the tenant data of the tenant of the multitenant relational database system, adding the new record to the tenant data of the tenant of the multitenant relational database system, the new record having a version identifier with the value of the current version identifier associated with the tenant and a delete flag indicating that the record is not deleted.

4. The computer-implemented method of claim 1 , further comprising:

in response to receiving a request from the tenant device to delete a record of the tenant data of the tenant of the multitenant relational database system, performing:

when a version identifier of the record to be deleted has a value of one of the previous valid version identifiers associated with the tenant, performing:

inserting a copy of the record to be deleted with a version identifier having the value of the current version identifier associated with the tenant, and

setting a delete flag of the inserted copy of the record to indicate that the record is deleted.

5. The computer-implemented method of claim 4 , further comprising:

when the version identifier of the record to be deleted has the value of the current version identifier and no earlier version of the record to be deleted exists, deleting the record.

6. The computer-implemented method of claim 4 , further comprising:

when the version identifier of the record to be deleted has the value of the current version identifier, setting a delete flag of the record to indicate that the record is deleted.

7. The computer-implemented method of claim 1 , further comprising:

in response to receiving a request from the tenant device to update a record of the tenant data of the tenant of the multitenant relational database system, performing:

when a version identifier of the record to be updated has the value of the current version identifier associated with the tenant, updating the record to be updated;

when the version identifier of the record to be updated has a value of one of the previous valid version identifiers associated with the tenant, performing:

inserting a copy of the record to be updated with a version identifier having the value of the current version identifier associated with the tenant, and

updating the copy of the record.

8. The computer-implemented method of claim 7 , wherein:

when the version identifier of the record to be updated has the value of the one of the previous valid version identifiers, overwriting a key of the copy of the record with a value of a key of the record to be updated.

9. A computer system including a multitenant relational database system, the computer system comprising:

at least one processor; and

a memory connected to the at least one processor, the memory including instructions for the at least one processor to be configured to perform:

in response to receiving from a tenant device a request to backup tenant data of a tenant of the multitenant relational database system by:

adding a value of a current version identifier associated with the tenant to a list of previous valid version identifiers associated with the tenant, each respective current version identifier and each respective list of previous valid version identifiers being associated with a respective tenant of a plurality of tenants, and

changing the value of the current version identifier associated with the tenant to a next previously-unused version identifier value associated with the tenant; and

in response to receiving from the tenant device a request to restore the tenant data in the multitenant relational database system:

changing the value of the current version identifier associated with the tenant to a value of one of the previous valid version identifiers associated with the tenant, and

deleting, from the previous valid version identifiers for the tenant, ones of the previous valid version identifiers that are not less recent than the changed value of the current version identifier associated with the tenant resulting in the ones of the previous valid version identifiers that are more recent than the changed value of the current version identifier no longer being valid version identifiers for the tenant; and

providing the tenant device with access to the tenant data included in only a latest valid version of each respective record from among all valid versions of the each respective record, wherein

performing a backup of the tenant data of the tenant and performing a restore of the tenant data of the tenant affects only the tenant data accessible by the tenant without affecting accessibility of tenant data of other tenants by the other tenants.

10. The computer system of claim 9 , wherein the at least one processor is further configured to perform:

in response to receiving from the tenant device a request to access a record of the tenant data of the tenant of the multitenant relational database system:

accessing a version of the record having a most recent valid version identifier from among all valid versions of the record for the tenant, and

returning a copy of the version of the record to the tenant device; and

when the accessed version of the record has a delete flag that indicates that the accessed version of the record is deleted, discarding the accessed version of the record.

11. The computer system of claim 9 , wherein the at least one processor is further configured to perform:

in response to receiving a request from the tenant device to add a new record to the tenant data of the tenant of the multitenant relational database system, adding the new record to the tenant data of the tenant of the multitenant relational database system, the new record having a version identifier with a value of the current version identifier associated with the tenant and a delete flag indicating that the record is not deleted.

12. The computer system of claim 9 , wherein the at least one processor is further configured to perform:

in response to receiving a request from the tenant device to delete a record of the tenant data of the tenant of the multitenant relational database system, performing:

when a version identifier of the record to be deleted has a value of one of the previous valid version identifiers associated with the tenant, performing:

inserting a copy of the record to be deleted with a version identifier having the value of the current version identifier associated with the tenant, and

setting a delete flag of the inserted copy of the record to indicate that the record is deleted.

13. The computer system of claim 12 , wherein the at least one processor is further configured to perform:

when the version identifier of the record to be deleted has the value of the current version identifier and no earlier version of the record to be deleted exists, deleting the record.

14. The computer system of claim 12 , wherein the at least one processor is further configured to perform:

when the version identifier of the record to be deleted has the value of the current version identifier, setting a delete flag of the record to indicate that the record is deleted.

15. The computer system of claim 9 , wherein the at least one processor is further configured to perform:

in response to receiving a request from the tenant device to update a record of the tenant data of the tenant of the multitenant relational database system, performing:

when a version identifier of the record to be updated has the value of the current version identifier associated with the tenant, updating the record to be updated;

when the version identifier of the record to be updated has a value of one of the previous valid version identifiers associated with the tenant:

inserting a copy of the record to be updated with a version identifier having the value of the current version identifier associated with the tenant,

overwriting a key of the copy of the record with a value of a key of the record to be updated, and

updating the copy of the record.

16. A computer program product comprising at least one computer readable storage medium having computer readable program code embodied therewith for execution on at least one processor of a processing device, the computer readable program code being configured to be executed by the at least one processor to perform:

in response to receiving from a tenant device a request to backup tenant data of a tenant of a multitenant relational database system:

adding a value of a current version identifier associated with the tenant to a list of previous valid version identifiers associated with the tenant, and

changing the value of the current version identifier associated with the tenant to a next previously-unused version identifier value associated with the tenant; and

in response to receiving from the tenant device a request to restore the tenant data in the multitenant relational database system:

changing the value of the current version identifier associated with the tenant to a value of one of the previous valid version identifiers associated with the tenant, and

deleting, from the previous valid version identifiers for the tenant, ones of the previous valid version identifiers that are not less recent than the changed value of the current version identifier associated with the tenant resulting in the ones of the previous valid version identifiers that are more recent than the changed value of the current version identifier no longer being valid version identifiers for the tenant, and

providing the tenant device with access to the tenant data included in only a latest valid version of each respective record from among all valid versions of the each respective record, wherein

performing a backup of the tenant data of the tenant and performing a restore of the tenant data of the tenant affects only the tenant data accessible by the tenant without affecting accessibility of tenant data of other tenants by the other tenants.

17. The computer program product of claim 16 , wherein the computer readable program code is further configured to be executed by the at least one processor to perform:

in response to receiving from the tenant device a request to access a record of the tenant data of the tenant of the multitenant relational database system:

accessing a version of the record having a most recent valid version identifier from among all valid versions of the record for the tenant, and

returning a copy of the version of the record to the tenant device; and

when the accessed version of the record has a delete flag that indicates that the accessed version of the record is deleted, discarding the accessed version of the record.

18. The computer program product of claim 16 , wherein the computer readable program code is further configured to be executed by the at least one processor to perform:

in response to receiving a request from the tenant device to delete a record of the tenant data of the tenant of the multitenant relational database system:

when a version identifier of the record to be deleted has a value of one of the previous valid version identifiers associated with the tenant:

inserting a copy of the record to be deleted with a version identifier having a value of the current version identifier associated with the tenant,

overwriting a key of the copy of the record to be deleted with a value of a key of the record to be deleted, and

setting a delete flag of the inserted copy of the record to indicate that the record is deleted.

19. The computer program product of claim 16 , wherein the computer readable program code is further configured to be executed by the at least one processor to perform:

in response to receiving a request from the tenant device to update a record of the tenant data of the tenant of the multitenant relational database system, performing:

when a version identifier of the record to be updated has the value of the current version identifier associated with the tenant, updating the record to be updated;

when the version identifier of the record to be updated has a value of one of the previous valid version identifiers associated with the tenant:

inserting a copy of the record to be updated with a version identifier having the value of the current version identifier associated with the tenant, and

updating the copy of the record.

20. The computer program product of claim 19 , wherein the computer readable program code is further configured to be executed by the at least one processor to perform:

when the version identifier of the record to be updated has the value of the one of the previous valid version identifiers, overwriting a key of the copy of the record with a value of a key of the record to be updated.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jun 21, 2018
From: JARVIE, RACHEL L.; WANG, QINGYAN
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 046407/0431 →
Continuity (1)
Related Publication 20190391879A1 · Dec 26, 2019