IP Library Granted Patent US 10,698,920
Granted Patent B2
US 10,698,920 · App. 15/852,271 · Granted Jun 30, 2020

Techniques for a linearizable primary-secondary database system that replicates database data with eventual consistency

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,698,920
App. No.
15/852,271
Granted
Jun 30, 2020
Kind
B2
Abstract

Techniques are provided for a linearizable primary-secondary database system that replicates database data with eventual consistency. The techniques include obtaining a logical clock value of a logical clock that orders transactions committed at a primary database system that includes a primary database. The logical clock value is obtained after a write transaction is committed at the primary database system and while processing a read request. The logical clock value is used to determine whether a secondary database is in a consistent replication state corresponding to the logical clock value with respect to the primary database. The read request is maintained in a linger state while the secondary database is not yet in the consistent replication state. The read request exits the linger state and is allowed to be processed against the secondary database after the secondary database has reached the consistent replication state.

Claims (81)

1. A method for providing a linearizable primary-secondary database system to a client even though database data is replicated with eventual consistency, the method performed by a computing system comprising one or more processors and storage media, the method comprising:

obtaining, by a server engine, a request to read particular data, the server engine comprising a primary database system and a secondary database system, the primary database system comprising a primary database, the secondary database system comprising a secondary database;

lingering, by the server engine, the read request until either (a) the secondary database is in a consistent replication state with respect to the primary database or (b) an expiration of a timer;

wherein the particular data is replicated with eventual consistency from the primary database to the secondary database in conjunction with or prior to the secondary database reaching the consistent replication state;

before the expiration of the timer, detecting, by the server engine, that the secondary database reaches the consistent replication state; and

causing, by the server engine, the read request to be executed against the secondary database.

2. The method of claim 1 , wherein the lingering the read request is based on:

obtaining a current global transaction identifier from the primary database system that operates on the primary database;

obtaining a current global transaction identifier from the secondary database system that operates on the secondary database; and

causing the read request to be executed against the secondary database only if the current global transaction identifier obtained from the secondary database is not less than the current global transaction identifier obtained from the primary database system.

3. The method of claim 2 , wherein the lingering the read request is further based on:

after the read request is successfully executed against the secondary database, reobtaining a current global transaction identifier from the secondary database system;

reobtaining a current global transaction identifier from the primary database system; and

returning from the read request to a client only if the current global transaction identifier reobtained from the primary database system exceeds the current global transaction identifier reobtained from the secondary database system.

4. The method of claim 1 , wherein the lingering the read request is based on:

obtaining a unique identifier of a data object that is a subject of the read request;

using the unique identifier to obtain a current version identifier for the data object from the primary database;

obtaining a current version identifier for the data object from the secondary database; and

causing the read request to be executed against the secondary database only if the current version identifier for the data object obtained from the secondary database is not less than the current version identifier for the data object obtained from the primary database.

5. The method of claim 1 , wherein the lingering the read request is based on:

incrementing a logical clock in the primary database;

obtaining a value of the logical clock in the primary database after the incrementing;

obtaining a value of the logical clock in the secondary database; and

causing the read request to be executed against the secondary database only if the value of the value obtained of the logical clock in the secondary database is not less than the value obtained of the logical clock in the primary database.

6. The method of claim 1 , wherein the causing the read request to be executed against the secondary database is based on causing the secondary database system that operates on the secondary database to execute one or more database commands against the secondary database.

7. One or more non-transitory storage media storing one or more programs for providing a linearizable primary-secondary database system to a client even though database data is replicated with eventual consistency the one or more programs comprising instructions which, when executed by a computing system having one or more processors, causes the computing system to perform:

obtaining, by a server engine, a request to read particular data, the server engine comprising a primary database system and a secondary database system, the primary database system comprising a primary database, the secondary database system comprising a secondary database;

lingering, by the server engine, the read request until either (a) the secondary database is in a consistent replication state with respect to the primary database or (b) an expiration of a timer;

wherein the particular data is replicated with eventual consistency from the primary database to the secondary database in conjunction with or prior to the secondary database reaching the consistent replication state;

before the expiration of the timer, detecting, by the server engine, that the secondary database reaches the consistent replication state; and

causing, by the server engine, the read request to be executed against the secondary database.

8. The one or more non-transitory storage media of claim 7 , wherein the lingering the read request is based on:

obtaining a current global transaction identifier from the primary database system that operates on the primary database;

obtaining a current global transaction identifier from the secondary database system that operates on the secondary database; and

causing the read request to be executed against the secondary database only if the current global transaction identifier obtained from the secondary database is not less than the current global transaction identifier obtained from the primary database system.

9. The one or more non-transitory storage media of claim 8 , wherein the lingering the read request is further based on:

after the read request is successfully executed against the secondary database, reobtaining a current global transaction identifier from the secondary database system;

