RELATED APPLICATIONSThe present application is related to U.S. Patent Application entitled DATABASE WITH NVDIMM AS PERSISTENT STORAGE, filed by Nilesh Choudhury, et al., on the equal day herewith, having Ser. No. 15/720,959, the entire contents of which are incorporated herein by reference.
The present application is related to U.S. Patent Application entitled NV CACHE, filed by Zuoyu Tao, et al., on the equal day herewith, having Ser. No. 15/720,972, the entire contents of which are incorporated herein by reference.
The present application is related to U.S. Patent Application entitled Ser. No. 15/721,328 STORING DERIVED SUMMARIES ON PERSISTENT MEMORY OF A STORAGE DEVICE, filed by Krishnan Meiyyappan, et al., on the equal day herewith, having Ser. No. 15/721,328, the entire contents of which are incorporated herein by reference.
TECHNICAL FIELDThe present disclosure relates to database systems. More specifically, the disclosure relates to relational database organization for storing database data in shared storage.
BACKGROUNDA DBMS (Database Management System) is an important mechanism for storing and managing many types of data. A DBMS comprises at least one database server. The database server is hosted on at least one computing element (e.g. computer, server blade) and may store database data in block mode storage devices. The block mode storage devices may be one or more disk drives and flash drives connected via a high speed bus of the computing element to the one or more hardware processors (“processors”) of the computing element and/or memory of the computing element. A block mode storage device may also be a network enabled storage device that is connected via a network to the computing element and that comprises other block storage devices such as disk drives and flash drives.
More powerful DBMSs are hosted on a parallel processer hardware platform. Such DBMSs are referred to herein as multi-node DBMSs. A multi-node DBMS comprises multiple computing elements referred to herein as computing nodes. Each computing node comprises a hardware processor or multiple hardware processors that each share access to the same main memory. A multi-node DBMS may use one of several storage architectures to store database data.
One such architecture is referred to herein as the shared storage architecture. In the shared storage architecture, each computing node in a multi-node DBMS shares direct network access to one or more block storage devices that persistently store the database.
FIG. 1 is a block diagram that illustrates a shared storage multi-node DBMS. Referring toFIG. 1, shared storage multi-node DBMS100 comprises database server instances, each hosted on a respective computing node, each database server instance providing access to the same database stored on sharedstorage121. The database server instances of DBMS100 comprise database server instances103-1,103-2,103-3, and103-4, which are hosted on computing nodes102-1,102-2,102-3, and102-4, respectively. The sharedstorage121 comprises storage cells122-1 and122-2. Each of database server instances103-1,103-2,103-3, and103-4 is connected by ahigh speed network101 to each of storage cells122-1 and122-2.
Each of storage cells122-1 and122-2 is a computing node that includes persistent storage (e.g. disk, flash memory) that store “database files” of the one or more databases of DBMS100. Storage cell122-1 includes persistent storage129-1 and main memory124-1 and storage cell122-2 includes persistent storage129-2 and main memory124-2. One or more storage processes running on each of storage cells122-1 and122-2, such as storage process125-1 and storage process125-2, receive requests from any of database server instances103-1,103-2,103-3, and103-4 to read or write data blocks from or to database files stored in persistent storage. Storage cell buffer pool128-1 and storage cell buffer pool128-2 are buffers allocated from main memory124-1 and124-2, respectively. The term process, as used herein, refers to a computer system process, which is defined in the section Software Overview.
Database Server Instances
Each of the database server instances comprise database processes that run on the computing node that hosts the database server instance. A database process may be, without limitation, a process running within a database session that executes database commands issued within the database session or a query execution process belonging to a pool of processes that is assigned to execute queries issued through database sessions.
Referring toFIG. 1, each of database server instances103-1,103-2,103-3, and103-4 comprise multiple database processes and database buffers that cache data blocks read from sharedstorage121. Database server instances103-1,103-2,103-3, and103-4 are hosted on computing nodes102-1,102-2,102-3, and102-4, respectively. Database server instance103-1 comprises database processes105-1aand105-1b, which run on computing node102-1, and database buffer pool108-1, which is allocated from main memory104-1. Database server instance103-2 comprises database processes105-2aand105-2b, which run on computing node102-2, and database buffer pool108-2, which is allocated from main memory104-2. Database server instance103-3 comprises database processes105-3aand105-3b, which run on computing node102-3, and database buffer pool108-3, which is allocated from main memory104-3. Database server instance103-4 comprises database processes105-4aand105-4b, which run on computing node102-4, and database buffer pool108-4, which is allocated from main memory104-4.
Data Block Read Operation in Shared Storage Architecture
Any database server instance of DBMS100 may access a data block stored in any storage cell of sharedstorage121. To read a data block, a data block read operation is initiated by any database server instance of DBMS100. For example, database server instance103-1 initiates a data block read operation for a data block by transmitting a data block request for the data block vianetwork101 to storage cell122-1, which stores the data block in persistent storage129-1.
Before the data block is transmitted, the data block is first added to a storage cell buffer allocated from main memory in an operation referred to herein as read staging. Read staging entails retrieving a data block from persistent storage and writing the data block to random access memory (“RAM”, e.g. non-volatile RAM memory) from where the data block is transmitted to the requester of the data block. Storage cell122-1 retrieves the data block from persistent storage129-1 and stores the data block in a buffer of storage cell buffer pool128-1. From the buffer, the data block is transmitted to a buffer in database buffer pool108-1. Similarly, database server instance103-2 initiates a read operation for a data block by transmitting a request vianetwork101 to storage cell122-1, which stores the data block in persistent storage129-1. Storage cell122-1 retrieves the data block from persistent storage129-1 and stores the data block in a buffer of storage cell buffer pool128-1. From the buffer, the data block is transmitted to a buffer in database buffer pool108-2.
Various Advantages and Disadvantages of Shared Storage
Advantages of the shared storage architecture include, inter alia, higher availability. If any computing node and database server instance goes down, the database may remain available through the remaining computing nodes and/or database server instances. In addition, because each database server instance services and exposes the same database, clients may access that data in the database as a single database while exploiting the power of parallel processing provided by multiple computing nodes.
A disadvantage is that speed of access to the database by the multiple database service instances depends on a common network connection and processing and memory capacity of storage cells to perform read staging. Described herein are approaches for improving database access under a shared storage architecture.
BRIEF DESCRIPTION OF THE DRAWINGSThe example embodiment(s) of the present invention are illustrated by way of example, and not in way by limitation, in the figures of the accompanying drawings and in which like reference numerals refer to similar elements and in which:
FIG. 1 illustrates a DBMS using a shared storage structure according to an embodiment of the present invention.
FIG. 2 illustrates a DBMS using a NVRAM-based shared storage structure according to an embodiment of the present invention.
FIG. 3 illustrates a data block read operation according to an embodiment of the present invention.
FIG. 4 illustrates primary and secondary storage locations for mirroring according to an embodiment of the present invention.
FIGS. 5A and 5B illustrate database files stored in interleaved and non-interleaved mode in NVRAM according to an embodiment of the present invention.
FIG. 6 illustrates servicing filtered data block requests in a NVRAM-based shared storage structure according to an embodiment of the present invention.
FIG. 7 illustrates a write staging buffer pool used for one-sided writing staging according to an embodiment of the present invention.
FIGS. 8A and 8B illustrate operations performed to write a data block using one-sided write staging according to an embodiment of the present invention.
FIG. 9 illustrates operations performed for performing a database block read operation when using one-sided write staging according to an embodiment of the present invention.
FIG. 10 illustrates a redo log, an example of an appending-only data structure stored in NVRAM according to an embodiment of the present invention.
FIG. 11 illustrates operations performed for a one-sided append-only write according to an embodiment of the present invention.
FIG. 12 illustrates a DBMS using a NVRAM-based shared storage structure where the primary storage for data blocks comprises NVRAM of storage cells according to an embodiment of the present invention.
FIG. 13 is a diagram of a computer system on which embodiments may be implemented.
FIG. 14 is a diagram of a software system that may be employed for controlling the operation of a computer system according to an embodiment of the present invention.
DESCRIPTION OF THE EXAMPLE EMBODIMENT(S)In the following description, for the purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the example embodiment(s) of the present invention. It will be apparent, however, that the example embodiment(s) may be practiced without these specific details.
General Overview
Described herein is a novel shared storage architecture that persistently stores database files in non-volatile random access memories (NVRAMs) of computing nodes of a multi-node DBMS. NVRAM may have higher latency than volatile RAM but less latency than other forms of persistent storage, such as disk or flash. Like volatile RAM, NVRAM is byte addressable; an addressable byte or word may be loaded from NVRAM via a bus to a register of the hardware processor.
The computing nodes not only collectively store database data on NVRAMs of the computing nodes, but also host database server instances that process queries in parallel, host database sessions and database processes, and together manage access to a database stored on the NVRAMs of the computing nodes. Such an architecture is referred to herein as a NVRAM shared storage architecture.
Under the NVRAM shared storage architecture, to perform a data block read operation from persistent storage, a data block may be transferred directly over a network between NVRAM of a computing node that persistently stores the data block to a database buffer in volatile RAM of another computing node that requests the data block. The transfer is accomplished using remote direct memory access (“RDMA). Thus, database data may be read from shared persistent storage without need for read staging at the computing node that persistently stores the database data in NVRAM. Persistently stored database data is read from NVRAM with less latency and without the need for read staging to use non-volatile memory and to incur processor overhead at a storage cell.
In addition to techniques for performing a data block read operation to NVRAM, also described herein are techniques for performing a data block write operation to data blocks stored in NVRAM of an NVRAM shared storage architecture. The techniques are referred to herein as a one-sided write because only one database process needs to participate in the writing of a data block to NVRAM in order to successfully commit the write.
Illustrative NVRAM Shared Storage DBMS
FIG. 2 is a block diagram that illustrates a NVRAM shared storage multi-node DBMS according to an embodiment of the present invention. Referring toFIG. 2,DBMS200 comprises database server instances, each hosted on a respective computing node, each database server instance providing access to a database stored on a shared storage comprising NVRAM from each computing node.DBMS200 comprises database server instances203-1,203-2,203-3, and203-4, which are hosted on computing nodes202-1,202-2,202-3, and202-4, respectively. Each of database server instances203-1,203-2,203-3, and203-4 is connected by ahigh speed network201 to each other.
Database server instances203-1 comprises database processes205-1 and other database processes not shown, which run on computing node202-1, and database buffer pool208-1, which is allocated from main memory204-1. Database server instance203-2 comprises database processes205-2 and other database processes not shown, which run on computing node202-2, and database buffer pool208-2, which is allocated from main memory204-2. Database server instance203-3 comprises database processes205-3 and other database processes not shown, which run on computing node202-3, and database buffer pool208-3, which is allocated from main memory204-3. Database server instance203-4 comprises database processes205-4 and other database processes not shown, which run on computing node202-4, and database buffer pool208-4, which is allocated from main memory204-4. Main memory204-1,204-2,204-3, and204-4 comprise volatile RAM.
Like inDBMS100, inDBMS200 database data is stored in database files in shared storage that is accessible by database server instances ofDBMS200 overnetwork201. However, inDBMS100, the database files are stored in block mode storage cells while inDBMS200, the database files may be stored across NVRAMs of computing nodes that each also hosts a database server instance. The NVRAM on a computing node is directly accessible to other database server instances running on other computing nodes via RDMA mechanisms ofnetwork201.
Referring again toFIG. 1, computing node202-1,202-2,202-3, and202-4 comprise NVRAM211-1,211-2,211-3, and211-4. In addition to including NVRAM, each computing node202-1,202-2,202-3, and202-4 may also include block mode persistent storage devices, such as flash memory or disk storage. Disk storage may be used to store shared database files in conjunction with storing the shared database files in NVRAM.
Storage Services
To initiate a data block read operation for a data block, a database process running within a database service instance needs to determine the home storage location (“home location”) of the data block within a storage device, such as the memory address of a storage location within a NVRAM or a disk offset on a particular disk. To make this determination, a DBMS maintains mapping data within a data dictionary that specifies which database files hold data blocks for which database tables, and uses a storage service that maps ranges (or offsets) within the database files to storage locations on specific storage devices. Each database server instance ofDBMS200 may store a copy of the mapping data within volatile RAM for quick access.
For example, a data block is stored on a disk in a storage cell. To determine the location of the data block stored at a particular database file offset, the database process uses the storage service to determine what disk on what storage cell stores the data block and what storage location (or offset) on the disk corresponds to the database file offset. An advantage of using a storage service that maps database files to storage devices in this way is that the storage arrangement of database files on and between storage devices may be altered and/or otherwise managed without having to redefine the database files that hold the data blocks of a table.
According to an embodiment, each computing node ofDBMS200 hosts a storage service. Referring toFIG. 2, computing node202-1 hosts storage service212-1. Storage service212-1 comprises one or more storage processes, such as storage process213-1, and a software layer referred to as a storage layer. A storage layer includes software and associated storage metadata that describes how database files are stored on various storage devices, such as disks and NVRAM. The storage layer software is executed by storage processes and/or by database processes. Storage processes monitor and manage storage of database files withinDBMS200 and under circumstances explained later, may service requests for data blocks stored in NVRAM local to the storage processes.
An important function of storage service212-1 is to provide a mapping between database files to a memory addresses on any NVRAMs ofDBMS200. Storage service212-1 may map a database file, or an offset within the database file, to a memory address range within any of NVRAM211-1,211-2,211-3, and211-4. To determine the NVRAM and memory address therein that corresponds to an offset within a database file, a database process invokes a function of storage layer206-1, passing in the identity of the database file and the offset; the function returns the particular NVRAM storing data for the offset and the memory address within the particular NVRAM at which the data is stored.
According to an embodiment, storage service212-1 treats ranges within a memory addresses space of NVRAMs as logical disks. Abstracting a memory address range of NVRAM as a disk facilitates use of NVRAM by storage services that are based on software that is configured to support storage of database files on physical disks. Storage of database files within logical disks in NVRAM may thus be managed in ways very similar to the way storage of database files on disks are managed.
To this end, storage metadata within storage service212-1 defines logical disks, and for each logical disk, maps the logical disk to a memory address range that corresponds to the logical disk drive within an address space of a particular NVRAM. A mapped NVRAM may be in any NVRAM inDBMS200. With respect to storage service212-1, storage metadata in storage layer206-1 defines logical disks214-1 within NVRAM211-1 and maps database files to memory address ranges of NVRAM211-1 that correspond to logical disks214-1. Storage metadata in storage layer206-1 defines logical disks214-2 within NVRAM211-2 and maps database files to memory address ranges of NVRAM211-2 that correspond to logical disks214-2. Storage metadata in storage layer206-2 defines logical disks214-3 within NVRAM211-3 and maps database files to memory address ranges of NVRAM211-3 that correspond to logical disks214-3. Storage metadata in storage layer206-4 defines logical disks214-4 within NVRAM211-4 and maps database files to memory address ranges of NVRAM211-4 that correspond to logical disks214-4.
Data Block Read Operation
Like disk and flash memory, NVRAM may have higher latency relative to volatile RAM. Thus, just as with disk-based DBMSs, data blocks stored in NVRAM are loaded into database buffers in volatile memory, where once loaded the data blocks are accessed and/or altered with greater speed by a database process. As mentioned previously, a database process initiates a data block read operation of a data block that loads the data block into a database buffer. The operations performed to load a data block from NVRAM to a database buffer depend on whether the data block is retrieved for a database process from local NVRAM or remote NVRAM.
FIG. 3 is a flow chart depicting operations performed for a data block read operation for a data block stored in NVRAM. The operations are illustrated using database process205-1 on computing node202-1. The operations are performed to retrieve data blocks during execution of a query to obtain data blocks required to compute the query.
Referring toFIG. 3, database process205-1 makes a request for the storage location that corresponds to a database file offset for a data block. Database process205-1 makes the request by invoking and executing a function of storage layer206-1. Database process205-1 determines that the database file and offset is mapped to a logical disk and offset, which is mapped to a “source” memory address of an NVRAM inDBMS200. The identity of the NVRAM and source memory address is returned by the function.
At304, a determination is made of whether the storage location is at a local NVRAM or remote NVRAM. For purposes of illustration, the database file and offset correspond to a source memory address within NVRAM211-1, which is local to database process205-1. Because the determination is that the storage location is for a local NVRAM, the execution proceeds to306.
At306, database process205-1 itself copies the data block from the particular memory address to a database buffer. According to an embodiment, this copying may involve a hardware processor, on which database process205-1 is running, copying bytes and/or words from NVRAM to a register of the hardware processor, and then from the register into main memory at the memory address that corresponds to the database buffer.
If in the current illustration, the storage location is instead at NVRAM211-2, then the determination at304 is that the storage location is at a remote NVRAM. Execution proceeds to314.
At314, database process205-1 issues a RDMA read request. In RDMA, the direct transfer of data occurs through a RDMA mechanism on each of the computing nodes. According to an embodiment, the RDMA mechanism comprises a network interface hardware controller that is RDMA capable (RNIC) on each of the computing nodes. A process running on a hardware processor of an “initiating” computing node may issue a RDMA read request to a “local” RNIC on the computing node to read data stored at a “remote” memory address in the “remote” RAM of a “remote” computing node and write the data to a “local” memory address at the “local” RAM on the initiating computing node. In response to receiving the RDMA read request, the local RNIC and a “remote” RNIC transfer data from the remote RAM to the local RAM. The remote RNIC reads data at the remote memory address, transmits the data over the network to the local RNIC, which writes the data to the local RAM at the local memory address. No hardware processor on the initiating computing node or remote computing node participates in reading the data from the remote RAM, transmitting the data over the network, and writing the data to the local RAM.
Once the transfer of the data is completed, the local RNIC signals that the transfer of the data has been completed. The process initiating the request or another process may then access the transferred data at the local memory address.
In the current, illustration, database process205-1 issues a RDMA read request for a data block stored at the source memory address at NVRAM211-2 to write the data block at the memory address for the database buffer.
At316, the database process may perform another task or other work and then, once notified of the completion of the transfer at318, process the data block. The manner above in which database process205-1 copies data using RDMA may be characterized as being performed asynchronously to the database process. While the data is being transferred using RDMA, the database process could perform work other than the work of transferring the data block between NVRAM and to a database buffer in volatile RAM, or the database process may be switched and so that another process can execute. When database process205-1 copies the data from NVRAM to a database buffer, the manner of copying is referred to herein as synchronous because the copying is being performed by the database process itself.
Switching out requires context switching. Such overhead includes storing the context of the process (registers) and determining the next process to execute and restoring that process's context. To avoid such overhead, the database process may spin, that is, not switch out and not perform another task asynchronously, but instead keep executing a simple set of instructions until being notified of the transfer of the data block at318. When RDMA reads are performed with low latency, the database process can complete the read operation with lower latency than under the asynchronous approach just described.
Finally, the data block read operation illustrated inFIG. 3 avoids operations that are performed in a storage cell based on the shared storage architecture illustrated inFIG. 1, even if RDMA is used to transfer data blocks between the storage cells and database buffers of a database server instance. Referring toFIG. 1, RDMA may be used to transfer data blocks between sharedstorage121 and database buffers in non-volatile RAM of a database server instance ofDBMS100. However, the RDMA transfer does not occur until after read staging at a storage cell to a storage cell buffer.
For example, to return a data block requested by database process105-2a, storage process125-1 performs read staging of a data block. After read staging, the storage process125-1 initiates a RDMA transfer to a memory address that was provided by database process105-2a. Alternatively, storage process125-1 returns the memory address of where the data block is staged in storage cell buffer pool128-1 to database process105-2a. Upon receipt of the memory address, database process initiates a RDMA transfer. According to an embodiment, any of the operations described in this paragraph are examples of operations that do not have to be performed in a data block read operation under a NVRAM shared storage architecture.
Preferring Local Reads in Mirrored Storage
Under data mirroring, a database file is stored redundantly in multiple storage locations. When a data block of a database file is written to persistent storage, the data block is written to the multiple storage locations that store copies of the database file. One storage location is referred to as a primary location because reads for the data blocks in the database file are primarily serviced from the primary location. The other storage locations are referred to as secondary locations. If the primary location goes offline or becomes otherwise unavailable, reads may be satisfied from one of the secondary locations.
In addition, while the primary location is offline, writes to the database file continue at the secondary storage location. When the primary storage location comes online, the primary storage location can be resynchronized with one of the secondary storage locations.
FIG. 4 depicts a data mirroring scheme for adatabase file410. As defined by storage mapping406-1 in storage layer206-1, the primary storage location fordatabase file410 isprimary storage location411 in NVRAM211-2 and the secondary storage location issecondary storage location412 in NVRAM211-1. Writes to database file410 are made to bothprimary storage location411 andsecondary storage location412. Reads ofdatabase file410 are primarily serviced fromprimary storage location411.
There are several reasons for primarily directing reads to a single primary storage location. Reads may be balanced across storage locations by balancing primary storage locations across storage locations. For storage cell based shared storage architectures, memory requirements for read staging is reduced. Read staging for a particular data block requires a buffer on one storage cell. If reads for a particular data block were distributed among multiple storage cells, read staging for the data block would occur across multiple storage cells, and multiple buffers would be used for read staging of the data block.
In a NVRAM shared storage architecture, a secondary storage location for a data block may be local to a process requesting the data block. In this case, the data block can be accessed and transferred to a database buffer far more efficiently and quickly than the data block can be transferred over a network via RDMA. In an embodiment of the present invention, to read a data block into a database buffer, a database process determines, based on a storage mapping of a storage service, whether a secondary location for the data block is at a NVRAM local to the database process, i.e. is on the computing node on which the database process runs. If the determination is that a secondary location is a local NVRAM, the database process retrieves the data block as described for operation306 (seeFIG. 3).
Non-Interleaved Memory for Higher Availability
Computing elements arrange memory devices in memory banks. In each bank, one word may be accessed at a time. However, each bank may be accessed concurrently, and thus words may be accessed concurrently when each word is in a separate bank. The number of words that can be accessed concurrently depends on the number memory banks. To enhance access to contiguous words (i.e. words that are stored at contiguous addresses within a memory address space), memory banks may be configured in an interleaved mode, in which contiguous words are stored in separate memory banks, where sets of words can be accessed concurrently. However, as shall be explained in further detail, storing database files in NVRAM in interleaved mode may adversely impact DBMS availability.
FIGS. 5A and 5B depict a memory bank that may be used for NVRAM211-1,211-2,211-3, and211-4, and which may store database blocks of database files in an interleaved mode (seeFIG. 5A) and in a non-interleaved mode (FIG. 5B). Referring toFIG. 5A,NVRAM memory banks500 includememory banks501,502,503, and504 and database blocks510 includes database blocks511,512,513, and514. As depicted inFIG. 5A, database blocks510 are stored in interleaved mode. A portion ofdatabase block511 is stored respectively in memory bank,502,503, and504. Database blocks512,513, and514 are also stored in similar interleaved fashion acrossmemory banks501,502,503, and504.
FIG. 5B shows database blocks510 stored in non-interleaved mode.Database block511 is stored entirely withinmemory bank501;database block512 is stored entirely withinmemory bank502;database block513 is stored entirely withinmemory bank503; anddatabase block514 is stored entirely withinmemory bank504.
In interleaved mode, whenmemory bank501 fails or otherwise becomes unavailable, a portion of each of database blocks511,512,513, and514 becomes unavailable, which in effect may render the entirety of the database blocks511,512,513, and514 unavailable. On the other hand, in non-interleaved mode, onlydatabase block511 becomes unavailable. Thus, in case of unavailability or failure of just one memory bank, storing the database files in interleaved mode may reduce availability of data blocks in the database files stored in NVRAM inDBMS200, while storing the database files in non-interleaved mode enhances availability.
Filtered Block Requests
According to an embodiment, a storage process services requests for data blocks that are filtered according to filtering criteria specified in the requests. Such requests are referred to herein as filtered data block requests. Database processes running onDBMS200 may issue a filtered data block request to a storage process running onDBMS200 to request filtered data blocks from data blocks stored locally on the computing node of the storage process. The filtered data block request specifies a range of data blocks and filtering criteria. In response to receiving a filtered data block request, a storage process performs filtered data block scans. Filtered data block scans comprise reading data blocks specified in the request, and applying the filtering to criteria to return data blocks that satisfy the filtering criteria.
Filtered data blocks returned as satisfying the filtering criteria may be data blocks containing at least one row satisfying the filtering criteria, or may be data blocks that contain only rows that satisfy the filtering criteria, the rows having been extracted from the specified data blocks by the storage process. The term data block is used herein to refer to either copies of data blocks stored in persistent storage or data blocks constructed to contain rows extracted from other the data blocks.
Examples of filtered data block requests and handling thereof are described in U.S. patent application Ser. No. 14/480,009, entitled Query And Exadata Support For Hybrid Columnar Compressed Data, filed on Sep. 8, 2014 by Vineet Marwah, et al., the entire contents of which are incorporated herein by reference. An advantage of filtered data block scanning is that data blocks are scanned and filtered by processes that can access data blocks in local storage, where the data blocks may be accessed far more quickly. Also, because the data blocks are filtered before returning data blocks over the network; the amount of data to transmit over the network is thereby reduced.
FIG. 6 depicts handling filtered data block requests byDBMS200, and shows elements ofDBMS200 that participate in handling the filtered data block request. In addition,FIG. 6 depicts return buffer pools608-1,608-2,608-3, and608-4. Return buffer pools608-1,608-2,608-3, and608-4 are allocated from main memory204-1,204-2,204-3, and204-4, respectively, and are used to store data blocks processed during filtered data block scanning, where the data blocks may be accessed and examined more quickly than in NVRAM to perform filtered data scanning operations.
Referring toFIG. 6, database process205-1 transmits filtered data block requests to storage processes213-1,213-2,213-3, and213-4. The filtered data block requests sent to storage processes213-2,213-3, and213-4 are sent vianetwork201, while the filtered data block request sent to storage process213-1, which is local to database process205-1, is sent via a remote procedure call.
The filtered data block requests are issued to compute a query that applies a predicate condition to a column of the table. Database server instance203-2 determines from storage mapping406-1 that ranges of data blocks that store data for the table reside at respective memory address ranges on each of NVRAM211-1,211-2,211-3, and211-4. A filtered data block request sent to storage processes213-1,213-2,213-3, and213-4 specifies a respective memory address range in NVRAM211-1,211-2,211-3, and211-4 and the predicate condition as filtering criteria.
With respect to storage process213-2, upon receipt of the respective filtered data block request, storage process213-2 reads the specified data blocks into the return buffer pool608-2 to stage the data blocks for further processing. While staged in return buffer pool608-2, storage process213-1 examines the data blocks to determine which of the data blocks satisfy the filtering criteria, i.e. have at least one row that satisfies the criteria. The data blocks that satisfy the filtering criteria are returned to database process205-1. The data blocks may be returned using a RDMA transfer between return buffer pool608-2 and database buffer pool208-1 (not shown inFIG. 6).
With respect to storage processes213-3 and213-4, upon receipt of the respective filtered data block request, storage processes213-3 and213-4 perform similar operations involving specified data blocks in NVRAM211-3 and211-4, return buffer pool608-3 and608-4, and database buffer pool208-1.
With respect to storage processes213-1, upon receipt of the respective filtered data block request, storage process213-1 performs similar operations involving specified data blocks in NVRAM211-1 and return buffer pool608-1, except that data blocks are returned to database buffer pool208-1 without need to perform a RDMA transfer acrossnetwork201.
In an embodiment of the present invention, when performing a filtered data block scan, the data blocks are scanned in place. That is, the data blocks are examined while stored in NVRAM to determine whether filtering criteria is satisfied without staging the data blocks in return buffers.
One-Sided Writes
As mentioned before, a data block write operation may be performed by a DBMS using an approach referred to as one-sided writing. One-sided writing uses a RDMA write to write the data block to NVRAM. When writing a data block to NVRAM, it is possible that only part of the data block is written to the data block's location in NVRAM thereby leaving a partially written data block that is corrupt. The reason for this possibility is that the largest atomic write that can be performed using RDMA is much smaller than a data block. For example, the largest atomic RDMA write is eight bytes and a data block may be 4 kilobytes. When a database process RDMA writes a data block to a memory location, the data block is written in a series of separate atomic writes of 8 bytes each. Before the series can be completed, an error is encountered, thereby leaving a partially written data block.
It is possible that mechanisms can be used to cope with the partially written data block. However, such mechanisms have an overhead cost. Such overhead cost can be avoided using an approach that avoids partially overwriting a data block in this way.
According to an embodiment, a data block write operation using one-sided writing involves two operations: a remote write staging and a local write back. A remote database process performs the remote write staging, which involves a database process using RDMA writes to write a data block to a “write staging buffer” that resides on a “home node”, which is a computing node hosting a home location of the data block. Once the RDMA writes are complete, the data block is marked at the home node as being staged. While the data block is marked as being staged, the data block is referred to as being in a “write staging deferred” state, and reads of the data block from the home location are blocked and/or are deferred. Subsequently, a storage process performs a local write back of the data block. In a local write back, a storage process writes a data block from the write staging buffer to the data block's home location and then unmarks the data block as being staged.
Even though a local write back of a data block may not be completed, once the data block is written to the staging buffer and marked as staged, the write is committed, that is, the write is in effect treated as having been completed at the home location. After the data block is marked as staged and has thereby entered the write staging deferral state, the older version of the data block stored at the home location is not returned by subsequent data block read operations; RDMA reads of the version of the data block stored in the home location are forgone or deferred until the local write back of the data block is completed. This approach is referred to as one-sided because only write operations initiated by a remote process requesting a write, in this case a database process, are needed to in effect commit the write of the data block.
Write Staging Participants
FIG. 7 is a diagram that illustrates components on a computing node ofDBMS200 that participate in one-sided writes and that are used in an illustration of an embodiment of the present invention. Referring toFIG. 7, it depicts computing node202-3 and storage process213-2, and counter table710 and write staging buffer pool713, both of which reside in NVRAM211-3.
Counter table710 contains records for data blocks stored in NVRAM211-3. The records have two attributes that are counters, which include client-side counter711 and server-side counter712. Each record is associated with a data block stored in NVRAM211-3, and contains a separate counter value in each of client-side counter711 and server-side counter712. According to an embodiment, the records in counter table710 are fixed length. Each record is stored at a position within counter table710 that maps to the logical disk and storage location (offset) of the data block that is associated with the record. In the course of performing a one-sided write, the counter values stored in a record for a data block are updated in a way that indicates when the write back to the home location of the data block is complete, as shall be explained in further detail.
Write staging buffer pool713 is used to stage data blocks for one-sided writes, each data block being staged in a write staging buffer in write staging buffer pool713. According to an embodiment, a database process writes a data block to a write staging buffer using a RDMA operation referred to herein as a zero-copy buffer write. Under a zero-copy buffer write, a computing node registers a buffer pool with a local RNIC and a “handler” process designated to be notified when a requested write to a buffer in the buffer pool is complete. A remote process may target a RDMA write to the buffer pool rather than to a particular memory location. Data is written to any buffer in the buffer pool and the handler process on the computing node is notified when data is written to a buffer. The RNIC does not write any more data to the buffer until the RNIC receives a notification that the buffer is available for receiving a RDMA write.
In the current illustration, write staging buffer pool713 is registered as a buffer pool for zero-copy buffer writes and storage process213-3 as the handling process to notify when a RDMA write of a data block to a write staging buffer is complete.
Remote Write-Staging
FIG. 8A is a flowchart depicting remote write staging operation according to an embodiment of the present invention. Remote write staging is illustrated with the components shown inFIG. 7.FIG. 7 depicts, in addition to other components described previously, database process205-1 and data block702. In the current illustration, database process205-1 is performing its part of a data block write operation according to the one-sided write approach. The home location of data block702 is in NVRAM211-3.
Referring toFIG. 8A, at802, database process205-1 RDMA reads a client-side counter value from the memory location that stores the record in the counter table710 that is mapped to data block702. The counter-value is 133.
Database process205-1 calculates the memory location of the record using a base memory address of counter table710 provided to database server instance203-3 by storage service212-3. The memory location is communicated, for example, as part of startup operations ofDBMS200 or a node join operation to add a database server instance as an instance toDBMS200.
At804, database process205-1 updates the client-side counter value. The client-side counter value is incremented by 1 to 134.
At806, database process205-1 RDMA writes data block702 to write staging buffer in write staging buffer pool713. Database process205-1 RDMA writes data block702 using a zero-copy buffer write.
At806, database process205-1 RDMA writes the updated client-side counter value to the record and memory location from which the client-side counter value was retrieved. At this point, in the record in counter table710, the client-side value is 134 and the storage-side counter value is 133. As shall be explained in greater detail, before a database process performs a RDMA read of a data block from its home location, the database process first reads the corresponding client-side counter value and storage-side counter value of the data block from counter table710. The counter-side counter value being greater than the storage-side counter value indicates to the database process that the corresponding data block is in the write staging deferral state, meaning a newer version of the data block is in the write staging buffer pool713 and has not yet been written to the respective home location.
Local Write Back
FIG. 8B is a flowchart depicting a local write back operation under one-sided writing, according to an embodiment of the present invention. The current illustration is continued to illustrate the local write back operation.
Referring toFIG. 8B, at822, storage process213-3 receives notification that a data block has been added to a particular write staging buffer in write staging buffer pool713.
At824, storage process213-3 retrieves data block702 from writing staging buffer pool713 and writes the data block to the home location of the data block.
At826, storage process213-3 updates the storage-side counter value for data block702, incrementing the storage-side counter value from 133 to 134. The client-side counter value now equals the storage-side counter value, thereby indicating that data block702 is no longer in the write staging deferral state.
Data Block Read Operation for One-Sided Writing.
FIG. 9 depicts a data block read operation under one-sided writing. The illustration of remote write staging forFIG. 8A is continued to illustrate the local write back operation. Thus, data block702 has been written to write staging buffer pool713 and the counter-side value and storage-side value for data block702 are134 and133, respectively.
Atstep902, database process205-1 RDMA reads the client-side counter value and storage-side counter value for data block702. At904, database process205-1 determines whether the client-side counter value is greater than the storage-side counter value. If the client-side counter value and storage-side counter value are equal, then at906, database process205-1 RDMA reads data block702 from the respective home location of data block702.
In the current illustration, however, database process205-1 determines that the client-side value of 134 is greater than storage-side value of 133; the data block702 is thus in the write staging deferral state.
In response to the determination, at910, database process205-1 forgoes the RDMA read at906. Instead, database process205-1 initiates a data block read by sending a data block read request to a storage process of storage service212-3.
To service the data block read request for data block702, the storage process also determines whether data block702 is in the write staging deferral state by comparing the client-side counter and storage-side counter for data block702. If thedata block702 is in the write staging deferral state, then storage process213-3 defers reading and returning data block702 from its home location while polling the client-side counter and storage-side counter, that is, intermittently reading the client-side counter and storage-side counter. Once the storage process determines that the polled client-side counter and storage-side counter are equal, the storage process reads the data block from the home location and returns the data block to the requestor.
As an alternate to a database process sending a data block read request to a storage process when the database process determines the data block is in the write staging deferral state, the database process itself may simply poll the client-side and storage-side counters and then RDMA read the data block when the counters are equal.
One sided write staging has been illustrated where the persistent storage to which a data block is deemed committed and written back is NVRAM, however an embodiment of the present invention is not so limited. The persistent storage may be any persistent storage, including disk-based memory and flash memory.
One-Sided Writes for Append-Only
Appending-only refers to a way of modifying data in a data structure in which data stored in the data structure is not overwritten and is modified by only appending data to data already in the data structure. In an append-only data structure, data is appended to the “append end” of the data structure. Specifically, within a memory address space of the data structure, data is appended by writing data to a memory address range adjacent to memory address range to which data was most recently written and committed.
According to an embodiment, append-only data stored in NVRAM may be updated using a one-sided write. An example append-only data structure in the context of database technology is a redo log in a DBMS.
FIG. 10 depicts a redo log used to illustrate an append-only one-sided write. Referring toFIG. 10,redo log1001 is an append-only data structure stored in a contiguous memory address space (i.e. range) in NVRAM211-3. The memory address space begins at a base memory address referred to herein as the head. Redolog1001 is logically divided into data blocks (not illustrated) that each contain one or more redo records. A data block spans a memory address range within the memory address space of the redo log.
Redolog1001 comprises a header at the beginning of the redo log. The header includesappend pointer1003, which points to the append end ofredo log1001, which is the memory address withinredo log1001 to which to append the next data block to add to redolog1001. An append pointer maybe, without limitation, a memory pointer point to the append end or integer added to the head that resolves to the append end.
In a one-sided append-only write, one or more data blocks are RDMA written to the append end. If the one or more data blocks are written successfully, a RDMA write is issued to updateappend pointer1003 to reflect the new append end. Once the updatedappend pointer1003 is written successfully, then the append-only write is treated has having been committed.
FIG. 11 is a flow chart depicting a procedure for an append-only one-sided write according to an embodiment of the present invention. The procedure is illustrated usingredo log1001 and database process205-1, which is executing remotely on computing node202-1.
Referring toFIG. 11, at1105, database process205-1 readsRDMA header1002, which includesappend pointer1003. At1110, database process205-1 issues a RDMA write to append a data block at the append end, the memory address currently pointed to by theappend pointer1003.
At1115, database process205-1 determines whether the RDMA of the data block is successful. If not successful, then at1140, database process205-1 foregoes writing the header with an updated append end value forappend pointer1003. In effect, the write is treated as uncommitted and having never occurred. The subsequent append-only write of a data block to redolog1001 will be attempted at the original append end.
If the RDMA of the data block is successful, then at1125, the value ofappend pointer1003 is updated to an append end that reflects the addition of the data block. At1125, database process205-1 issues a RDMA write to write anew header1002, thenew header1002 including the new value forappend pointer1003.
At1115, database process205-1 determines whether the RDMA write toheader1002 is successful. If not successful,append pointer1003 is left pointing to the original append end. In effect, the write is treated as uncommitted and having never occurred. In a subsequent append-only write of a data block to redolog1001, an attempt will thus be made to append the data block at the original append end.
If the RDMA write toheader1002 is successful, then the append-only write of the data block is treated as committed. In a subsequent write of data block to redolog1001, an attempt will made to append the data block at the new append end pointed to by the updatedappend pointer1003.
As shown above, if the RDMA write of the data block to append the data block to redolog1001 or the write to update theappend pointer1003 both fail, the write is uncommitted. The redo log is in effect left in the original state that existed when the append-only write was initiated.
Other Advantages of One-Sided Writing
One-sided writing provides various advantages over other approaches that are two-sided. In two-sided writing, at least two processes participate to write and commit a data block to persistent storage. At a general level, a process running on a computing node initiates the write of a data block over a network to persistent storage of a destination computing node, where another “destination-side” process participates in writing the data block to persistent storage at the destination.
There are at least several variations to two-sided writing, all of which may involve waking up a destination-side process at the destination, including two-sided writing approaches that use RDMA and NVRAM. Some variations involve waking up the destination side process to write the data block after write staging at the destination to write the data block to persistent storage before acknowledging the write to the client process to commit the write. In a messaging variation, a client process sends a message to a destination-side process, the message including a data block to be written to persistent storage. The destination-side process write stages the data block to volatile RAM, writes the data block to persistent storage and then acknowledges the write to the destination-side process. In a two-sided approach that uses RDMA, a message is also sent from a client-side process to a destination-side process. However, the message does not contain the data block, but instead a location of memory from where to transfer a data block or to where to transfer a data block. The location of memory is used to perform a RDMA write. In one variation of a two-sided write using RDMA, the client-side process sends a message requesting a memory location at the destination to write using RDMA. In another variation, the client-side process sends a message to the destination-side process specifying a memory location at the client-side from where the destination-side process may retrieve a data block using RDMA.
Waking a process entails context switching. Thus, two-sided writing incurs the overhead of context switching. On the other hand, a one-sided approach does not use a destination-side process to successfully commit a write of a data block and therefore avoids the cost of context switching on the destination side. In addition, one-sided writing enables one-sided reads of data blocks, which also do not incur the cost of awaking a second process.
Storage Cell Based NVRAM Shared Storage Architecture
The NVRAM shared storage architecture described above distributes the home location of data blocks across NVRAMs on computing nodes that host database server instances. However, the approaches are not limited to this type of NVRAM shared storage architecture. A NVRAM shared storage architecture may be based on home locations distributed among NVRAMs of storage cells rather than of computing nodes that host database server instances.
FIG. 12 is a block diagram that illustrates such a NVRAM shared storage architecture. Referring toFIG. 12,multi-node DBMS1200 comprises database server instances, each hosted on a respective computing node, each database server instance providing access to the same database stored on sharedstorage1221. The database server instances ofDBMS1200 comprise database server instances1203-1 and1203-2, which are hosted on computing nodes1202-1 and1202-2 respectively. The sharedstorage1221 comprises storage cells1222-1 and1222-2. Each of database server instances1203-1 and1203-2 is connected by ahigh speed network1201 to each of storage cells1222-1 and1222-2.
Each of storage cells1222-1 and1222-2 is a computing node that includes main memory and persistent storage for storing database files of the one or more databases ofDBMS1200; in an embodiment, the persistent storage for storing database files comprises NVRAM. Home locations for database files and the data blocks therein ofDBMS1200 are in NVRAM1223-1 and NVRAM1223-2. The persistent storage of storage cells1222-1 and1222-2 may also comprise persistent storage devices such as disk devices or flash memory devices.
Storage process1225-1 and storage process1225-2 are storage processes that run on storage cells1222-1 and1222-2, respectively. Storage process1225-1 and storage process1225-2 receive requests from any of database server instances1203-1 and1203-2 to read or write data blocks from or to database files stored in NVRAM1223-1 and1223-2, or other persistent storage.
Among the requests handled by storage process1225-1 and process1225-2 are filtered data block requests. While storage process1225-1 and storage process1225-2 handle filtered data block requests, storage process1225-1 and storage process1225-2 are not able to compile database language statements into execution plans that can be executed against a database that is stored across storage cells inshare storage1221.
Volatile buffer pool1228-1 and volatile buffer pool1228-2 are buffer pools allocated from main memory1224-1 and main memory1224-2, respectively. Volatile buffer pool1228-1 and volatile buffer pool1228-2 each comprises buffers and each is used for temporarily staging and/or caching of data blocks stored in NVRAM1223-1 and NVRAM1223-2 when needed.
Cache manager1225-1bis a process responsible for performing cache management for volatile buffer pool1228-1 and cache manager1225-2bis a process for performing cache management of volatile buffer pool1228-2.
Database Server Instances
Each of the database server instances ofDBMS1200 comprises database processes that run on the computing node that hosts the database server instance. Referring toFIG. 12, each of database server instances1203-1 and1203-2 comprise multiple database processes and database buffers that cache data blocks read from sharedstorage1221. Database server instances1203-1 and1203-2 are hosted on computing nodes1202-1 and1202-2, respectively. Database server instance1203-1 comprises DB processes1205-1aand1205-1b, which run on computing node1202-1, and database buffer pool1208-1, which is allocated from main memory1204-1. Database server instance1203-2 comprises database processes1205-2aand1205-2b, which run on computing node1202-2, and database buffer pool1208-2, which is allocated from main memory1204-2.
Network1201 is RDMA enabled, enabling a process running a computing node1202-1 or computing node1202-2 to read and write using RDMA from or to NVRAM1223-1 and NVRAM1223-2, main memory1224-1 and main memory1224-2.
According to an embodiment, each computing node ofDBMS1200 hosts a storage service. Referring toFIG. 12, computing node1202-1 hosts storage service1212-1 and computing node1202-2 hosts storage service1212-2. Storage service1212-1 comprises one or more storage processes and storage layer1206-1. Storage service1212-2 comprises one or more storage processes and storage layer1206-2. Storage service1212-1 and storage service1212-2 provide a mapping between database files and offsets therein to home locations of data blocks within the database files in NVRAM.
Operations such as a one-sided writes, a data block read operation, one-sided writing, one-sided writes for append-only are performed similarly as described before except as follows. Home locations for data blocks are at the NVRAM of storage cells. RDMA writes of data blocks to home locations are made to the NVRAM of storage cells. The storage cells also include NVRAM allocated for write staging buffers.
In an embodiment, a NVRAM shared storage architecture may comprise a database with database files having home locations across the NVRAM of storage cells and the computing nodes of database server instances. Operations such as a one-sided writes, a data block read operation, one-sided writing, one-sided writing for append-only are performed similarly as described before except as follows. Home locations for data blocks include the NVRAM of storage cells and computing nodes of database server instances. RDMA writes of data blocks to home locations are made to the NVRAM of storage cells and computing nodes of database server instances.
Memory Overview
Because embodiments of the invention involve a novel use of a non-volatile RAM, a description of memory is pertinent and useful. As used herein, “non-volatile” refers to a characteristic of a memory that retains data in the absence of any form of electrical power, including external or battery backup. Examples of non-volatile memory include e-prom memory, flash memory, and disk memory. Non-volatile memory does not include volatile memory for which power is retained by a battery backup in the absence of another external power source. For example, volatile memory coupled to a board with an embedded battery-backup is not non-volatile memory, because without the power provided by a battery, the volatile memory does not retain data.
Byte-addressable memory is distinguishable from block-addressable memory. A byte is eight bits and is the minimum amount of data that may be addressed, retrieved from memory, or written to in byte-addressable memory. Thus, to manipulate a bit in a byte, a byte containing the bit must be fetched to a register of processor executing a machine instruction that references the byte (or word containing the byte) and manipulated according to the machine instruction or another machine instruction.
In contrast, the minimum size for a unit of block-addressable memory is a data block. A data block comprises multiple bytes and multiple words and cannot be entirely stored within a register of processor. For block-addressable memory, a data block is the minimum amount of data that may be addressed, retrieved from memory, or written to memory. Examples of block-addressable memory include flash memory and disk memory. To manipulate a bit or a byte in a block, a block containing those bits is loaded into a byte-addressable memory by an instruction referencing the block issued to a block-based interface.
RAM is distinguishable from read-only memory (ROM) in that data in RAM can be overwritten. As used herein, overwriting data refers to replacing the data with new data without first having to erase the data in the memory. Thus, as used herein, RAM refers to byte-addressable memory that can be overwritten.
DBMS Overview
A DBMS manages one or more databases. A DBMS may comprise one or more database servers referred to herein as database server instances. A database comprises database data and a database dictionary that are stored on a persistent memory mechanism. Database data may be stored in one or more data containers. Each container contains records. The data within each record is organized into one or more fields. In relational DBMS's, the data containers are referred to as tables, the records are referred to as rows, and the fields are referred to as columns. In object-oriented databases, the data containers are referred to as object classes, the records are referred to as objects, and the fields are referred to as attributes. Other database architectures may use other terminology.
Users interact with a database server instance of a DBMS by submitting to the database server commands that cause the database server instance to perform operations on data stored in a database, as well as other kinds of operations. A database command may be in the form of a database statement that conforms to a database language. A database language for expressing the database commands is the Structured Query Language (SQL). There are many different versions of SQL, some versions are standard and some proprietary, and there are a variety of extensions. Data definition language commands are issued to a database server to create or configure database objects, such as tables, views, or complex data types. DDL commands are used to configure a database server for a particular hardware environment, to configure computer resource usage of the database server, as well as other operating aspects of the database server.
A server, such as a database server, is a combination of software and an allocation of computational resources, such as memory, a node, and processes on the node for executing the integrated software components on a processor, the combination of the software and computational resources being dedicated to performing a particular function on behalf of one or more clients.
Resources from multiple nodes in a multi-node database system can be allocated to running a particular database server's software. Each combination of the software and allocation of resources from a node is a server that is referred to as a “server instance” or “instance.” A database server may comprise multiple database server instances, some or all of which are running on separate computer elements.
Database processes that comprise a database server run under the control of the database server (i.e. can be created or terminated by the database server) and perform various database server functions. Such processes are referred to herein as database processes. Database processors include listeners, garbage collectors, log writers, processes for database sessions for executing database commands issued by database clients (including processes executing within shared sessions), and recovery processes.
A database process may comprise state objects that indicate state information for the process and allows the DBMS to manage and track the process. A typical database thread may also comprise a state object. A state object is a resource that is visible to the DBMS and indicates to the DBMS the state of the process. For example, a state object may indicate whether a process is free, unavailable, or failed. Thus, the DBMS can use the state object to determine how many processes are running in the database system, which ones are available, and clean up failed processes.
In an embodiment, the DBMS comprises a resource manager, which handles database processes for the database system. The resource manager may be a background daemon, a database component, software module, or some combination thereof. The resource manager may monitor database instance(s) and track processor and I/O resources across database processes. In an embodiment, the resource manager is a process scheduler that interrupts, de-schedules, schedules, or otherwise controls when database processes may run.
In an embodiment, state objects are used by the resource manager to track the current state of database processes. As used herein, a state can include information regarding a database process, login credentials for a database session, current database transactions, and resources held by a process or thread. Examples of state objects include process, session, and call state objects. Process state objects keep a process' information, attributes (such as dead, system process, fatal system process, cleanup process, shared server, and etc.), and other process structures such as a process interrupt queue.
Data Blocks
A data block is used by a DBMS to store one or row more database rows, or portions of rows, including one or more columns of a row. When rows are read from persistent storage, a data block containing the row is copied into a data block buffer in RAM and/or main memory of a database server. A data block that is used to store database data maybe referred to herein as a database block. A database block usually contains multiple rows, and database block metadata describing the contents of the database block. Metadata includes control and formatting information, such as offsets to sequences of bytes representing rows or other data structures, and a list of transactions affecting a row.
A database block is referred to as being atomic because, at least in part, a database block is the smallest unit of database data a database server may request from a persistent storage device. For example, when a database server seeks a row that is stored in a data block, the data block may only read the row from a persistent storage device by reading in the entire data block.
Hardware Overview
According to one embodiment, the techniques described herein are implemented by one or more special-purpose computing devices. The special-purpose computing devices may be hard-wired to perform the techniques, or may include digital electronic devices such as one or more application-specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs) that are persistently programmed to perform the techniques, or may include one or more general purpose hardware processors programmed to perform the techniques pursuant to program instructions in firmware, memory, other storage, or a combination. Such special-purpose computing devices may also combine custom hard-wired logic, ASICs, or FPGAs with custom programming to accomplish the techniques. The special-purpose computing devices may be desktop computer systems, portable computer systems, handheld devices, networking devices or any other device that incorporates hard-wired and/or program logic to implement the techniques.
For example,FIG. 13 is a block diagram that illustrates acomputer system1300 upon which an embodiment of the invention may be implemented.Computer system1300 includes abus1302 or other communication mechanism for communicating information, and ahardware processor1304 coupled withbus1302 for processing information.Hardware processor1304 may be, for example, a general purpose microprocessor.
Computer system1300 also includes amain memory1306, such as a random access memory (RAM) or other dynamic storage device, coupled tobus1302 for storing information and instructions to be executed byprocessor1304.Main memory1306 also may be used for storing temporary variables or other intermediate information during execution of instructions to be executed byprocessor1304. Such instructions, when stored in non-transitory storage media accessible toprocessor1304, rendercomputer system1300 into a special-purpose machine that is customized to perform the operations specified in the instructions.
Computer system1300 further includes a read only memory (ROM)1308 or other static storage device coupled tobus1302 for storing static information and instructions forprocessor1304. Astorage device1310, such as a magnetic disk, optical disk, or solid-state drive is provided and coupled tobus1302 for storing information and instructions.
Computer system1300 may be coupled viabus1302 to adisplay1312, such as a cathode ray tube (CRT), for displaying information to a computer user. Aninput device1314, including alphanumeric and other keys, is coupled tobus1302 for communicating information and command selections toprocessor1304. Another type of user input device iscursor control1316, such as a mouse, a trackball, or cursor direction keys for communicating direction information and command selections toprocessor1304 and for controlling cursor movement ondisplay1312. This input device typically has two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), that allows the device to specify positions in a plane.
Computer system1300 may implement the techniques described herein using customized hard-wired logic, one or more ASICs or FPGAs, firmware and/or program logic which in combination with the computer system causes orprograms computer system1300 to be a special-purpose machine. According to one embodiment, the techniques herein are performed bycomputer system1300 in response toprocessor1304 executing one or more sequences of one or more instructions contained inmain memory1306. Such instructions may be read intomain memory1306 from another storage medium, such asstorage device1310. Execution of the sequences of instructions contained inmain memory1306 causesprocessor1304 to perform the process steps described herein. In alternative embodiments, hard-wired circuitry may be used in place of or in combination with software instructions.
The term “storage media” as used herein refers to any non-transitory media that store data and/or instructions that cause a machine to operate in a specific fashion. Such storage media may comprise non-volatile media and/or volatile media. Non-volatile media includes, for example, optical disks, magnetic disks, or solid-state drives, such asstorage device1310. Volatile media includes dynamic memory, such asmain memory1306. Common forms of storage media include, for example, a floppy disk, a flexible disk, hard disk, solid-state drive, magnetic tape, or any other magnetic data storage medium, a CD-ROM, any other optical data storage medium, any physical medium with patterns of holes, a RAM, a PROM, and EPROM, a FLASH-EPROM, NVRAM, any other memory chip or cartridge.
Storage media is distinct from but may be used in conjunction with transmission media. Transmission media participates in transferring information between storage media. For example, transmission media includes coaxial cables, copper wire and fiber optics, including the wires that comprisebus1302. Transmission media can also take the form of acoustic or light waves, such as those generated during radio-wave and infra-red data communications.
Various forms of media may be involved in carrying one or more sequences of one or more instructions toprocessor1304 for execution. For example, the instructions may initially be carried on a magnetic disk or solid-state drive of a remote computer. The remote computer can load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local tocomputer system1300 can receive the data on the telephone line and use an infra-red transmitter to convert the data to an infra-red signal. An infra-red detector can receive the data carried in the infra-red signal and appropriate circuitry can place the data onbus1302.Bus1302 carries the data tomain memory1306, from whichprocessor1304 retrieves and executes the instructions. The instructions received bymain memory1306 may optionally be stored onstorage device1310 either before or after execution byprocessor1304.
Computer system1300 also includes a communication interface1318 coupled tobus1302. Communication interface1318 provides a two-way data communication coupling to anetwork link1320 that is connected to alocal network1322. For example, communication interface1318 may be an integrated services digital network (ISDN) card, cable modem, satellite modem, or a modem to provide a data communication connection to a corresponding type of telephone line. As another example, communication interface1318 may be a local area network (LAN) card to provide a data communication connection to a compatible LAN. Wireless links may also be implemented. In any such implementation, communication interface1318 sends and receives electrical, electromagnetic or optical signals that carry digital data streams representing various types of information.
Network link1320 typically provides data communication through one or more networks to other data devices. For example,network link1320 may provide a connection throughlocal network1322 to ahost computer1324 or to data equipment operated by an Internet Service Provider (ISP)1326.ISP1326 in turn provides data communication services through the world wide packet data communication network now commonly referred to as the “Internet”1328.Local network1322 andInternet1328 both use electrical, electromagnetic or optical signals that carry digital data streams. The signals through the various networks and the signals onnetwork link1320 and through communication interface1318, which carry the digital data to and fromcomputer system1300, are example forms of transmission media.
Computer system1300 can send messages and receive data, including program code, through the network(s),network link1320 and communication interface1318. In the Internet example, aserver1330 might transmit a requested code for an application program throughInternet1328,ISP1326,local network1322 and communication interface1318.
The received code may be executed byprocessor1304 as it is received, and/or stored instorage device1310, or other non-volatile storage for later execution.
In the foregoing specification, embodiments of the invention have been described with reference to numerous specific details that may vary from implementation to implementation. The specification and drawings are, accordingly, to be regarded in an illustrative rather than a restrictive sense. The sole and exclusive indicator of the scope of the invention, and what is intended by the applicants to be the scope of the invention, is the literal and equivalent scope of the set of claims that issue from this application, in the specific form in which such claims issue, including any subsequent correction.
Software Overview
FIG. 14 is a block diagram of a basic software system1400 that may be employed for controlling the operation ofcomputer system1300. Software system1400 and its components, including their connections, relationships, and functions, is meant to be exemplary only, and not meant to limit implementations of the example embodiment(s). Other software systems suitable for implementing the example embodiment(s) may have different components, including components with different connections, relationships, and functions.
Software system1400 is provided for directing the operation ofcomputer system1300. Software system1400, which may be stored in system memory (RAM)1306 and on fixed storage (e.g., hard disk or flash memory)1310, includes a kernel or operating system (OS)1410.
TheOS1410 manages low-level aspects of computer operation, including managing execution of processes, memory allocation, file input and output (I/O), and device I/O. One or more application programs, represented as1402A,1402B,1402C . . .1402N, may be “loaded” (e.g., transferred from fixedstorage1310 into memory1306) for execution by the system1400. The applications or other software intended for use oncomputer system1300 may also be stored as a set of downloadable computer-executable instructions, for example, for downloading and installation from an Internet location (e.g., a Web server, an app store, or other online service).
Software system1400 includes a graphical user interface (GUI)1415, for receiving user commands and data in a graphical (e.g., “point-and-click” or “touch gesture”) fashion. These inputs, in turn, may be acted upon by the system1400 in accordance with instructions fromoperating system1410 and/or application(s)1402. TheGUI1415 also serves to display the results of operation from theOS1410 and application(s)1402, whereupon the user may supply additional inputs or terminate the session (e.g., log off).
OS1410 can execute directly on the bare hardware1420 (e.g., processor(s)1304) ofcomputer system1300. Alternatively, a hypervisor or virtual machine monitor (VMM)1430 may be interposed between thebare hardware1420 and theOS1410. In this configuration,VMM1430 acts as a software “cushion” or virtualization layer between theOS1410 and thebare hardware1420 of thecomputer system1300.
VMM1430 instantiates and runs one or more virtual machine instances (“guest machines”). Each guest machine comprises a “guest” operating system, such asOS1410, and one or more applications, such as application(s)1402, designed to execute on the guest operating system. TheVMM1430 presents the guest operating systems with a virtual operating platform and manages the execution of the guest operating systems.
In some instances, theVMM1430 may allow a guest operating system to run as if it is running on thebare hardware1420 ofcomputer system1300 directly. In these instances, the same version of the guest operating system configured to execute on thebare hardware1420 directly may also execute onVMM1430 without modification or reconfiguration. In other words,VMM1430 may provide full hardware and CPU virtualization to a guest operating system in some instances.
In other instances, a guest operating system may be specially designed or configured to execute onVMM1430 for efficiency. In these instances, the guest operating system is “aware” that it executes on a virtual machine monitor. In other words,VMM1430 may provide para-virtualization to a guest operating system in some instances.
A computer system process comprises an allotment of hardware processor time, and an allotment of memory (physical and/or virtual), the allotment of memory being for storing instructions executed by the hardware processor, for storing data generated by the hardware processor executing the instructions, and/or for storing the hardware processor state (e.g. content of registers) between allotments of the hardware processor time when the computer system process is not running. Computer system processes run under the control of an operating system, and may run under the control of other programs being executed on the computer system.
Cloud Computing
The term “cloud computing” is generally used herein to describe a computing model which enables on-demand access to a shared pool of computing resources, such as computer networks, servers, software applications, and services, and which allows for rapid provisioning and release of resources with minimal management effort or service provider interaction.
A cloud computing environment (sometimes referred to as a cloud environment, or a cloud) can be implemented in a variety of different ways to best suit different requirements. For example, in a public cloud environment, the underlying computing infrastructure is owned by an organization that makes its cloud services available to other organizations or to the general public. In contrast, a private cloud environment is generally intended solely for use by, or within, a single organization. A community cloud is intended to be shared by several organizations within a community; while a hybrid cloud comprises two or more types of cloud (e.g., private, community, or public) that are bound together by data and application portability.
Generally, a cloud computing model enables some of those responsibilities which previously may have been provided by an organization's own information technology department, to instead be delivered as service layers within a cloud environment, for use by consumers (either within or external to the organization, according to the cloud's public/private nature). Depending on the particular implementation, the precise definition of components or features provided by or within each cloud service layer can vary, but common examples include: Software as a Service (SaaS), in which consumers use software applications that are running upon a cloud infrastructure, while a SaaS provider manages or controls the underlying cloud infrastructure and applications. Platform as a Service (PaaS), in which consumers can use software programming languages and development tools supported by a PaaS provider to develop, deploy, and otherwise control their own applications, while the PaaS provider manages or controls other aspects of the cloud environment (i.e., everything below the run-time execution environment). Infrastructure as a Service (IaaS), in which consumers can deploy and run arbitrary software applications, and/or provision processing, storage, networks, and other fundamental computing resources, while an IaaS provider manages or controls the underlying physical cloud infrastructure (i.e., everything below the operating system layer). Database as a Service (DBaaS) in which consumers use a database server or Database Management System that is running upon a cloud infrastructure, while a DbaaS provider manages or controls the underlying cloud infrastructure, applications, and servers, including one or more database servers.
Extensions and AlternativesAlthough some of the figures described in the foregoing specification include flow diagrams with steps that are shown in an order, the steps may be performed in any order, and are not limited to the order shown in those flowcharts. Additionally, some steps may be optional, may be performed multiple times, and/or may be performed by different components. All steps, operations and functions of a flow diagram that are described herein are intended to indicate operations that are performed using programming in a special-purpose computer or general-purpose computer, in various embodiments. In other words, each flow diagram in this disclosure, in combination with the related text herein, is a guide, plan or specification of all or part of an algorithm for programming a computer to execute the functions that are described. The level of skill in the field associated with this disclosure is known to be high, and therefore the flow diagrams and related text in this disclosure have been prepared to convey information at a level of sufficiency and detail that is normally expected in the field when skilled persons communicate among themselves with respect to programs, algorithms and their implementation.
In the foregoing specification, the example embodiment(s) of the present invention have been described with reference to numerous specific details. However, the details may vary from implementation to implementation according to the requirements of the particular implement at hand. The example embodiment(s) are, accordingly, to be regarded in an illustrative rather than a restrictive sense.