Full support for Autonomous JSON Document Object (AJD) cloud service technology
By introducing autonomous storage cells and storage-side indexes into the storage layer to dynamically manage the index structure, the problem of poor OLTP and OLAP operational performance is solved, and efficient mixed workload processing and system autonomy are achieved.
Patent Information
- Application Number
- CN201980084880.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2019-11-21
- Filing Date
- 2019-12-18
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2039-12-18
AI Technical Summary
The existing technology has poor performance when processing OLTP and OLAP JDOM operations, especially under mixed workloads. Manual index creation is complex and error-prone, resulting in unstable performance.
Introduce autonomous storage cells into the storage layer, and achieve efficient access to JSON objects by autonomously generating and managing indexes on the storage side and dynamically adjusting the index structure to adapt to different workloads.
Improves the performance of OLTP and OLAP, reduces the need for manual tuning, enables flexible response to mixed workloads, and enhances system autonomy and stability.
Smart Images

Figure CN113227998B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to autonomous tuning of data grids for documents.Techniques are provided herein for storage cells to autonomously maintain storage-side indexes and other optimized metadata and algorithms to accelerate selective access to distributed collections of hierarchical data objects. Background Art
[0002] JavaScript Object Notation (JSON) can be used as a schema-less semi-structured Document Object Model (DOM) for application development. Application objects can be persisted as JSON on a document collection repository using a simple put / get / replace style CRUD (create, read, update, delete) application interface (API). Once the JSON document repository is populated with content, the document repository should also support online analytical processing (OLAP) on JDOM for complex reporting queries on JSON documents. Under the relational model, DBAs support OLAP by creating indexes, materialized views, and / or loading data into memory to speed up reporting queries.
[0003] The problem with the prior art document cloud is that the performance is not satisfactory for both OLTP JDOM and OLAP JDOM workloads, especially for a mix of the two, and especially for a fluctuating ratio of the two. Application developers manually create the desired indexes for the OLAP JDOM service. And for running OLTP and OLAP JDOM simultaneously, developers prefer to minimize but not necessarily eliminate indexing, which conflicts with the prior art document cloud repository, which by default indexes everything or nothing in an attempt to generally speed up one of OLAP or OLTP but inevitably and greatly slows down the other. Manually providing a solution to both OLTP and OLAP JDOM operations in a cloud storage system is a challenging, cumbersome, and error-prone process. Summary of the invention
[0004] In an embodiment of the present invention, a computer-implemented method for accessing JavaScript object representation (JSON) in a storage layer is disclosed. The method includes: each storage cell of a plurality of storage cells in the storage layer performs: persisting a corresponding subset of JSON objects of a plurality of JSON objects residing in a database of a database management system (DBMS) connected to the plurality of storage cells, and autonomously generating and storing, in a volatile memory of the storage cell, a corresponding storage-side index of a plurality of storage-side indexes in the volatile memory of the plurality of storage cells without accessing a schema describing the corresponding subset of JSON objects, the corresponding storage-side index mapping each item in the corresponding plurality of items to one or more locations where the item appears in one or more JSON objects in the corresponding subset of JSON objects; and executing a data access request from the DBMS requesting a JSON object that satisfies a path expression based on at least a subset of the plurality of storage-side indexes in the volatile memory of the plurality of storage cells.
[0005] Various embodiments are described herein, including methods, systems, non-transitory computer-readable storage media storing programs, codes or instructions executable by one or more processors, etc. These illustrative embodiments are not mentioned to limit or define the present disclosure, but to provide examples to help understand the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0006] In the attached picture:
[0007] Figure 1 is a block diagram depicting an example document network that uses autonomous and storage-side indexes to accelerate selective access to a distributed collection of hierarchical data objects;
[0008] Figure 2 is a flow chart depicting an example data access process that uses autonomous and storage-side indexes to accelerate selective access to a distributed collection of hierarchical data objects;
[0009] Figure 3 is a block diagram depicting an example document network operating as a data grid of autonomous storage cells and providing location transparency;
[0010] Figure 4 is a flow chart depicting an example autonomous tuning process for a data grid operating as an autonomous storage cell and providing location transparency;
[0011] Figure 5 is a block diagram depicting an example storage cell having storage-side indexing oriented to content in various ways;
[0012] Figure 6 is a flow chart depicting an example index management process for using and managing a storage-side index oriented to content in various ways;
[0013] Figure 7 is a block diagram illustrating a computer system upon which embodiments of the present invention may be implemented;
[0014] Figure 8 is a block diagram illustrating a basic software system that may be used to control the operation of a computing system. DETAILED DESCRIPTION
[0015] In the following description, for the purpose of explanation, many specific details are set forth in order to provide a thorough understanding of the present invention. However, it will be apparent that the present invention can be practiced without these specific details. In other cases, well-known structures and devices are shown in block diagram form to avoid unnecessarily obscuring the present invention.
[0016] General Overview
[0017] This article describes a method for providing autonomous performance enhancements for both OLTP and OLAP JDOM operation services in the cloud without exposing the details of these performance enhancements to application developers. Such performance enhancements can include indexing on the storage side, materialized views, and in-memory scans. Application developers only need to use more logical concepts, such as document collections, CRUD calls, and example query (QBE) calls expressed through the Simple Oracle Document Access (SODA) API. SODA is described in the related manual "Oracle Database, Introduction to Simple Oracle Document Access". How to efficiently execute the SODA API on the back end can be crucial. A logical interface can be provided instead of exposing the physical implementation details to application developers.
[0018] The solution of this article can operate as any of the following: a database management system (DBMS), such as a relational DBMS (RDBMS), a data warehouse, and / or a data grid. The solution of this article includes a computing layer and a storage layer, and each layer can contain one or more general-purpose or special-purpose designed computers. The computers in the storage layer are called storage cells. Unlike other storage cells that are usually passive, the storage cells of this article can check the stored content, maintain metadata of the content and / or usage (e.g., storage-side indexes and statistics), and autonomously manage such metadata and related optimization structures.
[0019] The compute layer may host an RDBMS. The storage layer may operate as a backend that provides data storage / storage-side services (such as persistence, filtering, indexing, and / or caching) to the RDBMS. The compute layer may have its own filtering, indexing, and caching, based on an implementation that is more or less different from that of the storage layer.
[0020] In this article, the autonomous data warehouse provides services for OLAP through a relational model, provides services for OLTP through a relational model, and can even provide both OLTP and OLAP services through the JSON Document Object Model (JDOM) in document collections and a full-fledged relational model with arbitrary tables and queries on the same persistent data.
[0021] SODA is an easy-to-use API for accessing JSON documents stored in JSON collections. From the perspective of developers dealing with document repositories, the concept of document collections can sometimes be more natural than relational tables, the concept of JSON documents can sometimes be more natural than rows, and the concept of QBE can sometimes be more natural than SQL. Embodiments can prohibit various structured query language (SQL) data definition language (DDL) commands, especially table DDL commands, to prevent users from adding arbitrary tables to the system. The SODA API autonomously creates a table with appropriate JSON document columns and other housekeeping columns in response to a user's SODA request to create a document collection. User applications do not need to issue DML statements directly on the table storing JSON documents. Instead, the SODA document CRUD API, which includes calls such as put() / get() / replace(), includes an interface for users to request OLTP JDOM services. The SODA CRUD API implementation method autonomously generates appropriate SQL DML statements to perform insert / select / update / delete operations of JSON documents on the JSON document storage table in the database, including autonomously creating a storage-side primary key index on the JSON document collection table for fast key value lookup. The SODA QBE API enables users to query JSON document collections as a way to request OLAP JDOM services. The SODA QBE API implementation converts QBE into SQL / JSON statements that can be executed efficiently.
[0022] SODA OLAP over JDOM accessed through relational views is a powerful mechanism for users to bridge relational and JDOM models. However, instead of directly exposing JSON_TABLE() view creation, SODA provides a JSON data guided generation API and a relational view generation API over JSON collections. The imposition of materialized or non-materialized database views according to the techniques of this article facilitates storage cells to participate very efficiently without affecting storage cell design.
[0023] The storage-side indexes and other storage cell optimizations proposed in this article can improve the performance of filtering, projections, and / or joins, which are implementation operations that can support the mechanisms of database views. Even if database views exist and operate in the DBMS, some or all of such implementation operations can be seamlessly delegated (i.e., pushed down) to the intelligent storage layer, and the storage layer has no knowledge of the database views or the relational database. For example, a database view can only disclose important documents, and importance filtering can be delegated to the storage layer. Therefore, database views can implement mappings between documents and relational tables. Depending on the embodiment, the mapping can be bidirectional (i.e., writable views), or simply a mapping from documents to view tables (i.e., read-only).
[0024] SODA provides the same API for popular client programming languages. In general, the automation of SODA technology provides a high-level interface and avoids the use of SQL implementation details, so that the document cloud can continuously and autonomously improve its own distributed performance based on the technology of this article.
[0025] In an embodiment, each storage cell persists a respective subset of the hierarchical data objects. Each storage cell stores in memory respective (one or more) storage-side indexes that map each item to the location (one or more) in one or more hierarchical data objects of the respective subset of the hierarchical data objects where the item occurs. One or more computers execute data access requests based on at least the subset of the storage-side indexes of the storage cell.
[0026] In an embodiment, a cloud for JSON document services provides an easy-to-use, fully autonomous JSON document database that scales horizontally and elastically to deliver fast execution of document transactions and queries without the need for tuning by a database administrator (DBA).
[0027] 1.0 Sample Document Network
[0028] Figure 1 is a block diagram depicting an example document network 100 in an embodiment. Document network 100 uses autonomous and local storage-side indexes to accelerate selective access to distributed collections of hierarchical data objects.
[0029] Document network 100 includes a communication network, such as a telephone and / or computer network, such as a local area network (LAN), a wide area network (WAN), a storage area network (SAN), or an interconnected network of multiple networks of various such types. Document network 100 may include a distributed topology including architecture layers 191-192. Computing layer 191 may be a middleware layer including a database management system (DBMS) 170, such as a relational DBMS (RDBMS), which includes at least one database.
[0030] Storage layer 192 may operate as a persistent data repository (i.e., backend) such as a data grid or storage area network (SAN) for DBMS 170. Document network 100 interconnects a plurality of storage cells, such as 111-112, as network elements of document network 100, and DBMS 170, which includes at least one networked computer. For example, storage cells 111-112 may reside in the same or different data centers.
[0031] Each computing (such as a DBMS host or storage cell 111-112) of the document network 100 can be a rack server (such as a blade), a personal computer, a mainframe, a virtual computer, or other computing device. Alternatively, the storage cells 111-112 can each be a storage device or storage device (such as a network attached storage device (NAS)) containing a memory, a persistent storage device, and at least one processor (such as a central processing unit (CPU) or a microcontroller). Each storage cell 111-112 contains a memory such as 130.
[0032] Memory 130 may be random access memory (RAM) or block-oriented memory such as a solid state drive (SSD). Memory 130 may be volatile or non-volatile. Each storage cell 111-112 contains a persistent storage medium, which may include memory 130 and / or a mechanical storage device such as a disk drive or tape drive. If the persistent storage medium and memory 130 are separate components, memory 130 typically has less latency and less capacity than the persistent storage medium.
[0033] In an embodiment, some or all of the data stored in memory 130 is eventually copied to a persistent storage medium. For example, memory 130 may operate as a mirror of metadata (such as a persistent storage-side index), and / or operate as a demand-driven cache according to a strategy such as least recently used (LRU). Memory 130 may also store unmirrored metadata, such as local and / or temporary storage-side indexes. In practice, the creation and / or lifespan of a storage-side index may be associated with as little as a single data access request.
[0034] Document network 100 may persist many hierarchical data objects, such as 121-123. Each storage cell 111-112 may persist its own subset of hierarchical data objects 121-123. For example, storage cell 111 does not store hierarchical data object 123. Although not shown, the same hierarchical data object may be replicated on some or all storage cells.
[0035] In various embodiments, each of the hierarchical data objects 121-123 can be a completely or more or less self-contained hierarchical arrangement of data such as a document. Each of the hierarchical data objects 121-123 can contain JavaScript object notation (JSON), extensible markup language (XML), and / or key-value pairs. For example, the hierarchical data objects 121-123 can have a Multipurpose Internet Mail Extensions (MIME) type and / or can be transmitted / serialized as text. Binary formatting will be discussed later in this article.
[0036] In operation, DBMS 170 may receive or generate database statements (not shown), such as data manipulation languages (DML) such as structured query language (SQL). Example scenarios include read-only data warehousing, such as multidimensional online analytical processing (OLAP), or real-time business processing such as online transaction processing (OLTP). In practice, DBMS 170 may tolerate opposing workloads (such as a mix of OLAP and OLTP) that put a strain on known solutions, as discussed later herein.
[0037] For example, prior art approaches for accommodating both OLAP and OLTP use separate respective databases and / or database architectures, even when OLAP and OLTP access the same business data. With prior art, separating OLAP from OLTP into separate DBMSs facilitates separate tuning of OLAP and OLTP. With prior art, tuning OLAP and OLTP in the same DBMS may be ineffective due to the different characteristics and opposing side effects of OLAP and OLTP workloads.
[0038] For example, an enterprise may use DynamoDB or MongoDB for OLTP and CosmosDB for OLAP. However, the autonomous execution method of this article can optimally handle both OLAP and OLTP in the same database of the same DBMS. Counterintuitively, the techniques of this article may appear to increase the internal complexity of the DBMS, but in fact simplify database management by, for example, a) facilitating the consolidation of OLAP and OLTP into the same database, and b) replacing tedious and error-prone manual tuning with more efficient alternatives of this article, such as autonomous behavior and intelligent default configuration settings for JSON.
[0039] Antagonistic workloads are types of workloads that degrade the performance of each other. For example, an OLAP query fills the buffer cache with data blocks needed for that query (but not other queries that will be executed in the short term). As a result, the cache has been filled with data blocks that are less likely to generate cache hits, but data blocks used for OLTP workloads have been evicted, which are more likely to generate cache hits. Antagonistic types of workloads are also types of workloads where the performance of one type of workload is measured to degrade the performance of another type.
[0040] For example, more indexes may improve OLAP workloads but reduce OLTP workloads, which incur the overhead of updating indexes when a database is modified. As discussed later herein, the autonomous techniques herein may adjust the distribution of work between a first computer hosting a DBMS and a second computer persisting database data for the DBMS, such as based on dynamically detecting whether the work is part of an OLAP workload or part of an OLTP workload. For example, storage-side indexes are discussed elsewhere herein.
[0041] DBMS 170 may be multi-instanced (ie, distributed). In an embodiment not shown, computing layer 191 includes multiple DBMSs, such as 170. For example, storage cell 111 may concurrently interoperate with multiple DBMSs that do not share content, which may be another conflicting scenario.
[0042] DBMS 170 may execute each received database statement. Such execution may require optimization, such as a query plan. The generated query plan may specify at least one data access request (such as 180) to read and / or write data stored in storage cells 111-112.
[0043] For example, the same data access request 180 may be sent to one, some, or all of the storage cells 111-112 that access one, some, or all of the hierarchical data objects 121-123. For example, for an EXISTS query, more or less identical data access requests (such as 180) may be generated and sent concurrently to all storage cells 111-112 to achieve unit linear acceleration for horizontal scaling, as discussed later herein. In another example, such as when an EXISTS query to DBMS 170 can be answered based on (one or more) storage-side indexes (such as 141-142) contained, maintained, and used by the corresponding storage cells 111-112, the data access request 180 does not access the hierarchical data objects 121-123. DBMS 170 does not need to know that the storage-side indexes exist, nor does it need to know that the storage cells 111-112 are autonomous.
[0044] Because data objects 121-123 are hierarchical, they can each be composed of (one or more) data items. For example, hierarchical data object 121 contains item AB. Moreover, because data objects 121-123 are hierarchical, although not shown, item A can contain item B. In various embodiments, items can have logical roles, such as keys, key-value pairs, field names (e.g., JSON dictionary keys or XML attributes), values, JSON dictionary keys or XML tags, and / or other collections of items.
[0045] The same item may be repeated in the same hierarchical data object. For example, hierarchical data object 121 contains multiple instances of item A.
[0046] The same item may be repeated in different hierarchical data objects residing in the same storage cell.For example, storage cell 111 contains hierarchical data objects 121-122 each containing an instance of ItemB.
[0047] The same item may be repeated in different hierarchical data objects residing in different storage cells.For example, storage cells 111-112 contain hierarchical data objects 121 and 123, respectively, each of which contains an instance of item A.
[0048] Each data item or instance of a data item resides at a different location within the hierarchical data object. For example, data item AB resides at location XZ in the same hierarchical data object 121, including instances of the same data item A residing in locations X and Z. A location may include an offset, such as a byte or machine word offset into a hierarchical data object and / or an offset into an array, such as an alphabetically ordered array of items of the same or multiple hierarchical data objects.
[0049] In an embodiment not shown, locations may be unique across hierarchical data objects of the same storage cell or across document network 100 (ie, all storage cells). In the embodiment shown, locations are guaranteed to be unique only within a particular hierarchical data object.
[0050] In an embodiment, the same position may appear in different hierarchical data objects of the same storage cell. For example, position Z appears in both of two different hierarchical data objects 121-122.
[0051] In an embodiment, the same position may appear in different hierarchical data objects of different storage cells. For example, position Y appears in both different hierarchical data objects 121 and 123.
[0052] Storage-side indexes, such as 141-142, can speed up access to hierarchical data objects and / or items therein. Various types of storage-side indexes having various uses will be discussed later.
[0053] In this example, the storage-side indexes 141-142 may be used to look up the location XZ (and / or identifier of a hierarchical data object) based on criteria (one or more) such as a particular term, a pattern for one or more items, a path (or path pattern) into the hierarchy, and / or a filter expression appearing in the path pattern. For example, the storage-side index 141 may be an inverted index. In an embodiment, the storage-side index 141 includes a lookup table, a hash table, and / or other associated (i.e., mapping / dictionary) structures.
[0054] For example, when one, some, or all of storage-side indexes 141-142 are used instead of a brute-force table scan, it may speed up the lookup of item B (or counting item A instances, or detecting the presence of item C within document network 100, storage cell 111, or hierarchical data object 121). The index distribution may be as follows.
[0055] In the illustrated embodiment, each storage cell has its own storage-side index. For example, the type of each storage-side index and / or the content of each storage-side index may be different. As discussed later herein, the same storage cell may have different kinds of storage-side indexes and / or different instances of the same kind of storage-side index. In an embodiment, each storage-side index may be updated independently, such as based on the traffic (i.e., usage) or content of the cell containing the storage-side index.
[0056] Additionally, although not shown, document network 100 may have a global index that is not contained in a single storage cell, or is not contained in any storage cell, or is not contained in storage layer 192. For example, a global index in storage layer 192, in computation layer 191, or in DBMS 170 may indicate the distribution and / or replication of hierarchical data objects and / or items therein.
[0057] In the illustrated embodiment, the storage side index 141 resides in the memory 130 to further reduce latency. Depending on the embodiment, the storage side index 141 may be loaded directly from the disk, may be indirectly constructed from other data or metadata on the disk, or may be initially constructed directly in the memory 130.
[0058] In an embodiment, storage cells 111-112 are autonomous such that each cell independently maintains and dynamically updates its own storage-side index, such as based on the traffic or content of the cell. For example, storage cell 111 may have logic to maintain storage-side index 141, such as by monitoring reads and / or writes and maintaining statistics thereof, such as discussed later herein.
[0059] As also discussed later herein, an autonomous storage cell 111 may have logic that dynamically decides when, what, and / or what instances of the cell's own storage-side index to load, create, and update, tune, persist, and / or discard based on usage statistics for the cell. In an embodiment, an autonomous storage cell 111 may periodically maintain its own storage-side index even when offline, such as when in an administrative maintenance mode or when the cell's connectivity to the document network 100 is temporarily lost.
[0060] 2.0 Sample Data Access Processing
[0061] Figure 2 is a flow diagram depicting a document network 100 that uses storage-side indexes to accelerate selective access to a distributed collection of hierarchical data objects in an embodiment. Figure 1 Let's discuss Figure 2 .
[0062] Document network 100 may optionally have a central server that additionally performs Figure 2 However, the autonomous storage cells should perform steps 202, 204, and not perform any activity of step 206 or perform some or all activities of step 206 as appropriate. For example, all storage cells 111-112 conditionally and autonomously perform step 204, and for a specific access request, may or may not participate in steps 202 and / or 206.
[0063] As explained herein, the operation of the document network 100 and autonomous storage cells 111-112 can be sensitive to traffic and content. Also as explained herein, this sensitivity can be local to the storage cells, so that reconfiguration of individual storage cells can be autonomous (i.e., locally and independently controlled).
[0064] However, the traffic and content should not be viewed as opaque and / or monolithic. That is, the traffic is actually multiple individual data access requests, each of which may cause operations that can contribute to usage statistics. Data access requests may sometimes be more or less concurrent, sometimes not, and sometimes storage cells may be apparently idle to clients. Thus, for various data access requests, or for no data access requests at all (such as during lazy and incremental initialization (i.e., startup) of the document network 100 or storage cells), Figure 2 The steps shown in can each occur again at various times or be performed autonomously by the storage cell in service.
[0065] For example, storage cell 111 (and / or document network 100) may itself execute concurrently Figure 2 One, some or all of the steps of the process can be activated concurrently, and recurrences of the same step can occur concurrently for the same or different storage cells (such as for different access requests) or spontaneously. Figure 2 All steps of the process, and any or all of these steps may be executed more or less at least once throughout the time that the storage cell 111 (or the document network 100) is in service.
[0066] In other words, and especially under high load, all of these steps may be always ongoing. Thus, the step 202 of persisting the corresponding subset of hierarchical data objects to the persistent storage of the storage cell 111 may occur at an arbitrary / sporadic frequency (such as for a car dealership), or more or less constantly for a stream of hierarchical data objects to be spooled into the storage cell 111 (such as from the Internet of Things (IoT)).
[0067] For example, step 202 may or may not be completed or completely repeated before a subsequent step begins. Storage cell autonomy may be particularly beneficial for taking advantage of optimization opportunities that arise accidentally or intentionally, using horizontal parallelism across multiple storage cells 111-112, as discussed later herein. In some embodiments, storage cells in storage tier 192 may be more scalable than an accompanying set of database server instances (not shown) in compute tier 191. For example, storage cells need not limit system throughput, particularly for autonomous throughput optimization presented later herein.
[0068] Regardless of whether the storage cells 111-112 store the same (i.e., copies) or different content, storage cell autonomy (discussed below) can emphasize the management of storage-side indexes of the storage cells, particularly as discussed later herein. In step 204, the storage cell can store in its memory one or more corresponding storage-side indexes, such as an index that maps content items to the location(s) where each item appears in the local hierarchical data object of the storage cell, or an index that maps items to documents, or both.
[0069] In step 206, data access requests are received and executed by document network 100. For example, DBMS 170 may receive a database query from a client and, in response thereto, send one or more data access requests (such as 180) to one, some, or all of the storage cells. Based on one, some, or all of the storage-side indexes of these storage cells, execution of data access request 180 is accelerated. Storage-side index operations and management will be discussed later in this document.
[0070] 3.0 Storage Cell Autonomy
[0071] Figure 3 is a block diagram depicting an example document network 300 in an embodiment. Document network 300 operates as a data grid of autonomous storage cells and provides location transparency. Document network 300 may be an implementation of document network 100.
[0072] As explained above, each storage cell (such as 311-312) can autonomously maintain its own (one or more) storage-side indexes, such as based on dynamic and local conditions. Each storage cell 311-312 can dynamically decide when, what type, and / or how many instances to load, create, update, tune, persist, and / or discard instances of its own storage-side index. Different example types of storage-side indexes are as follows, and each storage cell can dynamically create or discard instances of them based on fluctuating conditions, such as tracked as local usage statistics 370, as maintained by storage cell 311.
[0073] Usage statistics 370 may include the results of an analysis of data access requests (such as 380), and / or the results of a content analysis of the content of storage cells 311. In an embodiment not shown, document network 300 also maintains global usage statistics. In an embodiment, each of storage cells 311-312 may read and / or write its own local usage statistics (such as 370 or global usage statistics).
[0074] Various embodiments may use Oracle ExaData storage cells as follows. The architecture of the ExaData system is to separate database server compute nodes from storage cell nodes. In particular, when the document network 300 stores JSON documents, the DBMS 305 may accept queries for JSON documents stored in storage cells within the document network 300. As human-readable text, JSON is encoded as a string with an essentially sparse character set. For example, as raw text, the month may be encoded as "September," or densely binary encoded as eight zero-based integer values, which may require four fewer bits and is still denser than the raw text even when aligned to one, two, four, or eight byte boundaries, since the original "September" requires 9 bytes.
[0075] Therefore, binary encoding achieves compression. Depending on the embodiment, the document can be encoded as text or in a binary format (such as OSON, which can be completely or more or less modeless) in transmission and / or storage. For example, a storage cell can store a document as a collection of OSON data blocks, which may or may not be directly accessed by DBMS 305.
[0076] In the OSON embodiment, an integer field name identifier is assigned to each unique field name in the JSON document and is stored only once, so that multiple references to the same field name are replaced with its field name identifier. Because the identifier only takes up a few bytes, when the original document has a nested array of sub-objects or a recursive hierarchy is encoded, the OSON encoding usually saves a lot of space. The greatest benefit of assigning identifiers is that the identifier can facilitate fast navigation to a given sub-field by performing a binary search using integer comparisons. OSON stores the field name identifiers of each object in a sorted order to support this type of access.
[0077] JSON objects may have named fields, may be nested, and may be arranged in arrays. For example, object instances of the same kind of object may all have fields with the same names, even if the values of those fields vary across object instances. OSON compresses arrays of similar (i.e., same set of field names) objects as described below. The original field names or their integer identifiers may be included once in an array, either in the array metadata or in the first element (i.e., the object instance) in the array. Subsequent object instances in the array may omit field names or identifiers to imply that compression is to be achieved.
[0078] OLAP queries issued against JSON documents are driven by table scans and can be pushed down to (one or more) storage cells by evaluating JSON predicates on OSON storage data blocks through the storage cells. Scans involving multiple storage cells are performed in parallel with the OSON content loaded into the flash cache in the storage cells. Therefore, even if cache thrashing does occur: a) the scan is accelerated by horizontal scaling, b) thrashing does not occur in the cache of DBMS 305, and c) thrashing does not incur network traffic, which is a very different performance characteristic from prior art table scans that utilize computers directly through DBMS 305.
[0079] For example, OLTP queries can be index-driven to utilize the DBMS buffer cache of frequently accessed OSON data blocks and index blocks. DBMS 305 can autonomously decide not to delegate OLTP filtering to storage cells 311-312. OLAP queries can be table scan-driven so that they can be autonomously pushed down to storage cells 311-312 that can evaluate JSON predicates on OSON storage blocks. Storage cells 311-312 can perform the same scan in parallel and can cache OSON blocks in their own corresponding caches. Therefore, the query plan can: a) automatically detect the data structure type on which the scan depends, and b) autonomously decide whether to delegate the scan to storage cells 311-312. For example, a table scan representing OLAP can be pushed down to storage cells 311-312. And index scans representing OLTP should not be pushed down, but should be directly executed by the computer of DBMS 305.
[0080] Pushing filtering down to storage cells 311-312 does not require abandoning the use of indexes, since storage cells 311-312 may have storage-side indexes, as discussed later herein. However, query planning by DBMS 305 does not take into account storage-side indexes, and may not discover storage-side indexes that are autonomously and privately created and maintained by each of storage cells 311-312, as discussed later herein. In some cases, indexes in both DBMS 305 and storage cells 311-312 may be used for the same query or even the same scan.
[0081] Even if the DBMS determines that it defines an index that can be used to evaluate the path expression specified in the query, filtering can be pushed to the storage server. In fact, the DBMS treats or classifies the evaluation of the path expression as an OLAP workload rather than an OLTP workload and pushes the evaluation of the path expression to the table scan that the DBMS requests the storage server to perform.
[0082] For example, a DBMS receives a query that references a path-based operator in a predicate based on a path expression. When compiling the query, the DBMS determines that the DBMS defines an index that can be used to evaluate the path expression, but also determines that the selectivity of the path-based operator is low. In response to determining that the selectivity is low, the DBMS is configured to generate an execution including a table scan with a filter that filters documents in a table based on the path expression. When executing the table scan filter, the DBMS requests a storage device to scan the table for documents that satisfy the path expression. The storage cell evaluates the path expression using the storage-side index to determine which data blocks include documents that retain the path expression.
[0083] Although query planning occurs in the DBMS 305 and the algebraic query itself is not relayed to the storage cells 311-312, in an embodiment, the QBE can be delegated more or less directly to the storage cell(s). For example, because an embodiment of the storage cell can support OSON, the storage cells 311-312 can accept OSON-encoded examples and answer with the matches found. The storage cell 311 can be configured for the OSON format and can evaluate JSON path expressions for JSON documents. An example of a path expression that can be evaluated is an oath-based operator for accessing documents, such as JSON. Such an operator is described in U.S. Patent Application No. 14 / 337,189 (U.S. Patent Publication No. 2015-00395 87A1) entitled "Generic SQL Enhancement To Query Any Semi-Structured Data And Techniques To Efficiently Support Such Enhancements". Storage cells configured for scanning database data are described in U.S. Patent No. 8,825,678, entitled “Hash Join Using Collaborative Parallel Filtering In Intelligent Storage With Offloaded Bloom Filters,” and U.S. Patent No. 10,296,462, entitled “Method To Accelerate Queries Using Dynamically Generated Alternate Data Formats In Flash Cache.”
[0084] The storage cell 311 may monitor access requests (such as 380) to detect identical or similar access requests exceeding a threshold frequency, and then autonomously create or remove appropriate kinds of storage-side indexes. The following JSON examples demonstrate some appropriate storage-side index types.
[0085] An example of a frequent filtering data access request is {"dateField":{"$date":DATE-STRING}}, where DATE-STRING is a string in ISO 8601 format. Here, the item method $date transforms DATE-STRING into a SQL value of data type DATE. By creating a B-tree index for it, filtering of fields such as "dateField" can be accelerated. A B-tree index or a bitmap index for the SQL / JSON function json_value can accelerate filtering requests. A bitmap index can accelerate SQL / JSON conditions is json, not json, and json_exists. As long as the number of possible values for the function is small, a bitmap index can be appropriate. For example, if the expected value is a Boolean value or otherwise one of a small number of string values, a bitmap index can be created for the function json_value. Function-based indexing is appropriate for access requests for specific functions, which in the context of SQL / JSON functions means a specific SQL / JSON path expression, which may not be helpful for supporting the execution of ad hoc database queries by DBMS 305. Function-based indexes are appropriate when filtering is frequent using specific path expressions.
[0086] In an embodiment, autonomously set the acceleration in the memory so as to cache the path and value usually searched for with the path-value index format.Each different path is associated with the set of the value of the sorting under this path.Each unique value in the array of sorting is associated with the release list, and this list represents the bitmap of all OSON documents with this value.Path-value index is used to evaluate the path-value data access request (such as the request generated for database query with JSON_EXISTS() or JSON_VALUE()), to perform the set of scanning to generate the document identifier in the memory, and then this document identifier is used to read the corresponding OSON format to carry out later stage evaluation.Path-value index is autonomously set on the storage cell in such a memory.
[0087] Path-valued indexes are described in U.S. Patent Application No. 16 / 022,465, entitled “Techniques for Enabling and Integrating In-Memory Semi-Structured Data and Text Document Searches With In-Memory Columnar Query Processing.” Each path-valued index on a storage cell covers a contiguous region of data blocks, such as a range. These storage-side indexes can be built at startup, and once built, are stored in a persistent high-speed cache. When data blocks are updated in a region, the path-valued index for that region can be invalidated (to prevent use) and then rebuilt. Instead, data access requests to access the region of the path-valued index being rebuilt are evaluated by brute force (i.e., scanning and evaluating the data blocks in the region).
[0088] Storage-side access to spatial data in GeoJSON geometry objects can be accelerated by creating a spatial index. Data access requests generated for full-text queries and / or ad-hoc structured queries (such as the query by example (QBE) operator $contains) can be autonomously accelerated by creating a JSON search index. A JSON search index is a general-purpose schema-agnostic index created on a JSON column by maintaining an inverted index for each JSON field name and each leaf scalar value (a collection of strings marked as keywords to support full-text search). JSON search indexes facilitate ad-hoc SQL / JSON path query predicates such as JSON_EXISTS(), JSON_TEXTCONTAINS(), and JSON_VALUE() that are efficiently evaluated over a collection of documents.
[0089] Generating usage statistics 370 by storage cell 311 may require calculating data cardinality and / or selectivity. Cardinality counts the distinct values of a field, such as the values in a key-value pair (such as a key of "date"). Average selectivity is the ratio of the cardinality to the range of the population (such as a pair whose key is "date"). Based on specific filtering criteria (which may be composite criteria), a specific selectivity is the ratio of the filtered to unfiltered population. For example, a specific selectivity is generated by applying a filtering criteria that may be supplied by a data access request 380, such as based on a filtering expression 390. Hash index 340 may contain all or part of filtering expression 390.
[0090] For highly selective (i.e., exceeding a selectivity threshold) exact path filtering, a hash index can be created. For highly selective range path filtering, a B+tree index can be created, which can be single-valued or multi-valued. For full-text search, a JSON search index on a subset of paths that uses asynchronous mode by default is appropriate. For highly selective multi-valued data, a statement-refreshable json_table() materialized view is appropriate.
[0091] For highly selective path value filtering, it is more beneficial to maintain functional indexes based on synchronized B+ trees. However, maintaining B+ tree indexes degrades DML performance, so a balance should be struck between the number of functional indexes created and their benefits in improving OLTP and OLAP data access performance. Expression execution statistics to find JSON_EXISTS() and JSON_VALUE() expressions commonly used in the WHERE clause in the workload. Expression execution statistics are described in U.S. Patent Application No. 15 / 146,798. Leverage ATP's autonomous index creation efforts to determine if functional index creation is worthwhile.
[0092] For non-highly selective data access, table scans improved on storage cells based on in-memory scans are appropriate. As the term used herein, "in-memory scans" involve scanning a cached version of the persistent form ("PF") of database data in memory. The unit of PF database data is cached in memory in a unit referred to herein as an in-memory compression unit (IMCU). For the same data, the IMCU may have a data format different from the disk block format. For example, a columnar IMCU may denormalize (i.e., separate) data of the same type and meaning, such as the value of a key-value pair of a specific key (such as "color"). Columnar IMCUs may utilize vector hardware (such as a graphics processing unit (GPU) and / or single instruction multiple data (SIMD)) of storage cells, especially for scanning. Columnar IMCUs may include compression such as dictionary encoding or run-length encoding (RLE). For variable-length values, dictionary encoding as a fixed-length code may be suitable for vector hardware that cannot easily handle variable-length values. The content of a columnar IMCU may be OSON encoded.
[0093] An in-memory expression unit (IMEU) is an IMCU that stores derived data, such as filtered and / or transformed data. For example, a columnar IMEU can cache local values of filter expressions that satisfy data access requests. IMCUs and IMEUs are proposed in U.S. Patent Application No. 16 / 144,926.
[0094] "Index All" on JSON collection methods can be used. However, "Index All" is expensive and degraded by heavy DML OLTP / JDOM services. In-memory storage side indexing structures on NVRAM (Non-Volatile Random Access Memory) are more appropriate.
[0095] In some cases, item AB may be used as a key and / or value for storage-side index(es).Based on usage statistics, specific items may be dynamically removed or added to the storage-side index.
[0096] The DBMS 305 can overlay / overlay relational database views (such as 360) based on its own usage statistics (not shown), such as to support and optimize SQL access to hierarchical data objects (such as 321). The database view can have statement refresh and / or materialization. Through view materialization, the DBMS 305 can process the hierarchical data objects 321-322 into tabular data and expose them to the client, which can take advantage of many subsystems of the DBMS 305 (not shown), such as query optimization and usage or content metrics. Similarly, the database view 360 can facilitate relational algebra (such as SQL, such as from the client). When to create the database view 360 can be based on query selectivity of multi-valued data.
[0097] In an embodiment, SODA creates a JSON_TABLE() materialized view (MV) based on data guidance to run queries based on relational algebra (such as SQL on a collection of JSON documents). The usage of the JSON_TABLE() MV is monitored by the DBMS 305 to determine whether efficiency will be improved by fully leveraging and integrating Oracle's autonomous MV creation framework to create the JSON_TABLE() MV.
[0098] In a relational model (i.e., materialized views), not all columns are accessed equally. Columns that are frequently read with high selectivity can guide the RDBMS 305 to create indexes in the RDBMS 305 to improve OLAP queries without adversely affecting random DML on the relational tables that are heavily used by the materialized view. To support materialized views, the RDBMS 305 can have so-called data guidance that infers and preserves the schematic details from a collection of schema-less documents such as JSON.
[0099] In another use case where a collection of JSON documents requires more direct document access than through a database view, a data guide for the collection of JSON documents in the RDBMS 305 is generated by the RDBMS 305 to determine the JSON path and leaf value domain type and / or data type. An example of a data guide is described in U.S. Patent No. 9,864,816, entitled “Dynamically Updating Data Guide For Hierarchical Data Objects.” Based on the data type of the leaf value, an appropriate index may be determined.
[0100] The data guide for leaf data types and paths is a portable mechanism that can be an internal part of a storage cell. Each storage cell can autonomously maintain its own data guide, which can be operated by the storage cell: a) as a storage-side index, b) to facilitate the generation and / or maintenance of other kinds of storage-side indexes, and / or c) to facilitate OSON processing, such as inspection or encoding.
[0101] Commonly accessed JSON paths and their leaf value distribution statistics can be collected by storage cells. Leaf values may be subject to equality testing, value range filtering, full-text search, or GeoJson spatial matching. Since most of this type of data access is generated by the SODA QBE API or data-guided relational view API of DBMS 305, the path / value data domain usage pattern and statistical value distribution can be maintained internally by the storage cell based on its own local JSON document collection. Based on the usage pattern of data access requests, storage cells that execute these patterns can be accelerated without affecting the DML in DBMS305. Such acceleration adjustments can be determined autonomously by each storage cell. Therefore, the statistics and / or data guidance of the storage cell can provide important metadata, and the storage cell can make autonomous decisions based on these metadata for self-management of various optimization structures (such as storage-side indexes). Therefore, autonomy can be data-driven (i.e., opportunity adjustment) for agility in a way that existing storage layers cannot support due to the lack of embedded intelligence.
[0102] Storage-side indexing and overall efficiency may be more affected by traffic / usage. One or both types of usage may dominate, and the stereotypes may be antagonistic and potentially degrading (i.e., degrading each other's efficiency).
[0103] Read-only usage is a typical application of reporting and multidimensional analysis, such as for OLAP, such as in a data warehouse. Read-only usage tends to be sequential, such as for scans, which may thrash the cache of (e.g., OSON) blocks, records, rows, or documents. Indexes provide the greatest benefit for read-only usage.
[0104] Variable usage is a typical application of real-time systems, such as OLTP, such as for data entry and / or transactions. Variable usage tends to require random access and small working data sets, which can be fixed to cache, but may put pressure on frequently changing indexes.
[0105] In an embodiment, the document network 300 may provide both OLAP and OLTP for different or the same hierarchical data objects. Interference (i.e., degraded performance) may occur when the same storage cell is subjected to both uses more or less concurrently. For example, patterns evident in the local usage statistics 370 of the storage cell 311 may become, which may limit the logical selection optimization of the storage cell. This mixed use may overload the storage-side indexes and / or thrashing caches in the storage cell 311. Therefore, mixed use may reduce the throughput of the storage cell 311 and / or the document network 300. Mixed use may also reduce or eliminate the performance advantages of storage cell autonomy.
[0106] In an embodiment, to maintain throughput, the document network 300 may route client sessions and / or specific access requests to (one or more) specific storage cells with relevant replica content. For example, OLAP and OLTP may be routed to corresponding storage cells 311-312 with partially or fully replicated content. Replica consistency (i.e., synchronization) may be streamed (such as in real time), or scheduled (such as hourly or nightly). For example, daily, weekly, and monthly reports do not require real-time replication. Similarly, data scientists engaged in product research and development (R&D) do not need real-time replication. In an embodiment, the document network 300 includes (one or more) public clouds and / or private clouds, such as with elastic horizontal scaling (i.e., spontaneous replication). In an embodiment, replication is synchronous and supports ACID transactions. In an embodiment, replication is asynchronous (i.e., final).
[0107] Regardless of topological issues (such as replication and scaling), the throughput of storage cells 311-312 and document network 300 can benefit from traffic shaping, enabling separation of OLAP and OLTP. The autonomy of each storage cell benefits from separation of traffic and / or content because the local workload of each storage cell can be more consistent and focused, which can produce clearer patterns in usage statistics 370. When storage cells 311-312 are autonomous, each cell can automatically manage and tune storage-side indexes and caches (such as IMCUs) for its own local content and workload, thereby achieving optimal local throughput for each storage cell, which directly contributes to optimal global throughput for document network 300.
[0108] For example, if hierarchical data objects 321-322 are purchase orders, querying the current month's orders can emphasize order content such as line items. Querying the previous month's orders can emphasize payment and shipping status. Therefore, even if all traffic to some or all storage cells is for OLAP, isolating (i.e., assigning) hierarchical data objects 321-322 by content can increase throughput. For example, hierarchical data objects 321-322 can be assigned to storage cells 311 by month of purchase orders, thereby better utilizing storage cell autonomy.
[0109] 4.0 Example of autonomous tuning process
[0110] Figure 4 is a flow chart depicting an embodiment in which the document network 300 operates as a data grid of autonomous storage cells and provides location transparency. Figure 3 Let's discuss Figure 4 .
[0111] Document network 300 has many storage cells (such as 311-312), which may have partitioned and / or replicated content. In some examples, document network 300 may need to select (one or more) storage cells to participate in the execution of data access request 380, perhaps based on the workload and / or content of the storage cells, the content of data access request 380, the type of data access request 380, and / or the type of client session.
[0112] In step 401, the type of data access request 380 and / or the type of client session is checked to select which of the storage cells 311-312 should execute the data access request 380. As shown, OLAP access is routed to storage cell 311, and OLTP access is routed to storage cell 312, in accordance with corresponding steps 402-403. Thus, storage cell 311 naturally tunes its storage-side index for OLAP, and storage cell 312 is tuned for OLTP. Autonomous tuning can occur without explicitly informing the storage cells 311-312 that their respective usage is designated as OLAP or OLTP.
[0113] Steps 404-406 may occur in a variety of orders other than that shown.Steps 404-405 are performed by the selected storage cell(s) (such as 311 for OLAP) and involve the use and / or management of the storage-side index of the storage cell.
[0114] Step 404 uses hash index 340, such as a path pattern index or other filter pattern index. For example, expression 390 may be a filter expression, such as a partial or entire WHERE clause or XPath, which is used as a lookup key into hash index 340 residing in memory 330 (which may be fast RAM). Hash index 340 may return an identifier of a hierarchical data object stored in a storage cell and / or a location or identifier of an item within a hierarchical data object.
[0115] The storage cell 311 can autonomously update its storage side index in response to access requests, schedules and / or resource requirements. Based on the usage statistics 370, step 405 dynamically removes or adds items to the storage side index. For example, the data access request 380 can carry a new hierarchical data object to persist in the storage cell 311. The new hierarchical data object can contain items that can be reached by traversal paths within the new hierarchical data object, and these traversal paths match the path patterns already stored in the storage side index. The mapping of these path patterns can be updated in the storage side index to include the locations of these items in the new hierarchical data object.
[0116] The storage cell 311 can autonomously create or discard optimization metadata in response to access requests, schedules, and / or resource requirements. In response to a threshold frequency, such as selectivity or other aspects of usage statistics 370, step 406 creates or discards storage-side indexes, local relationship views, local caches, and / or local IMCUs. For example, when the use ratio of random access to sequential is below a threshold, the cache can be reduced or discarded and / or the storage-side index can be discarded. When memory availability drops below a threshold, the IMCU can be discarded and / or the cache can be reduced or discarded.
[0117] A threshold frequency of query(s) or join(s) measured by the RDBMS may cause the RDBMS to create or discard database views that may span the content of one, some, or all storage cells. The database views or their view tables may be further manipulated by the RDBMS to measure statistics of the content and / or usage of the document network 300. Thus, the RDBMS may maintain centralized statistics for RDBMS optimization that are orthogonal to (i.e., separate from) local statistics in storage cells.
[0118] 5.0 Example Storage Cell
[0119] Figure 5 is a block diagram depicting an example autonomous storage cell 500 in an embodiment. Storage cell 500 has a storage-side index that is content-oriented in various ways. Storage cell 500 may be an implementation of storage cell 111.
[0120] Each of the documents 521-522 can be stored as a self-contained unit, such as a blob, a byte array, a data structure, or a document object model. In an embodiment, the documents 521-522 are exchanged with the client and / or stored in the storage cell 111 in binary encoding (such as a data structure, such as Oracle's OSON (i.e., binary JSON)). For example, the client driver can perform bidirectional transcoding between OSON and JSON, between OSON and a custom document object model (DOM), between OSON and a proprietary application programming interface (API), and / or between OSON and a traditional object model, such as using a data binding and / or marshaling framework. In an embodiment, the self-contained binary format contains the document and (one or more) indexes (such as project EH or IJ) dedicated to accessing the inside of the document.
[0121] An example implementation of OSON is described in the related U.S. Patent No. 10,262,012 entitled "Techniques Related to Binary Encoding of Hierarchical DataObjects to Support Efficient Path Navigation of the Hierarchical DataObjects". OSON supports more efficient query execution and partial updates of JSON documents. Specifically, OSON enables fast storage-side index maintenance during DML by, among other things, reducing redo logging overhead and accelerating path queries, thereby making partial JSON document updates possible because the OSON format itself is a DOM tree.
[0122] In an embodiment, documents 521-522 may be persisted in a relational database. For example, document 521 may be stored as a binary / character large object (i.e., BLOB or CLOB). Alternatively, document 521 may be logically sharded into separate fields to be stored in separate columns and / or separate tables of a relational database.
[0123] Regardless of the encoding details such as binary or raw text, when the document 521 is stored as a self-contained unit, the use of the storage location and / or identifier of the entire document can speed up access. For example, the storage-side index 541 can be a document index containing the location or identifier of the document (such as 511-512). Depending on the embodiment, the document identifiers 511-512 can be globally unique across the document network, or only locally unique within the storage cell 500.
[0124] In an IMCU embodiment, document identifiers 511-512 may be unique only within an IMCU. For example, document identifiers 511-512 may be offset into an IMCU. For example, a columnar IMCU stores only values of items of the same type (such as color). For example, when document identifiers 511-512 are offset into a pair of columnar IMCUs that store the color and date of the same document in the same order, respectively, an offset selected from one IMCU may be used to cross-reference another IMCU.
[0125] In addition, the bitmap index(es) may be restricted to a specific IMCU, and in some cases, compound filtering may be achieved by bitwise merging or splitting of IMCU bitmaps for different columns / fields. These bitmaps may be created lazily, such as only for the current access request. In a database embodiment, the document identifiers 511-512 may be used as primary keys for accessing corresponding documents 521-522, which may each be stored as a BLOB in a table column.
[0126] Each item EH can conform to a corresponding data type, such as a weak type (such as text) or a strong type (such as a timestamp). Strong typing can facilitate additional optimizations in time and / or space. For example, due to time zones, the original text of a Chicago timestamp and a Boston timestamp may be alternate representations of the same UTC time, so although they are not literally equivalent, they are semantically equivalent. When timestamps have the same canonical encoding internally, scanning of timestamps can be accelerated by avoiding data conversion.
[0127] Storage-side indexing can also be accelerated when separated by item type, as opposed to a single, single storage-side index of the raw text of the difference item. For example, storage-side index 541 can be dedicated to timestamp items, and storage-side index 542 can be dedicated to another strongly typed or raw text. Separated storage-side indexes can also benefit storage cell autonomy, as one storage cell can primarily process timestamps while another storage cell can primarily process another data type. Forcing two storage cells to use corresponding storage-side indexes only for the same data type will reduce local and global throughput. For example, storage cell 500 can autonomously decide which data types are worthy of storage-side indexing based on local traffic and the contents of storage cell 500.
[0128] Some data types, while appearing as items within content, may have data types of a structural nature. For example, an item may represent an XML tag, for which a "tag" data type may exist. Similarly, an item may represent a key of a key / value pair (such as a JSON dictionary key or an XML attribute name), for which a "key" data type may exist. For example, the storage-side index 541 may be
[0129] Because documents 521-522 are hierarchical internally, items can be nested. For example, item I contains item J, such as for an element in XML form or an array or dictionary in OSN or JSON form. Queries such as path queries (such as XPath) can be accelerated by hierarchical indexes such as path indexes. For example, if storage-side index 541 is a path index, then storage-side index 541 can reflect that item I contains item J.
[0130] 6.0 Example Storage-side Index Management Processing
[0131] Figure 6 is a flow chart depicting a storage cell 500 that uses and manages a content-oriented storage-side index in various ways in an embodiment. Figure 5 Let's discuss Figure 6 .
[0132] Figure 6 The steps performed by the storage cell 500 are shown. Depending on the example and / or embodiment, some of these steps are reordered or skipped. For example, some of these steps support reading, some steps support writing, and some steps support reading and writing.
[0133] If the storage cell 500 persists the document 521-522 in binary format, then when (one or more) clients send the document 521-522 in binary format, efficiency can be improved as follows. Step 601 is such as receiving the document 521-522 in binary format (such as OSON) from the client. The binary format can be denser than text and therefore consumes less network bandwidth. The operation of simply encoding the original document into binary format may require computer resources, which can benefit from horizontal scalability when each client performs this binary encoding. This prevents the document network from becoming a bottleneck for concurrent encoding by multiple clients.
[0134] Step 602 detects which local documents are relevant to the access request. For example, a path index or other storage-side index in memory may be queried to obtain identifiers of potentially relevant documents. For example, the storage-side index may identify documents relevant to the query. The same or a different storage-side index may indicate whether the document has been persisted, such as when automatically deciding whether to insert a document as a new document or to selectively update (one or more) portions of the document instead.
[0135] Step 603 persists the received document(s). This may require persisting the document in binary format, such as upon receipt or by dynamically encoding the document into binary. The document may be persisted to a file system and / or a database. Persistence to a database may be as is (e.g., BLOB) or according to decomposition (such as sharding the document into fields to persist it as table columns).
[0136] As explained above, for each of several item data types, there may be a separate instance of a storage-side index, and / or some kinds of storage-side indexes may be restricted to some kinds of items. Step 604 selects the kind and / or instance of a storage-side index for accessing items based on what data type the item is. For example, a JSON dictionary entry or an XML tag item may require a hierarchical index that may have been constructed using additional structured information (such as a document type descriptor (DTD), an XML schema, or other schematic descriptors of the document structure), or may not have been constructed using additional structured information. For example, step 605 uses a hierarchical index that indicates a containment relationship between items, such as a count or location of child items for a given parent item.
[0137] Step 606 updates the already persisted document(s). For example, the storage cell 500 may automatically decide whether to overwrite (i.e., completely replace) the document, or alternatively selectively update only the changed items in the document. The document update may require updating one or more storage-side indexes based on the items that actually changed within the document.
[0138] For a query, the document network can return matching documents to the client. For example, if the documents are stored as binary, then the matching documents can be returned as binary (for reduced size and / or horizontal scalability) by step 607, or decoded into text by the storage cell 500 before returning them.
[0139] Hardware Overview
[0140] According to one embodiment, the technology described herein is implemented by one or more special-purpose computing devices. The special-purpose computing device can be hard-wired to perform these technologies, or can include digital electronic devices (such as one or more application-specific integrated circuits (ASICs) or field programmable gate arrays (FPGAs) that are permanently programmed to perform these technologies), or can include one or more general-purpose hardware processors that are programmed to perform these technologies according to program instructions in firmware, memory, other storage devices, or combinations. Such special-purpose computing devices can also combine customized hard-wired logic, ASICs, or FPGAs with customized programming to implement these technologies. The special-purpose computing device can be a desktop computer system, a portable computer system, a handheld device, a networking device, or any other device that combines hard-wiring and / or program logic to implement these technologies.
[0141] For example, Figure 77 is a block diagram illustrating a computer system 700 upon which embodiments of the present invention may be implemented. Computer system 700 includes a bus 702 or other communication mechanism for communicating information, and a hardware processor 704 coupled with bus 702 for processing information. Hardware processor 704 may be, for example, a general purpose microprocessor.
[0142] The computer system 700 also includes a main memory 706, such as a random access memory (RAM) or other dynamic storage device, coupled to the bus 702 for storing information and instructions to be executed by the processor 704. The main memory 706 may also be used to store temporary variables or other intermediate information during the execution of instructions executed by the processor 704. These instructions, when stored in a non-transitory storage medium accessible to the processor 704, make the computer system 700 a special-purpose machine customized to perform the operations specified in the instructions.
[0143] Computer system 700 also includes a read only memory (ROM) 708 or other static storage device coupled to bus 702 for storing static information and instructions for processor 704. A storage device 710, such as a magnetic disk, optical disk, or solid state drive, is provided and coupled to bus 702 for storing information and instructions.
[0144] The computer system 700 may be coupled to a display 712, such as a cathode ray tube (CRT), via the bus 702 for displaying information to a computer user. An input device 714, including alphanumeric and other keys, is coupled to the bus 702 for communicating information and command selections to the processor 704. Another type of user input device is a cursor control 716, such as a mouse, trackball, or cursor direction keys, for communicating direction information and command selections to the processor 704 and for controlling cursor movement on the display 712. Such input devices typically have two degrees of freedom in two axes, a first axis (e.g., x) and a second axis (e.g., y), which allows the device to specify a position in a plane.
[0145] Computer system 700 may implement the techniques described herein using custom hardwired logic, one or more ASICs or FPGAs, firmware, and / or program logic that is combined with a computer system to make or program computer system 700 into a special purpose machine. According to one embodiment, computer system 700 performs the techniques described herein in response to processor 704 executing one or more sequences of one or more instructions contained in main memory 706. These instructions may be read into main memory 706 from another storage medium, such as storage device 710. Execution of the sequences of instructions contained in main memory 706 causes processor 704 to perform the process steps described herein. In alternative embodiments, hardwired circuitry may be used in place of or in combination with software instructions.
[0146] The term "storage medium" as used herein refers to any non-transitory medium that stores data and / or instructions that cause a machine to operate in a particular manner. Such storage media may include non-volatile media and / or volatile media. Non-volatile media include, for example, optical disks, magnetic disks, or solid-state drives, such as storage device 710. Volatile media include dynamic memory, such as main memory 706. Common forms of storage media include, for example, floppy disks, flexible disks, hard disks, solid-state drives, magnetic tapes or any other magnetic data storage media, CD-ROMs, any other optical data storage media, any physical media with a pattern of holes, RAM, PROMs and EPROMs, FLASH-EPROMs, NVRAMs, any other memory chips, or cassette tapes.
[0147] Storage media are distinct from but can be used in conjunction with transmission media. Transmission media participate in the transfer of information between storage media. For example, transmission media include coaxial cables, copper wire, and optical fiber, including the wires that comprise bus 702. Transmission media can also take the form of acoustic or light waves, such as those generated during radio wave and infrared data communications.
[0148] Various forms of media may be involved in transmitting one or more sequences of one or more instructions to the processor 704 for execution. For example, the instructions may initially be carried on a disk or solid-state drive of a remote computer. The remote computer may load the instructions into its dynamic memory and send the instructions over a telephone line using a modem. A modem local to the computer system 700 may receive the data over the telephone line and convert the data into an infrared signal using an infrared transmitter. An infrared detector may receive the data carried in the infrared signal, and appropriate circuitry may place the data on the bus 702. The bus 702 carries the data to the main memory 706, from which the processor 704 retrieves and executes the instructions. The instructions received by the main memory 706 may optionally be stored on the storage device 710 before or after execution by the processor 704.
[0149] The computer system 700 also includes a communication interface 718 coupled to the bus 702. The communication interface 718 provides a two-way data communication coupled to a network link 720, which is connected to a local network 722. For example, the communication interface 718 can be an integrated services digital network (ISDN) card, a cable modem, a satellite modem, or a modem that provides a data communication connection with a corresponding type of telephone line. As another example, the communication interface 718 can be a local area network (LAN) card to provide a data communication connection with a compatible LAN. A wireless link can also be implemented. In any such implementation, the communication interface 718 sends and receives electrical signals, electromagnetic signals, or optical signals that carry digital data streams representing various types of information.
[0150] The network link 720 typically provides data communication to other data devices through one or more networks. For example, the network link 720 can provide a connection to a host computer 724 or to data equipment operated by an Internet Service Provider (ISP) 726 through a local network 722. The ISP 726 in turn provides data communication services through a global packet data communication network (now commonly referred to as the "Internet" 728). Both the local network 722 and the Internet 728 use electrical, electromagnetic, or optical signals that carry digital data streams. The signals through the various networks and the signals on the network link 720 and through the communication interface 718 (which carry the digital data to and from the computer system 700) are example forms of transmission media.
[0151] Computer system 700 can send messages and receive data, including program code, through the network(s), network link 720, and communication interface 718. In the Internet example, server 730 can send the requested code for an application program through Internet 728, ISP 726, local network 722, and communication interface 718.
[0152] The received code may be executed by processor 704 as it is received, and / or stored in storage device 710 or other non-volatile storage for later execution.
[0153] Software Overview
[0154] Figure 8 8 is a block diagram of a basic software system 800 that may be used to control the operation of computer system 700. Software system 800 and its components (including their connections, relationships, and functions) are merely exemplary and are not meant to limit implementation 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.
[0155] Software system 800 is provided for directing the operation of computing system 700. Software system 800, which may be stored on system memory (RAM) 706 and storage device 710, includes a kernel or operating system (OS) 810.
[0156] The OS 810 manages low-level aspects of computer operation, including managing the execution of processes, memory allocation, file input and output (I / O), and device I / O. One or more applications, represented as 802A, 802B, 802C ... 802N, may be "loaded" (e.g., transferred from storage device 710 into memory 706) for execution by the software system 800. Applications or other software intended for use on the computer system 700 may also be stored as a downloadable set of computer-executable instructions for downloading and installation, for example, from an Internet location (e.g., a Web server, app store, or other online service).
[0157] The software system 800 includes a graphical user interface (GUI) 815 for receiving user commands and data in a graphical manner (e.g., "clicks" or "touch gestures"). In turn, these inputs can be operated by the software system 800 according to instructions from the operating system 810 and / or (one or more) applications 802. The GUI 815 is also used to display the results of the operations from the OS 810 and (one or more) applications 802, based on which the user can provide additional input or terminate the session (e.g., log out).
[0158] The OS 810 may execute directly on the bare hardware 820 (e.g., the processor(s) 704) of the computer system 700. Alternatively, a hypervisor or virtual machine monitor (VMM) 830 may be inserted between the bare hardware 820 and the OS 810. In this configuration, the VMM 830 acts as a software "buffer" or virtualization layer between the OS 810 and the bare hardware 820 of the computer system 700.
[0159] VMM 830 instantiates and runs one or more virtual machine instances ("guests"). Each client includes a "guest" operating system (such as OS 810), and one or more applications (such as (one or more) applications 802) designed to execute on the guest operating system. VMM 830 presents a virtual operating platform to the guest operating system and manages the execution of the guest operating system.
[0160] In some instances, VMM 830 can allow a guest operating system to run as if it were running directly on bare hardware 820 of software system 800. In these instances, the same version of a guest operating system that is configured to execute directly on bare hardware 820 can also execute on VMM 830 without modification or reconfiguration. In other words, VMM 830 can provide full hardware and CPU virtualization to guest operating systems in some cases.
[0161] In other instances, the guest operating system may be specially designed or configured to execute on the VMM 830 to improve efficiency. In these instances, the guest operating system is "aware" that it is executing on a virtual machine monitor. In other words, the VMM 830 may provide paravirtualization to the guest operating system in certain circumstances.
[0162] A computer system process includes an allocation of hardware processor time, as well as an allocation of memory (physical and / or virtual), an allocation of memory for storing instructions executed by the hardware processor, for storing data generated by the execution of instructions by the hardware processor, and / or for storing hardware processor state (e.g., contents of registers) between allocations of hardware processor time when the computer system process is not running. A computer system process runs under the control of an operating system and may run under the control of other programs executing on the computer system.
[0163] cloud computing
[0164] The term "cloud computing" is used generally herein to describe a computing model that enables on-demand access to a shared pool of computing resources, such as computer networks, servers, software applications, and services, and allows resources to be rapidly provisioned and released with minimal management effort or service provider interaction.
[0165] A cloud computing environment (sometimes referred to as a cloud environment or just 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 the public. In contrast, a private cloud environment is generally intended 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 includes two or more types of clouds (e.g., private, community, or public) bound together by data and application portability.
[0166] In general, the cloud computing model enables some of those responsibilities that may have previously been provided by an organization's own information technology department to be delivered instead as a service layer within the cloud environment for use by consumers (either internally or externally to the organization, depending on the public / private nature of the cloud). Depending on the specific implementation, the precise definition of the components or features provided by or within each cloud service layer may vary, but common examples include: Software as a Service (SaaS), in which consumers use software applications running on the cloud infrastructure, while the 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 the 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 under the runtime execution environment). Infrastructure as a Service (IaaS), in which consumers can deploy and run arbitrary software applications, and / or provide processes, storage, networks, and other basic computing resources, while the IaaS provider manages or controls the underlying physical cloud infrastructure (i.e., everything below the operating system layer). Database as a Service (DBaaS), where the consumer uses a database server or database management system running on a cloud infrastructure, while the DbaaS provider manages or controls the underlying cloud infrastructure and applications.
[0167] The above basic computer hardware and software and cloud computing environment are presented to illustrate the basic underlying computer components that can be used to implement the example embodiment(s). However, the example embodiment(s) are not necessarily limited to any particular computing environment or computing device configuration. Instead, the example embodiment(s) can be implemented in any type of system architecture or processing environment that a person skilled in the art will understand in light of the present disclosure as being capable of supporting the features and functions of the example embodiment(s) presented herein.
[0168] In the foregoing specification, embodiments of the present invention have been described with reference to numerous specific details, which may vary from implementation to implementation. Therefore, the specification and drawings should be viewed in an illustrative rather than a restrictive sense. The sole and exclusive indicator of the scope of the invention and what the applicant intends to be the scope of the invention is the literal and equivalent range of the resulting claims in the specific form of the set of claims issued from this application, including any subsequent corrections.
Claims
1. A computer-implemented method for accessing JavaScript Object Representation (JSON) in a storage layer, comprising: Each storage cell in the plurality of storage cells in the storage layer performs: persisting a corresponding subset of the plurality of JSON objects residing in a database of a database management system (DBMS) connected to the plurality of storage cells, and autonomously generating and storing, in the volatile memory of the storage cell, without accessing a schema describing the corresponding subset of JSON objects, a corresponding storage-side index of the plurality of storage-side indexes in the volatile memory of the plurality of storage cells, the corresponding storage-side index mapping each item of the corresponding plurality of items to one or more locations where the item occurs in one or more JSON objects in the corresponding subset of JSON objects; A data access request from the DBMS requesting a JSON object satisfying a path expression is executed based on at least a subset of the plurality of storage-side indexes in the volatile memory of the plurality of storage cells.
2. The computer-implemented method of claim 1, further comprising autonomously removing or adding items to corresponding storage-side indexes of storage cells in the plurality of storage cells based on usage statistics.
3. The computer-implemented method of claim 1 , further comprising autonomously adding or removing storage cells from the plurality of storage cells based on usage statistics: Hash index, B+ tree functional index, JSON search index, including: Path subsets and / or asynchronous modes, Feature space index, In-Memory Compression Unit (IMCU), and / or The indices of all items in the corresponding subset of the JSON object.
4. The computer-implemented method of claim 3, wherein: The data access request includes at least one expression from among a plurality of expressions; The hash index includes a hash value for each expression in the plurality of expressions; Executing the data access request includes using a hash index based on the at least one expression.
5. The computer-implemented method of claim 1 , further comprising the storage cell creating a storage-side index and / or IMCU in response to a threshold frequency of: equality path queries and / or range path queries that exceed a threshold selectivity, Queries that do not exceed the threshold selectivity, Full text search, and / or Spatial query.
6. The computer-implemented method of claim 1, wherein: The plurality of storage cells include a first storage cell and a second storage cell; The corresponding subset of the JSON objects of the first storage cell includes the corresponding subset of the JSON objects of the second storage cell; Executing the data access request includes: based on the data access request, selecting only one of the first storage cell and the second storage cell to execute the data access request.
7. The computer-implemented method of claim 6, wherein said selecting said only one storage cell comprises dynamically: When the DBMS sends a data access request in response to an online analytical processing (OLAP) query, selecting a first storage cell; When the DBMS sends a data access request in response to an online transaction processing (OLTP) write, a second storage cell is selected.
8. The computer-implemented method of claim 1, wherein: The corresponding plurality of items includes a plurality of item data types; Storing the corresponding storage-side index of each item of the mapping includes: selecting a storage-side index from a plurality of corresponding storage-side indexes based on a data type of the item.
9. The computer-implemented method of claim 1 , wherein persisting the corresponding subset of JSON objects comprises: Receive a corresponding subset of the JSON object in binary format, and / or A corresponding subset of JSON objects is persisted in binary format and / or in said database being a relational database.
10. The computer-implemented method of claim 1 , wherein executing the data access request comprises: obtaining from the memory an identifier of at least one JSON object of a corresponding subset of JSON objects, Updates at least one JSON object of the corresponding subset of JSON objects, and / or At least one JSON object among the plurality of JSON objects is returned to the client in a binary format.
11. The computer-implemented method of claim 1 , wherein: Data access requests include path queries; Executing the data access request includes using a hierarchical index indicating a containment relationship between the corresponding plurality of items, and / or The plurality of JSON objects include: documents, JavaScript Object Notation (JSON), Extensible Markup Language (XML), and / or key-value pairs.
12. The computer-implemented method of claim 1, further comprising the DBMS generating, in the database, a relational view based on the plurality of JSON objects and including statement refresh and / or materialization.
13. One or more non-transitory computer-readable media storing one or more sequences of instructions that, when executed by one or more processors, cause performance of the computer-implemented method of any one of claims 1-12.
14. An apparatus for accessing JavaScript Object Notation (JSON) in a storage layer, comprising: one or more processors; as well as A memory coupled to the one or more processors and comprising instructions stored thereon, which, when executed by the one or more processors, cause the computer-implemented method of any one of claims 1-12 to be performed.
15. A computer program product comprising instructions which, when executed by one or more processors of a computer, cause the computer to perform the computer-implemented method of any one of claims 1-12.
