IP Library Granted Patent US 12688150
Granted Patent B2
US 12688150 · App. 18/636,109 · Granted Jul 21, 2026

Techniques for deterministically routing database requests to database servers

Inventors: Zhongren Xu (Sunnyvale, CA); Hung V. Tran (Union City, CA); Quan D. Nguyen (Santa Clara, CA); Simon J. Gornall (San Jose, CA); Hering S. Cheng (South San Francisco, CA)
Assignee: Apple Inc.
G06F16/13G06F16/137G06F16/164G06F16/1774G06F16/182G06F21/602G06F21/6218G06F2221/2107
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 12688150
App. No.
18/636,109
Granted
Jul 21, 2026
Kind
B2
Abstract

The embodiments set forth techniques for managing database files for a plurality of users. In particular, a database server can perform the steps of (1) receiving, from a routing server, a request to perform an input/output (I/O) operation to a database file, (2) identifying a storage server through which the database file can be accessed, (3) interfacing with the storage server to obtain an exclusive lock on the database file, and (4) in response to determining that the exclusive lock is obtained: (i) writing, to metadata associated with the database file, information associated with the database server, and (ii) performing the I/O operation to the database file.

Claims (80)

1 . A method for managing database files for a plurality of users, the method comprising:

receiving, at a database server, from a routing server, a request to perform an input/output (I/O) operation to a database file stored on a storage server;

identifying, using the database server, the storage server;

interfacing, by the database server, with the storage server to obtain an exclusive lock on the database file; and

in response to determining that the exclusive lock is obtained:

writing, by the database server to metadata in the database file, information associated with the database server, the information including an indication that the database server has obtained the exclusive lock on the database file, a name of the database server, and an IP address of the database server;

writing, by the database server, information about the I/O operation into journal information associated with the database file before the I/O operation is applied to the database file; and

performing, by the database server, the I/O operation to the database file; and

wherein, in response to determining that the exclusive lock is not obtained, providing the information to the routing server to cause the routing server to provide the I/O request to a different database server.

2 . The method of claim 1 , further comprising:

prior to identifying the storage server, determining that the database file is not locally cached at the database server; and

subsequent to obtaining the exclusive lock on the database file:

caching the database file at the database server.

3 . The method of claim 1 , further comprising, subsequent to performing the I/O operation to the database file:

providing, to the routing server, a response in accordance with the I/O operation.

4 . The method of claim 3 , wherein the response includes:

data associated with a read operation performed against the database file, and/or

at least one indication of a successful or successful write operation performed against the database file.

5 . The method of claim 1 , further comprising, subsequent to obtaining the exclusive lock on the database file:

detecting a condition under which the exclusive lock on the database file is no longer needed; and

interfacing with the storage server to release the exclusive lock on the database file.

6 . The method of claim 1 , further comprising, in response to determining that the exclusive lock is not obtained:

obtaining, from the metadata associated with the database file, information associated with a different database server that purportedly holds the exclusive lock to the database file; and

providing the information to the routing server to cause the routing server to provide the request to the different database server.

7 . The method of claim 1 , further comprising:

detecting a condition under which the database server will be going offline; and

providing an indication of the condition to the routing server.

8 . A non-transitory computer readable storage medium configured to store instructions that, when executed by at least one processor included in a database server, cause the database server to manage database files for a plurality of users, by carrying out operations that include:

receiving, at the database server, from a routing server, a request to perform an input/output (I/O) operation to a database file stored on a storage server;

identifying, by the database server, the storage server;

interfacing the database server with the storage server to obtain an exclusive lock on the database file; and

in response to determining that the exclusive lock is obtained:

writing by the database server, to metadata in the database file, information associated with the database server, the information including an indication that the database server has obtained the exclusive lock on the database file, a name of the database server, and an IP address of the database server;

writing, by the database server, information about the I/O operation into journal information associated with the database file before the I/O operation is applied to the database file; and

performing the I/O operation to the database file; and

wherein, in response to determining that the exclusive lock is not obtained, providing the information to the routing server to cause the routing server to provide the I/O request to a different database server.

9 . The non-transitory computer readable storage medium of claim 8 , wherein the operations further include:

prior to identifying the storage server, determining that the database file is not locally cached at the database server; and

subsequent to obtaining the exclusive lock on the database file:

caching the database file at the database server.

10 . The non-transitory computer readable storage medium of claim 8 , wherein the operations further include, subsequent to performing the I/O operation to the database file:

providing, to the routing server, a response in accordance with the I/O operation.

11 . The non-transitory computer readable storage medium of claim 10 , wherein the response includes:

data associated with a read operation performed against the database file, and/or

at least one indication of a successful or successful write operation performed against the database file.

12 . The non-transitory computer readable storage medium of claim 8 , wherein the operations further include, subsequent to obtaining the exclusive lock on the database file:

detecting a condition under which the exclusive lock on the database file is no longer needed; and

interfacing with the storage server to release the exclusive lock on the database file.

13 . The non-transitory computer readable storage medium of claim 8 , wherein the operations further include, in response to determining that the exclusive lock is not obtained:

obtaining, from the metadata associated with the database file, information associated with a different database server that purportedly holds the exclusive lock to the database file; and

providing the information to the routing server to cause the routing server to provide the request to the different database server.

14 . The non-transitory computer readable storage medium of claim 8 , wherein the operations further include:

detecting a condition under which the database server will be going offline; and

providing an indication of the condition to the routing server.

15 . A database server configured to manage database files for a plurality of users, the database server comprising:

at least one processor; and

at least one memory storing instructions that, when executed by the at least one processor, cause the database server to carry out operations that include:

receiving, from a routing server, a request to perform an input/output (I/O) operation to a database file;

identifying a storage server on which the database file is stored;

interfacing with the storage server to obtain an exclusive lock on the database file; and

in response to determining that the exclusive lock is obtained:

writing, to metadata in the database file, information associated with the database server, the information including an indication that the database server has obtained the exclusive lock on the database file, a name of the database server, and an IP address of the database server;

writing, by the database server, information about the I/O operation into journal information associated with the database file before the I/O operation is applied to the database file; and

performing the I/O operation to the database file; and

wherein, in response to determining that the exclusive lock is not obtained, providing the information to the routing server to cause the routing server to provide the I/O request to a different database server.

16 . The database server of claim 15 , wherein the operations further include:

prior to identifying the storage server, determining that the database file is not locally cached at the database server; and

subsequent to obtaining the exclusive lock on the database file:

caching the database file at the database server.

17 . The database server of claim 15 , wherein the operations further include, subsequent to performing the I/O operation to the database file:

providing, to the routing server, a response in accordance with the I/O operation.

18 . The database server of claim 17 , wherein the response includes:

data associated with a read operation performed against the database file, and/or

at least one indication of a successful or successful write operation performed against the database file.

19 . The database server of claim 15 , wherein the operations further include, subsequent to obtaining the exclusive lock on the database file:

detecting a condition under which the exclusive lock on the database file is no longer needed; and

interfacing with the storage server to release the exclusive lock on the database file.

20 . The database server of claim 15 , wherein the operations further include, in response to determining that the exclusive lock is not obtained:

obtaining, from the metadata associated with the database file, information associated with a different database server that purportedly holds the exclusive lock to the database file; and

providing the information to the routing server to cause the routing server to provide the request to the different database server.