reobtaining a current global transaction identifier from the primary database system; and returning from the read request to a client only if the current global transaction identifier reobtained from the primary database system exceeds the current global transaction identifier reobtained from the secondary database system.

10. The one or more non-transitory storage media of claim 7 , wherein the lingering the read request is based on:

obtaining a unique identifier of a data object that is a subject of the read request;

using the unique identifier to obtain a current version identifier for the data object from the primary database;

obtaining a current version identifier for the data object from the secondary database; and

causing the read request to be executed against the secondary database only if the current version identifier for the data object obtained from the secondary database is not less than the current version identifier for the data object obtained from the primary database.

11. The one or more non-transitory storage media of claim 7 , wherein the lingering the read request is based on:

incrementing a logical clock in the primary database;

obtaining a value of the logical clock in the primary database after the incrementing;

obtaining a value of the logical clock in the secondary database; and

causing the read request to be executed against the secondary database only if the value of the value obtained of the logical clock in the secondary database is not less than the value obtained of the logical clock in the primary database.

12. The one or more non-transitory storage media of claim 7 , wherein the causing the read request to be executed against the secondary database is based on causing the secondary database system that operates on the secondary database to execute one or more database commands against the secondary database.

13. A computing system comprising:

one or more processors;

storage media;

one or more programs stored in the storage media, the one or more programs comprising instructions which, when executed by the computing system, causes the computing system to perform:

obtaining, by a server engine, a request to read particular data, the server engine comprising a primary database system and a secondary database system, the primary database system comprising a primary database, the secondary database system comprising a secondary database;

lingering, by the server engine, the read request until either (a) the secondary database is in a consistent replication state with respect to the primary database or (b) an expiration of a timer;

wherein the particular data is replicated with eventual consistency from the primary database to the secondary database in conjunction with or prior to the secondary database reaching the consistent replication state;

before the expiration of the timer, detecting, by the server engine, that the secondary database reaches the consistent replication state; and

causing, by the server engine, the read request to be executed against the secondary database.

14. The computing system of claim 13 , wherein the lingering the read request is based on:

obtaining a current global transaction identifier from the primary database system that operates on the primary database;

obtaining a current global transaction identifier from the secondary database system that operates on the secondary database; and

causing the read request to be executed against the secondary database only if the current global transaction identifier obtained from the secondary database is not less than the current global transaction identifier obtained from the primary database system.

15. The computing system of claim 14 , wherein the lingering the read request is further based on:

after the read request is successfully executed against the secondary database, reobtaining a current global transaction identifier from the secondary database system;

reobtaining a current global transaction identifier from the primary database system; and

returning from the read request to a client only if the current global transaction identifier reobtained from the primary database system exceeds the current global transaction identifier reobtained from the secondary database system.

16. The computing system of claim 13 , wherein the lingering the read request is based on:

obtaining a unique identifier of a data object that is a subject of the read request;

using the unique identifier to obtain a current version identifier for the data object from the primary database;

obtaining a current version identifier for the data object from the secondary database; and

causing the read request to be executed against the secondary database only if the current version identifier for the data object obtained from the secondary database is not less than the current version identifier for the data object obtained from the primary database.

17. The method of claim 1 , further comprising:

prior to obtaining the read request, obtaining, by the server engine, a request to write the particular data; and

causing the request to write the particular data to be executed against primary database.

18. The method of claim 17 , wherein the write request is sent from the client; and wherein the read request is sent from the client.

19. The one or more non-transitory storage media of claim 7 , wherein the one or more programs further comprise instructions which, when executed by the computing system, causes the computing system to perform:

prior to obtaining the read request, obtaining, by the server engine, a request to write the particular data; and

causing the request to write the particular data to be executed against primary database.

20. The computing system of claim 13 , wherein the one or more programs further comprise instructions which, when executed by the computing system, causes the computing system to perform:

prior to obtaining the read request, obtaining, by the server engine, a request to write the particular data; and

causing the request to write the particular data to be executed against primary database.

Assignments (4)
RELEASE OF SECURITY INTEREST Recorded Dec 13, 2024
From: JPMORGAN CHASE BANK, N.A., AS COLLATERAL AGENT
To: DROPBOX, INC.
Reel/Frame 069635/0332 →
SECURITY INTEREST Recorded Dec 12, 2024
From: DROPBOX, INC.
To: WILMINGTON TRUST, NATIONAL ASSOCIATION, AS COLLATERAL AGENT
Reel/Frame 069604/0611 →
PATENT SECURITY AGREEMENT Recorded Mar 10, 2021
From: DROPBOX, INC.
To: JPMORGAN CHASE BANK, N.A., AS COLLATERAL AGENT
Reel/Frame 055670/0219 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Jan 8, 2018
From: TAHARA, DANIEL; BAID, MEHANT; ESCRIVA, ROBERT; GIURGEA, MIHNEA CEZAR
To: DROPBOX, INC.
Reel/Frame 044563/0768 →