Asynchronous database storage operations
A database system performs a data definition operation comprising at least a first sub-operation performed synchronously and a second sub-operation performed asynchronously. The synchronous sub-operation comprises modification of a database structure, and the asynchronous sub-operation comprises configuration of storage associated with the database structure. A response to the data definition operation is provided synchronously after the synchronous sub-operation is completed, without waiting for completion of the asynchronous sub-operation.
1 . A system, comprising:
one or more processors;
memory to store computer-executable instructions that, in response to execution by the one or more processors, cause the one or more processors to:
receive a request to perform a data definition operation to be performed using a synchronous sub-operation and an asynchronous sub-operation on a database;
perform the synchronous sub-operation of the data definition operation, the synchronous sub-operation comprising configuration of a database structure indicated by the data definition operation;
provide a first indication that the synchronous sub-operation has completed successfully and that one or more operations associated with the database structure can be performed irrespective of completion of the asynchronous sub-operation of the data definition operation;
perform the asynchronous sub-operation of the data definition operation, the asynchronous sub-operation comprising configuration of storage associated with the database structure, the configuration made in accordance with instructions of the data definition operation; and
provide a second indication that the asynchronous sub-operation of the data definition operation has completed.
2 . The system of claim 1 , wherein the data definition operation comprises at least one of creating, modifying, or deleting the database structure.
3 . The system of claim 1 , wherein the configuration of storage comprises adjusting an amount of storage reserved for storing data associated with the database structure.
4 . The system of claim 1 , wherein the synchronous sub-operation is performed by a database engine, and wherein the database engine causes a storage engine to perform the asynchronous sub-operation.
5 . The system of claim 1 , wherein the configuration of the database structure comprises storing schema information comprising a definition of the database structure.
6 . A computer-implemented method, comprising:
receiving a request to perform a data definition operation to comprise a synchronous sub-operation and an asynchronous sub-operation on a database;
performing the synchronous sub-operation comprising configuring a database structure indicated by the data definition operation;
providing an indication that the synchronous sub-operation has completed and that one or more operations associated with the database structure can be performed; and
performing the asynchronous sub-operation comprising configuring storage associated with the database structure, wherein the configuration of the storage is in accordance with the data definition operation.
7 . The method of claim 6 , wherein the request comprises a data definition language statement indicative of least one of creating, modifying, or deleting the database structure.
8 . The method of claim 6 , wherein the synchronous sub-operation comprises updating a database schema in accordance with the data definition operation.
9 . The method of claim 6 , wherein the indication that the synchronous sub-operation has completed successfully indicates that the database structure is usable by a client.
10 . The method of claim 6 , wherein the configuration of the storage comprises at least one of increasing or decreasing an amount of storage reserved for the database structure.
11 . The method of claim 6 , wherein the synchronous sub-operation is performed by a database engine, and wherein the database engine requests that a storage engine perform the asynchronous sub-operation.
12 . The method of claim 6 , wherein the asynchronous sub-operation comprises interaction with one or more services remote to the database.
13 . The method of claim 6 , wherein the synchronous sub-operation configures a first portion of storage associated with the database structure and the asynchronous sub-operation configures a second portion of the storage associated with the database structure.
14 . A non-transitory computer-readable storage medium storing thereon executable instructions that, as a result of being executed by one or more processors of a computer system, cause the computer system to at least:
receive a request to perform a data definition operation comprising a synchronous sub-operation on a database and an asynchronous sub-operation on the database;
perform the synchronous sub-operation comprising configuration of a database structure whose configuration is indicated by the data definition operation;
provide an indication that the synchronous sub-operation has completed, the indication indicating and that the database structure can be used to perform operations; and
perform the asynchronous sub-operation comprising configuration of storage associated with the database structure, the configuration in accordance with instructions indicated by the data definition operation.
15 . The non-transitory computer-readable storage medium of claim 14 , wherein the configuration of the database structure comprises updating a data dictionary in accordance with the data definition operation.
16 . The non-transitory computer-readable storage medium of claim 14 , wherein the instructions further comprise instructions that, as a result of being executed by the one or more processors, cause the computer system to:
indicate that the database structure is usable prior to completion of the asynchronous sub-operation.
17 . The non-transitory computer-readable storage medium of claim 14 , wherein the configuration of storage comprises adjusting an amount storage reserved for storing data associated with the database structure.
18 . The non-transitory computer-readable storage medium of claim 14 , wherein the synchronous sub-operation is performed by a database engine and the asynchronous operation is performed by a storage engine.
19 . The non-transitory computer-readable storage medium of claim 14 , wherein the instructions further comprise instructions that, as a result of being executed by the one or more processors, cause the computer system to:
determine a first set of sub-operations to perform synchronously and a second set of sub-operations to perform asynchronously, wherein the first and second sets of sub-operations are determined based, at least in part, on at least one of latency of a sub-operation or risk associated with the sub-operation.
20 . The non-transitory computer-readable storage medium of claim 14 , wherein the instructions further comprise instructions that, as a result of being executed by the one or more processors, cause the computer system to:
complete a first portion of the configuration of storage as part of the synchronous sub-operation; and
complete a second portion of the configuration of storage as part of the asynchronous sub-operation.