IP Library Granted Patent US 11,816,073
Granted Patent B1
US 11,816,073 · App. 16/870,825 · Granted Nov 14, 2023

Asynchronously forwarding database commands

Inventors: Dhruva Ranjan Chakrabarti (San Jose, CA); Atrayee Mullick (Cupertino, CA); Suhas Keshavamurthy (Sunnyvale, CA); Alexandre Olegovich Verbitski (Woodinville, WA); Saraswathy Narayan (Fremont, CA); Yingjie He (Cupertino, CA)
Assignee: Amazon Technologies, Inc.
G06F16/184G06F9/3009G06F9/542G06F16/168G06F16/1865
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 11,816,073
App. No.
16/870,825
Granted
Nov 14, 2023
Kind
B1
Abstract

Database commands may be asynchronously forwarded between nodes of a database system. A read-only node may receive a request, such as a read request or write request, and determine that the request should be forwarded to a read-only node for performance. A thread that handles the request may forward the request to the read-only node and register a call-back event for a response to the request and be made available to perform other work. When the response from the read-write node is received, the call-back event may be triggered and return a response to the request using the same or different thread.

Claims (68)

1. A system, comprising:

a plurality of nodes, respectively comprising at least one processor and a memory, that implement a database system;

wherein one of the plurality of nodes implements a read-only node for the database system and another one of the plurality of nodes implements a read-write node for the database system that is a single writer to shared storage for the database system, and wherein the shared storage is accessible to both the read-only node and read-write node and hosted separately from both the read-only node and read-write node;

wherein the read-only node is configured to:

service, by a thread at the read-only node assigned from a thread pool comprising a plurality of threads for performing tasks at the read-only node, a write request received via a first session established between a first client of the database system and the read-only node that supports both read and write requests;

determine, by the thread, that the write request should be sent to the read-write node to be performed;

send, by the thread, the write request to be performed at the read-write node for the database via a second session established between the read-only node and the read-write node;

register, by the thread, a call-back event for a response received from the read-write node for the sent write request;

after registration of the call-back event;

return the thread to the thread pool to be available to perform another task;

receive a second request via a third session established between the read-only node and a second client;

assign the thread from the pool to the second request and service, by the thread, the second request;

receive the response from the read-write node via the second session for the sent write request that triggers the call-back event;

after detection of the call-back event, return, by the thread or another thread assigned from the thread pool at the read-only node, a result to the client via the first session for the write request based on the response received from the read-write node.

2. The system of claim 1 , wherein the read-write node is configured to:

receive the write request;

initiate a request to a database storage system to perform the write request;

register a call-back event for a response received from the request to the database storage system;

make the thread at the read-write node available to service another request received at the read-write node;

detect the call-back event for the request triggered by the response from the database storage system; and

return by the thread at the read-write node or another thread at the read-write node, a response to the write request based on the response from the database storage system.

3. The system of claim 1 , wherein the write request is a statement of a transaction begun at the read-only node.

4. The system of claim 1 , wherein the database system is hosted as part of a database service offered by a provider network, and wherein database request forwarding is enabled for the database system responsive to a request received via an interface for the database service to enable database request forwarding.

5. A method, comprising:

servicing, by a thread at a read-only node for a database, a first request received via a first session established between a first client of the database and the read-only node that supports both read and write requests, wherein the thread is assigned from a thread pool comprising a plurality of threads for performing tasks at the read-only node;

forwarding, by the thread, the first request to be performed at a read-write node for the database via a second session established between the read-only node and the read-write node, wherein the read-write node is a single writer to shared storage for the database, and wherein the shared storage is accessible to both the read-only node and read-write node and hosted separately from both the read-only node and read-write node;

registering, by the thread, a call-back event for a response received from the read-write node for the forwarded request;

after registering the call-back event;

returning the thread to the thread pool available to service another received request;

receiving a second request via a third session established between the read-only node and a second client;

assigning the thread from the pool to the second request and servicing, by the thread, the second request; and

after detecting the call-back event triggered by the response received from the read-write node via the second session for the forwarded request, providing, by the thread or another thread assigned from the thread pool at the read-only node, a result to the client for the first request via the first session based on the response received from the read-write node.

6. The method of claim 5 , further comprising:

receiving, at the read-write node, the forwarded first request;

