US 12,475,082 B2
System and method for synchronizing delete operations between primary and secondary databases
Karthik Mohan Subramanian, Sunnyvale, CA (US); Ted Liu, Los Altos, CA (US); Jeffrey Zoch, San Francisco, CA (US); Yeshwant Sai Madanagopal, Fremont, CA (US); and Youngjin Yu, Cupertino, CA (US)
Assigned to Salesforce, Inc., San Francisco, CA (US)
Filed by Salesforce, Inc., San Francisco, CA (US)
Filed on Jan. 9, 2020, as Appl. No. 16/738,415.
Prior Publication US 2021/0216502 A1, Jul. 15, 2021
Int. Cl. G06F 16/16 (2019.01); G06F 3/06 (2006.01); G06F 16/27 (2019.01)
CPC G06F 16/162 (2019.01) [G06F 3/0608 (2013.01); G06F 3/0652 (2013.01); G06F 3/067 (2013.01); G06F 16/27 (2019.01)] 21 Claims
OG exemplary drawing
 
1. An apparatus, comprising:
a processing device; and
a memory device coupled to the processing device, the memory device having instructions stored thereon that, in response to execution by the processing device, cause the processing device to:
identify, by a secondary database, a chunk of records in the secondary database;
transmit, by the secondary database, a message to a primary database, the message identifying the chunk of records, the message also inquiring as to whether any records of the chunk of records are delete-able from the secondary database;
in response to the message received from the secondary database, determine, by the primary database, whether any records of the chunk of records do not exist or are marked for deletion in the primary database;
process, by the secondary database, a response to the message, the response being received from the primary database and identifying which records of the chunk of records can be deleted by the secondary database;
delete, by the secondary database, each record of the chunk of records from the secondary database that the message identified;
repeat, by the secondary database, the transmitting of messages to the primary database for different chunks of records in the secondary database and the deleting of records from the secondary database that responses to the messages indicated were delete-able; and
as part of the repeating performing at least one of:
send, by the secondary database, a next message to the primary database after records identified in a response to an earlier message have been deleted; or
send, by the secondary database, a next message to the primary database only after a response to one of a maximum permitted number of simultaneous in-flight messages has been received;
wherein a main memory keeps pages of meta-data for records in the primary database that indicate for at least a portion of the records whether the record is at least one of: deleted or delete-able, and wherein, at any time, only a subset of the records within the primary database are able to have their meta-data on a page in the main memory;
wherein remaining pages of meta-data for the records in the primary database that indicate whether the record is at least one of: deleted or delete-able are stored in non-volatile mass storage;
wherein frequently accessed pages of meta-data in the non-volatile mass storage replace lesser used pages of meta-data in the main memory;
wherein a software thread invokes a bloom filter to determine which ones of the records in the primary database have meta-data in the main memory that indicates whether the record is at least one of: deleted or delete-able; and
wherein, if the bloom filter indicates that the record does not have meta-data in main memory that indicates whether the record is at least one of: deleted or delete-able, the software thread determines that, for purposes of generating the response, the record is not to be regarded as any of: deleted or delete-able.