US 12,141,119 B2
Write protecting tenant data in a multi-tenant database system
Sai Rama Raju Alluru, Hyderabad (IN)
Assigned to Salesforce, Inc., San Francisco, CA (US)
Filed by Salesforce, Inc., San Francisco, CA (US)
Filed on Dec. 28, 2022, as Appl. No. 18/090,429.
Prior Publication US 2024/0220476 A1, Jul. 4, 2024
Int. Cl. G06F 7/00 (2006.01); G06F 16/23 (2019.01); G06F 17/00 (2019.01)
CPC G06F 16/2343 (2019.01) [G06F 16/2358 (2019.01)] 20 Claims
OG exemplary drawing
 
1. A method for copying tenant data in a multi-tenant system, comprising:
receiving a request to copy a tenant data of a tenant from a source database of a source database system to a target database of a target database system;
indicating in a tenant metadata that the tenant is write protected; and
copying the tenant data, comprising: performing a bulk copy of the tenant data in the source database to the target database and, after performing the bulk copy, transferring change logs from the source database system to the target database system by repeatedly performing by the target database system:
receiving a first database statement configured to perform a first set of row level database operations, the first database statement causing execution of a first statement level trigger;
executing the first statement level trigger causing refreshing of a cache of the tenant metadata; and
executing the first set of row level database operations, wherein execution of a row level operation includes: in response to determining that the cache of the tenant metadata indicates the tenant is write protected, causing execution of a row level trigger with instructions to rollback the row level operation; and
receiving a second database statement configured to perform a second set of row level operations, the second database statement causing execution of a second statement level trigger; and
executing the second statement level trigger causes checking that the cache of the tenant metadata is loaded and does not need to be refreshed.