initiating by a thread at the read-write node, a request to a database storage system to perform the forwarded first request;

registering, by the thread at the read-write node, a call-back event for a response received from the first request to the database storage system;

making the thread at the read-write node available to service another request received at the read-write node;

detecting the call-back event for the forwarded first request triggered by the response from the database storage system; and

returning by the thread at the read-write node or another thread at the read-write node, a response to the forwarded first request based on the response from the database storage system.

7. The method of claim 6 , wherein the request to the database storage system is a network request to a separate storage service.

8. The method of claim 6 , wherein the thread at the read-write node services a further request received from another read-only node before the call-back event for the request is detected at the read-write node.

9. The method of claim 5 , wherein the first request is a write request.

10. The method of claim 5 , further comprising servicing, by the thread, a third request received via the first session before detecting the call-back event.

11. The method of claim 5 , wherein the first request is a statement of a transaction begun at the read-only node.

12. The method of claim 5 , wherein the first request is a read request.

13. The method of claim 5 , wherein the database is hosted as part of a database service offered by a provider network, and wherein database request forwarding is enabled for the database responsive to a request received via an interface for the database service to enable database request forwarding.

14. One or more non-transitory, computer-readable storage media, storing program instructions that when executed on or across one or more computing devices cause the one or more computing devices to implement:

servicing, by a thread at a read-only node for a database, a first request received via a first session established between a first client of the database and the read-only node that supports both read and write requests, wherein the thread is assigned from a thread pool comprising a plurality of threads for performing tasks at the read-only node;

determining, by the thread, that the first request should be sent to a read-write node for the database to be performed, wherein the read-write node is a single writer to shared storage for the database, and wherein the shared storage is accessible to both the read-only node and read-write node and hosted separately from both the read-only node and read-write node;

sending, by the thread, the first request to be performed at the read-write node for the database via a second session established between the read- only node and the read-write node;

registering, by the thread, a call-back event for a response received from the read-write node for the sent first request;

after registering the call-back event;

returning the thread to the thread pool available to service another received request;

receiving a second request via a third session established between the read-only node and a second client;

assigning the thread from the pool to the second request and servicing, by the thread, the second request; and

after detecting the call-back event triggered by the response received from the read-write node via the second session for the sent first request, providing, by the thread or another thread assigned from the thread pool at the read-only node, a result to the client for the first request via the first session based on the response received from the read-write node.

15. The one or more non-transitory, computer-readable storage media of claim 14 , storing further instructions that when executed by the one or more computing devices cause the one or more computing devices to further implement:

receiving, at the read-write node, the forwarded database request;

initiating by a thread at the read-write node, a request to a database storage system to perform the forwarded request;

registering, by the thread at the read-write node, a call-back event for a response received from the request to the database storage system;

making the thread at the read-write node available to service another request received at the read-write node;

detecting the call-back event for the forwarded request triggered by the response from the database storage system; and

returning by the thread at the read-write node or another thread at the read-write node, a response to the forwarded request based on the response from the database storage system.

16. The one or more non-transitory, computer-readable storage media of claim 15 , wherein the thread at the read-write node services a further request received from a client of the read-only node before the call-back event for the request is detected at the read-write node.

17. The one or more non-transitory, computer-readable storage media of claim 15 , wherein the request to the database storage system is a network request to a separate storage service.

18. The one or more non-transitory, computer-readable storage media of claim 14 , wherein the first request is a read statement or a write statement of a transaction begun at the read-only node.

19. The one or more non-transitory, computer-readable storage media of claim 14 , wherein the first request is a read request.

20. The one or more non-transitory, computer-readable storage media of claim 14 , wherein the database is hosted as part of a database service offered by a provider network, and wherein database request forwarding is enabled for the database responsive to a request received via an interface for the database service to enable database request forwarding.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 24, 2023
From: CHAKRABARTI, DHRUVA RANJAN; MULLICK, ATRAYEE; KESHAVAMURTHY, SUHAS; VERBITSKI, ALEXANDRE OLEGOVICH; NARAYAN, SARASWATHY; HE, YINGJIE
To: AMAZON TECHNOLOGIES, INC.
Reel/Frame 063098/0427 →
Cited By (2)
US 12,561,311 US 12,675,501