Pattern for integrating primary and secondary data stores in a sharded data domain
First Claim
1. A method comprising:
- receiving, by a data access logic (DAL) framework comprising one or more processors, a request for a write operation of a record, the DAL framework managing cache persistence associated with a sharded database, a secondary data store, and an alternative key global indexes (AKGI) database, the secondary data store being configured to act as a read cache to offload read activity from the sharded database;
initializing the secondary data store by (1) updating metadata of the record in the secondary data store, the metadata comprising a primary key (PK) associated with the record, and an alternative key (AK) hash value associated with the record, (2) not changing content data of the record when the record is not a new aggregate, and (3) storing a null payload in the content data of the record when the record is a new aggregate, wherein updating the metadata of the record in the secondary data store comprises;
setting a transaction-specific time-to-live (TTL) for the record, the transaction-specific TTL being specified by an application that requested the write operation; and
setting a check-and-set (CAS) value for the record;
performing, based on the PK and the AK hash value, the write operation of the record in the AKGI database and the sharded database, respectively, in a single coordinated transaction in which a modification of the AKGI database is completed before modifying the sharded database; and
updating the content data of the record in the secondary data store, in a finalization phase of the secondary data store, by (1) resetting the metadata, including the transaction-specific TTL, and (2) persisting aggregate data and AKGI data to the secondary data store in response to determining that;
(i) the write operation is successfully completed and the record is committed to the sharded database and the AKGI database, and (ii) the CAS value has not been changed during the transaction-specific TTL.
2 Assignments
0 Petitions
Accused Products
Abstract
Example systems and methods for integrating a sharded primary data store (e.g., a source-of-truth relational database management system), a secondary data store (e.g., external cache) and an external global index are described. The approach implements a modified read-through/write-through data access pattern that integrates read and write flows in order to support high-concurrency environments while maintaining immediate consistency between all three stores. Writes are handled using a three-phase flow that avoids concurrency-related race conditions and the need to block in the secondary store in order to maintain cross-store consistency. Reads are never dirty and will repair the secondary store as needed, presenting an immediately consistent view of data to application consumers.
-
Citations
15 Claims
-
1. A method comprising:
-
receiving, by a data access logic (DAL) framework comprising one or more processors, a request for a write operation of a record, the DAL framework managing cache persistence associated with a sharded database, a secondary data store, and an alternative key global indexes (AKGI) database, the secondary data store being configured to act as a read cache to offload read activity from the sharded database; initializing the secondary data store by (1) updating metadata of the record in the secondary data store, the metadata comprising a primary key (PK) associated with the record, and an alternative key (AK) hash value associated with the record, (2) not changing content data of the record when the record is not a new aggregate, and (3) storing a null payload in the content data of the record when the record is a new aggregate, wherein updating the metadata of the record in the secondary data store comprises; setting a transaction-specific time-to-live (TTL) for the record, the transaction-specific TTL being specified by an application that requested the write operation; and setting a check-and-set (CAS) value for the record; performing, based on the PK and the AK hash value, the write operation of the record in the AKGI database and the sharded database, respectively, in a single coordinated transaction in which a modification of the AKGI database is completed before modifying the sharded database; and updating the content data of the record in the secondary data store, in a finalization phase of the secondary data store, by (1) resetting the metadata, including the transaction-specific TTL, and (2) persisting aggregate data and AKGI data to the secondary data store in response to determining that;
(i) the write operation is successfully completed and the record is committed to the sharded database and the AKGI database, and (ii) the CAS value has not been changed during the transaction-specific TTL. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8)
-
-
9. An apparatus comprising:
-
a memory configured to store data and one or more sets of instructions; and one or more processors coupled to the memory, the one or more processors configured to execute the one or more sets of instructions and perform operations comprising; receiving a request for a write operation of a record in a secondary data store associated with a sharded database and an alternative key global indexes (AKGI) database, the secondary data store being configured to act as a read cache to offload read activity from the sharded database; determining whether the secondary data store includes the record; and in response to a determination that the secondary data store includes the record; initializing the secondary data store by (1) updating metadata of the record in the secondary data store, the metadata comprising a primary key (PK) associated with the record and an alternative key (AK) hash value associated with the record, (2) not changing content data of the record when the record is not a new aggregate, and (3) storing a null payload in the content data of the record when the record is a new aggregate, wherein updating the metadata of the record in the secondary data store comprises; setting a transaction-specific time-to-live (TTL) for the record, the transaction-specific TTL being specified by an application that requested the write operation; and setting a check-and-set (CAS) value for the record; performing, based on the PK and the AK hash value, the write operation of the record in the AKGI database and the sharded database, respectively, in a single coordinated transaction in which a modification of the AKGI database is completed before modifying the sharded database; and updating the content data of the record in the secondary data store, in a finalization phase of the secondary data store, by (1) resetting the metadata, including the transaction-specific TTL, and (2) persisting aggregate data and AKGI data to the secondary data store in response to determining that;
(i) the write operation is successfully completed, and (ii) the CAS value has not been changed during the transaction-specific TTL. - View Dependent Claims (10, 11, 12, 13, 14, 15)
-
Specification