Systems and methods for durable database operations in a memory-mapped environment
Abstract
A durable memory-mapped database system includes a first memory-mapped view of a database, a second memory-mapped view of the database, a journal buffer and a journal. The first memory-mapped view of the database is a protected view and includes copies of a plurality of datafiles from the database. The second memory-mapped view of the database is a write view and includes copies of the plurality of datafiles. The journal buffer is a buffer in random access memory configured to record datafile updates. The journal is configured to periodically receive recorded datafile updates from the journal buffer.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1 . A database system, the system comprising:
a first memory-mapped instance of a database instantiated in an operating system memory space, the first memory-mapped instance including a plurality of datafiles from the database, wherein the first memory-mapped instance is instantiated as a protected instance configured to protect the first memory-mapped instance from at least one management operation of the operating system and update the plurality of datafiles responsive to client write requests; a second memory-mapped database instance instantiated in the operating system memory space, the second memory-mapped database instance including at least copies of the plurality of datafiles, wherein the second memory-mapped instance is a writable instance configured to modify the copies of the plurality of datafiles updated on the first memory-mapped instance by the client write requests responsive to write requests being written to a journal file; a journal buffer in random access memory configured to record datafile updates written to the first memory-mapped database instance, including write operations received from clients on the plurality of datafiles; the journal file configured to receive datafile updates from the journal buffer; and a memory manager configured to trigger updates to the copies of the plurality of datafiles in the second memory-mapped database instance reflecting the updates written to the first memory-mapped database instance responsive to the journal saving the datafile updates.
2 . The system of claim 1 , further comprising a write intent file configured to record at least one updated file location corresponding to at least one of the datafile updates.
3 . The system of claim 1 , wherein the first memory-mapped instance is a copy-on-writable instance.
4 . The system of claim 1 , wherein the first and second memory-mapped instances are instantiated in a file system cache.
5 . The system of claim 1 , wherein the journal is stored in a page cache.
6 . The system of claim 1 , wherein the memory manager is further configured to periodically trigger copying from the journal buffer to the journal file.
7 . The system of claim 6 , wherein the memory manager is further configured to periodically trigger copying of a portion of the journal buffer to the journal file.
8 . The system of claim 1 , wherein the memory manager is further configured to acknowledge a write operation responsive to copying the write operations from the journal buffer to the journal file.
9 . A computer-implemented method for creating durability in a memory-mapped database system, comprising:
instantiating, in an operating system managed memory space of a computer system, a first memory-mapped instance of a database including a plurality of datafiles from the database, wherein the first memory-mapped instance is a protected instance configured to protect the first memory-mapped instance from at least one management operation of the operating system; instantiating, on the computer system, a second memory-mapped instance of the database in the operating system managed memory space, wherein the second memory-mapped instance is a writable instance configured to modify copies of the plurality of datafiles updated on the first memory-mapped instance by client write requests responsive to the write requests being written to a journal file and synchronize the memory-mapped plurality of datafiles to disk; recording a plurality of datafile updates to the first memory-mapped instance; capturing the plurality of datafile updates from the first memory-mapped instance in a journal buffer in random access memory; and writing, after a first time interval, at least one of the plurality of datafile updates in the journal buffer to a journal.
10 . The computer-implemented method of claim 9 , further comprising recording a plurality of write intents indicating at least one updated file location corresponding to the plurality of datafile updates.
11 . The computer-implemented method of claim 9 , further comprising:
recording the at least one datafile update to the second memory-mapped instance from the first memory-mapped instance; and updating the database with the at least one datafile update to the second memory-mapped instance.
12 . The computer-implemented method of claim 9 , wherein the plurality of datafile updates comprise datafile updates to a single datafile, and writing at least one of the plurality of datafile updates to the journal comprises writing the single datafile to the journal.
13 . The computer-implemented method of claim 9 , wherein the first memory-mapped instance of the database is a readable instance.
14 . The computer-implemented method of claim 9 , wherein the second memory-mapped instance of the database is a write-only instance.
15 . The computer-implemented method of claim 9 , wherein the first memory-mapped instance of the database includes a portion of datafiles in the database, and further comprising updating the datafiles included in the first memory-mapped instance of the database.
16 . The computer-implemented method of claim 9 , wherein the second memory-mapped instance of the database includes a portion of datafiles in the database, and further comprising updating the datafiles included in the second memory-mapped instance of the database.
17 . The computer-implemented method of claim 9 , wherein recording a plurality of datafile updates to the first memory-mapped instance comprises recording the plurality of datafile updates in random access memory.
18 . The computer-implemented method of claim 17 , further comprising remapping the first memory-mapped instance to include the plurality of datafile updates in random access memory.
19 . The computer-implemented method of claim 1 , further comprising providing an acknowledgement after writing at least one of the plurality of datafile updates to the journal.
20 . The computer-implemented method of claim 1 , wherein the journal is copied to physical storage.Join the waitlist — get patent alerts
Track US2015193463A1 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.