System and method for implementing cache consistent regional clusters
First Claim
1. An apparatus located in a first region of a system, the apparatus comprising:
- a memory configured to store database updates performed on a first database cluster in the first region, wherein each database update corresponds to a key; and
a processor configured to;
for each database update,generate an update statement to update the key in a replica database in a second region remote from the first region, andappend the update statement with a first invalidation associated with the key to generate a modified update statement,transmit the modified update statements to the replica database to cause the replica database to (a) update the keys in the replica database and (b) execute the first invalidations on caches in the second region,when the replica database has failed and cannot respond to database updates,extract the first invalidations from the modified update statements, andpublish a first subset of the first invalidations to a subscriber in the second region, wherein the first subset of the first invalidations are associated with keys having values stored in the replica database, wherein the subscriber is configured to send the first subset of the first invalidations to the caches in the second region to cause values stored in the caches for the keys to be deleted.
2 Assignments
0 Petitions
Accused Products
Abstract
When multiple regional data clusters are used to store data in a system, maintaining cache consistency across different regions is important for providing a desirable user experience. In one embodiment, there is a master data cluster where all data writes are performed, and the writes are replicated to each of the slave data clusters in the other regions. Appended to the replication statements are invalidations for cache values for the keys whose values have been changed in the master data cluster. An apparatus in the master data cluster logs replication statements sent to the slave databases. When a slave database fails, the apparatus extracts the invalidations intended for the failed database and publishes the invalidations to a subscriber in the region of the failed database. The subscriber sends the invalidations to the local caches to cause stale data for those keys to be deleted from the caches.
79 Citations
19 Claims
-
1. An apparatus located in a first region of a system, the apparatus comprising:
-
a memory configured to store database updates performed on a first database cluster in the first region, wherein each database update corresponds to a key; and a processor configured to; for each database update, generate an update statement to update the key in a replica database in a second region remote from the first region, and append the update statement with a first invalidation associated with the key to generate a modified update statement, transmit the modified update statements to the replica database to cause the replica database to (a) update the keys in the replica database and (b) execute the first invalidations on caches in the second region, when the replica database has failed and cannot respond to database updates, extract the first invalidations from the modified update statements, and publish a first subset of the first invalidations to a subscriber in the second region, wherein the first subset of the first invalidations are associated with keys having values stored in the replica database, wherein the subscriber is configured to send the first subset of the first invalidations to the caches in the second region to cause values stored in the caches for the keys to be deleted. - View Dependent Claims (2, 3, 4, 5, 6)
-
-
7. A system comprising:
-
a processor; a master data cluster in a first region of the system; a read-only data cluster in a second region remote from the first region, wherein the read-only data cluster is a replica of the master data cluster and comprises one or more slave databases; an apparatus in the master data cluster, the apparatus configured to; log database updates performed on the master data cluster, wherein each database update corresponds to a key, for each database update, generate an update statement to update the corresponding key in a slave database of the one or more slave databases, and append the update statement with an invalidation associated with the corresponding key to generate a modified update statement, transmit the modified update statements to the slave database to cause the slave database to (a) update the keys in the slave database and (b) execute the invalidations on caches in the second region, and wherein, when the slave database has failed, select the invalidations from the modified update statements sent to the failed database for sending to a subscriber in the second region; and at least one cache in the second region, wherein the subscriber in the second region is configured to send the invalidations received from the apparatus to the at least one cache to cause the stored values for the keys specified in the invalidations to be deleted from the at least one cache. - View Dependent Claims (8, 9, 10, 11, 12, 13)
-
-
14. A computer-implemented method comprising:
-
logging database updates performed on a database in a master data cluster in a first region, wherein each database update corresponds to a key; for each database update, generating an update statement to update the key in a slave database in a replica data cluster in a second region remote from the first region, and appending the update statement with an invalidation associated with the key to generate a modified update statement; transmitting the modified update statements to the slave database to cause the slave database to (a) update the keys in the slave database and (b) execute the invalidations on caches in the second region to delete values associated with the corresponding keys; publishing, from a module in the first region, the invalidations to a subscriber in the second region, wherein the invalidations are associated with the keys having values stored in the slave database in the second region, and further wherein the slave database has failed and cannot process the invalidations; and sending, by the subscriber, the invalidations to the caches in the second region to cause to be deleted values stored in the caches for the keys. - View Dependent Claims (15, 16, 17, 18, 19)
-
Specification