Space-efficient bookkeeping for database applications
AssigneeOracle International Corporation
InventorsJames W. Stamos, Mukesh Jaiswal
Life of this patent
Estimating the term…
Abstract
A method is provided for space-efficient bookkeeping using bit-level locking. Each row of a bookkeeping table stores binary data comprising a plurality of bits. Each bit of the plurality of bits corresponds to a particular message and a particular consumer of the message, and indicates whether the particular message has been dequeued by the particular consumer. The bookkeeping table is stored on-disk and data corresponding to the bookkeeping table is stored in volatile memory. When a message is dequeued the in-memory bookkeeping data is updated, and the bookkeeping table is updated based on the in-memory bookkeeping data when the dequeue is committed.
Claims18
A method comprising:
- storing, in a database, a bookkeeping table associated with a plurality of messages in a queue;
- wherein:
- the bookkeeping table comprises a plurality of columns in a plurality of rows,
- each column of the plurality of columns in each row of the plurality of rows corresponds to a table cell that stores a respective sequence of bits, and
- each bit in the respective sequence of bits stores a dequeue status of a respective message in the plurality of messages;
- maintaining, in volatile memory, in-memory bookkeeping data corresponding to the bookkeeping table, wherein the in-memory bookkeeping data comprises a plurality of bits indicating dequeue statuses of the plurality of messages;
- dequeuing, from the queue, one or more messages of the plurality of messages in a dequeue session;
- in response to the dequeuing the one or more messages of the plurality of messages in the dequeue session, updating, in the in-memory bookkeeping data, one or more bits that store a dequeue status of each particular message of the one or more messages, wherein the updating locks the one or more bits on a bit-by-bit basis to allow for dequeue statuses of multiple messages being updated at approximately the same time;
- in response to the dequeue session committing the dequeuing the one or more messages of the plurality of messages, synchronizing the bookkeeping table with changes to the in-memory bookkeeping data, wherein each bit stored in the bookkeeping table that corresponds to a message dequeued by the dequeue session is updated to indicate that the messages has been dequeued.
One or more non-transitory computer-readable media storing instructions which, when executed by one or more hardware processors, cause:
- storing, in a database, a bookkeeping table associated with a plurality of messages in a queue;
- wherein:
- the bookkeeping table comprises a plurality of columns in a plurality of rows,
- each column of the plurality of columns in each row of the plurality of rows corresponds to a table cell that stores a respective sequence of bits, and
- each bit in the respective sequence of bits stores a dequeue status of a respective message in the plurality of messages;
- maintaining, in volatile memory, in-memory bookkeeping data corresponding to the bookkeeping table, wherein the in-memory bookkeeping data comprises a plurality of bits indicating dequeue statuses of the plurality of messages;
- dequeuing, from the queue, one or more messages of the plurality of messages in a dequeue session;
- in response to the dequeuing the one or more messages of the plurality of messages in the dequeue session, updating, in the in-memory bookkeeping data, one or more bits that store a dequeue status of each particular message of the one or more messages, wherein the updating locks the one or more bits on a bit-by-bit basis to allow for dequeue statuses of multiple messages being updated at approximately the same time;
- in response to the dequeue session committing the dequeuing the one or more messages of the plurality of messages, synchronizing the bookkeeping table with changes to the in-memory bookkeeping data, wherein each bit stored in the bookkeeping table that corresponds to a message dequeued by the dequeue session is updated to indicate that the messages has been dequeued.
Dependencies are inferred from the claim text.