Patent Description:
Database management systems have become an integral part of many computer systems. For example, some systems handle hundreds if not thousands of transactions per second. On the other hand, some systems perform very complex multidimensional analysis on data. In both cases, the underlying database may need to handle responses to queries very quickly in order to satisfy systems requirements with respect to transaction time. Data stored by such systems may be stored using various schemas. Given the complexity of queries, volume of data stored, and/or their volume, the underlying databases face challenges in order to optimize performance.

<CIT>) describes a data storage and retrieval system for a computer memory configured according to a columnar document store adapted to contain documents.

<NPL>, describes a native JSON datatype and how it is integrated with the Oracle Database ecosystem to transform Oracle Database into a mature platform for serving both SQL and NoSQL access paradigms.

The claimed invention is defined by the independent claims. Embodiments are set out in the dependent claims.

Such computing systems can be connected and can exchange data and/or commands or other instructions or the like via one or more connections, including but not limited to a connection over a network (e.g., the Internet, a wireless wide area network, a local area network, a wide area network, a wired network, or the like), via a direct connection between one or more of the multiple computing systems, etc..

To address these and potentially other deficiencies of currently available solutions, one or more implementations of the current subject matter relate to methods, systems, articles of manufacture, and the like that can, among other possible advantages, provide for an ability to use structure (e.g., self-maintaining) and/or schema information for faster data access in a document store.

Database management systems and operations performed on the data managed by a database management system have become increasingly complex. For example, a database management systems (or database for short) may support relatively complex online analytical processing (OLAP, which may perform multi-dimensional analysis) to more straightforward transaction-based online transaction processing (OLTP). Moreover, the database may be configured as a row store database or column store database, each of which may have certain aspects with respect to queries and other operations at the database. For example, the database may encode data using dictionaries, while some databases may not. In addition to these various databases layer differences, the queries performed at a database may include a complex sequence of operations in order to generate corresponding responses. To implement the complex sequence, a query execution plan (or query plan for short) may be implemented. The query plan may represent a sequence of operations, such as instructions, commands, and/or the like, to access data in the database. The database may also include a query plan optimizer to determine an efficient way to execute the query plan.

From an application or client perspective, it may be extremely cumbersome to access databases. For example, an application may need to query different types of databases using complex queries. As a consequence, the application layer may need to be configured to handle the various types of databases and various query types. Additionally or alternatively, each database may need to process queries from the application into a format and structure that can be handled by the given database. Pushing complex operations and support for a variety of different database types to the application layer may contravene the need to have relatively lighter weight and/or readily deployable applications. On the other hand, pushing complex operations to the database layer where data is stored may draw processing and/or memory resources at the database and may thus reduce the performance and response times for queries on that database layer.

File storage and/or processing systems may be centralized through the use of one or more servers, which can offload processing and/or storage from client devices accessing the one or more servers. However, although servers may make it easier and/or more convenient for users to store/access data from virtually anywhere, servers may still only have a limited processing and/or storage capacity (e.g., a server or set of servers may only be able to process so many things at one time without degrading performance). Hence, owners/operators of servers may wish to optimize processing procedures performed at the servers. Thus, at least some of the subject matter described herein relates to systems and methods for managing, storing, and/or accessing data in a document store. As used herein, data may refer to semi-structured data, electronic documents such as JSON documents, and/or the like.

Database systems may store data using one or more partitions or slices. A partition in a database may refer to a division of a logical database or its elements into separate independent parts. Partitioning allows improved manageability, performance, load balancing, etc. In some cases, partitions may be distributed over multiple nodes, where each node may allow users to perform various operations (e.g., execution of transactions, etc.) on a partition. Such distribution may increase performance for nodes that may be subject to frequent transactions that may involve retrieval, insertion, modification, generation of views of data, etc. while at the same time maintaining availability and security of data. Data partitioning may be performed by building separate smaller databases, splitting selected elements, etc. Data may be partitioned using horizontal or vertical partitioning methodologies. A horizontal partitioning may place different rows into different tables (e.g., splitting users of different age groups). A vertical partitioning may create new tables having fewer columns and may use additional tables to store any remaining columns.

<FIG> illustrates an exemplary system <NUM> for using structure (e.g., self-maintaining) and/or schema information for a faster access to data stored in a document store, according to some implementations of the current subject matter. The system <NUM> may include one or more users (user <NUM>, user <NUM>,. user n) <NUM>, a computing system <NUM>, and a database system <NUM>, which may include a relational store <NUM> that may store one or more table(s) <NUM>, and a document store <NUM> that may store one or more document(s) <NUM> and/or dictionary(ies) <NUM>. The users <NUM>, the computing system <NUM>, the database system <NUM>, the relational store <NUM>, and/or the document store <NUM> may be communicatively coupled with one another using any type of network, including but not limited to, wired, wireless, and/or a combination of both. The users <NUM> may include at least one of the following: computer processors, computing networks, software applications, servers, user interfaces, and/or any combination of hardware and/or software components. Database system <NUM> may include at least one of the following: databases, storage locations, memory locations, and/or any combination of hardware and/or software components. In some implementations, the database system <NUM> may be a HANA Database system, as developed by SAP SE, Walldorf, Germany, as will be described below (HANA was previously known as High-Performance Analytic Appliance).

The computing system <NUM> may include any combination of software and/or hardware components and may be configured to receive and execute a query from one or more users <NUM> to obtain data in one or more tables <NUM> in the relational store <NUM>, insert data into one or more tables <NUM> in the relational store <NUM>, modify data stored in one or more tables <NUM> in the relational store <NUM>, delete data stored in one or more tables <NUM> in the relational store <NUM>, generate one or more new tables <NUM> (e.g., for insertion of new data), etc., and any combination thereof. In some implementations, the computing system <NUM> (which may include a query execution engine) may be included in the database system <NUM>. Data may be inserted, modified, deleted, etc., new tables may be created, existing tables may be modified, deleted, etc., which may cause modification of an existing data storage structures. In the document store <NUM>, documents (e.g., JSON documents) may be stored using one or more slices. When an amount of data stored in the document store <NUM> increases, one or more slices may be added to accommodate for storage of additional data.

Execution of a query may typically require generation of a query plan or query execution plan, which may be an ordered set of operations that may be used to access stored data (e.g., access data in a SQL relational database management system). Upon submission of a query to the database system <NUM>, requested data may be retrieved based on parameters of the query. The retrieved data may be aggregated/joined with any other data that may be sought by the user. Insertion, modification, deletion, etc. of data in the database system <NUM> may be performed using various SQL or other statements.

As stated above, the database system <NUM>, and in particular its relational store <NUM>, may be used to store various data arranged in one or more tables <NUM>. The stored data may be modified, by way of a non-limiting example, through one or more data manipulation language ("DML") processes, which may include one or more operations, including but not limited to, INSERT (e.g., insertion of data into an existing data at a predetermined offset or location), UPDATE (e.g., modification of stored data), and DELETE (e.g., deletion of stored data). Additionally, for example, the stored data may be affected using various data definition language ("DDL") statements, which may include creation of various schema for data storage. In some implementations, the database system <NUM> may include one or more servers, processors, memory locations, cloud computing components/systems, etc. that may be used for accessing data.

The database table(s) <NUM> may include at least one column, which may be accessed by the computing system <NUM>. The database table(s) <NUM> may store any kind of data. For example, the data may include, but is not limited to, definitions of business scenarios, business processes, and one or more business configurations as well as transactional data, metadata, master data, etc. relating to instances or definitions of the business scenarios, business processes, and one or more business configurations, and/or concrete instances of data objects and/or business objects that are relevant to a specific instance of a business scenario, business process, and/or the like.

Additionally, the computing system <NUM> may access the document store <NUM> (also referred to herein as "document storage") that may include any number of documents <NUM> and/or dictionaries <NUM> (including zero). The documents <NUM> may store documents including JSON (JavaScript Object Notation) documents, other structured/semi-structured data, and/or the like. In some implementations, a document may be a binary representation of a JSON document. The one or more dictionaries <NUM> may include reference values used for the encoding and/or decoding of the documents <NUM>. In some implementations, encoding and decoding may refer to compression and/or decompression of the documents <NUM>.

The computing system <NUM> may be configured to load a database table <NUM>, document <NUM>, dictionary <NUM>, and/or the like into its main memory. The computing system <NUM> may be configured to load the information from the database system <NUM> (e.g., relational store <NUM> and/or document store <NUM>) to its main memory in response to receipt of a query instantiated by a user <NUM> and/or computing system through one or more user devices <NUM>, any external software components (not shown in <FIG>), core software platforms (not shown in <FIG>), or the like. In some implementations, all/any operational data of the database <NUM> and/or the document store <NUM> may reside in-memory (e.g., in random-access memory (RAM)).

In some implementations, the system <NUM> (and/or any portion thereof) may be implemented as a cloud-based database management system (e.g., not including the user devices <NUM>). A cloud-based database management system may be a hardware and/or software system for receiving, handling, optimizing, and/or executing database system <NUM> (e.g., relational store <NUM> and/or document store <NUM>) queries. The database <NUM> may be a structured, organized collection of data, such as schemas, tables, queries, reports, views, and/or the like, which may be processed for information. The document store <NUM> may be a structured or partially structured collection of documents, such as JSON documents, other structured/semi-structured data, and/or the like, which may be processed for information.

The database system <NUM> (e.g., relational store <NUM> and/or document store <NUM>) may be physically stored in a hardware server or across a plurality of hardware servers. In some implementations, communication may occur between the database system <NUM> (e.g., relational store <NUM> and/or the document store <NUM>). A cloud-based database management system may be a hardware and/or software system that interacts with a database, document store, users, and/or other software applications for defining, creating, and/or updating data, for receiving, handling, optimizing, and/or executing database/document store queries, and/or for running applications which utilize a database/document store. Although the database system <NUM> (including the relational store <NUM> and/or document store <NUM>) are illustrated as being separate and, at times, described as being separate, in various embodiments, at least a portion of the database system <NUM> (e.g., relational store <NUM> and/or the documents store <NUM>) may be combined.

In some implementations, documents stored in the memory of the computing system <NUM> and/or the document store <NUM> may be encoded. The computing system <NUM>'s memory and/or the document store <NUM> may include one or more dictionaries for encoding and/or decoding the documents stored in the memory of the computing system <NUM>, the document store <NUM>, etc. For example, during runtime of an application, the computing system <NUM> may need to access encoded documents in order to run the application, and may access the document store <NUM> in order to obtain the relevant document(s).

In some cases, documents stored in the document store <NUM> might not have a schema definition, and thus, when JSON data is stored in a compressed format in the document store, it may be difficult to determine which data fields are being stored (e.g., some fields may be missing and/or vary). Without knowledge of how data is stored (i.e., fields) in the document store, it may be difficult to query/access such data, thereby requiring sequential processing of each data element to determine whether any of them match the requests contained in a query. In some implementations, to provide an efficient access to data stored in the document store, the system <NUM> may be configured to generate a structure object that may include various data structures (e.g., JSON data structures). The structure object may be updated with new structures upon discovery of such object structures, e.g., through executions of various queries, proactively searching the document store, such as, for example, during the insertion of new documents, etc. The following discussion will refer to JSON objects, however, as can be understood, any types of objects may be used to generate a structure object, in accordance with various implementations of the current subject matter, as discussed herein.

<FIG> illustrates an exemplary binary representation <NUM>, <NUM> of JSON objects. For example, an object <NUM> {"name": "joe"} has a binary representation <NUM>. The structure of the binary representation <NUM> (the size of which is <NUM> bytes in an exemplary implementation) includes character strings "name" and "joe" that are each accorded a predetermined number of bytes, i.e., <NUM> bytes, and <NUM> bytes, respectively. The fields are separated by <NUM>-byte fields identifying the subsequent strings (i.e., "S4", "S", "<NUM>"). An object identifier ("O") may also be accorded a <NUM>-byte field. Similarly, an object <NUM> {"error": true, "code": <NUM>} has a binary representation <NUM>. Here, the structure has a size of <NUM> bytes and includes a <NUM>-byte field containing a string "error" (preceded by <NUM> byte field "S5" indicative of the size of the string "error"), a Boolean value "T" corresponding to the "error" string, and "code" and code value fields ("U" for "unsigned integer" and "<NUM>" as the actual value).

When an object <NUM>, for example, is queried, the computing system <NUM> may be configured to perform a search for a field "name" and determine its position in the corresponding binary representation <NUM>. The system <NUM> may also perform an appropriate comparison to determine whether the value of the name is present.

In some cases, a dictionary compression may be applied to data stored in the document store. For example, in the following string
{
"name": "Joe",
"age": <NUM>,
"hobbies": ["soccer", "swimming"],
"address": {
"street": "<NUM> Pennsylvania Plaza",
"city": "New York"
}
}
its compressed version may be as follows:
<IMG>
<IMG>.

<FIG> illustrates an exemplary binary representation <NUM> of a compressed JSON document. For example, the binary representation <NUM> may be of the following string that may be compressed using dictionary <NUM>:
{
name: "Joe",
age: <NUM>,.

The dictionary <NUM> may include entries for value identifiers (ValueID) "<NUM>" for strings "name", "<NUM>" for "age", etc. Because of the dictionary compression, the binary representation <NUM> may include fields <NUM> that correspond to ValueID V0, V1 and fields <NUM> that correspond to offset positions ("O"), which may be followed by the string values fields <NUM>. As shown in <FIG>, the binary representation <NUM> has a linear form. However, complexities associated with querying may increase once the stored document has nested data structures or arrays. The current subject matter's structure object may be configured to resolve complexities that may be associated with querying data stored using various types or schemas.

The document store <NUM> (as shown in <FIG>) may be configured to store documents using a particular schema. In an embodiment useful for understanding the invention, the schema, for example, may be fixed, which may require all documents to adhere to that fixed predetermined schema. For instance, a fixed schema may be as follows:
CREATE COLLECTION WITH FIXED SCHEMA({
"id": "integer",
"name": "string",
"address": {
"street": "string",
"city": "string" }
});.

<FIG> illustrates an exemplary fixed structure and/or schema <NUM>, according to some implementations of the current subject matter. The fixed structure and/or schema <NUM> may be generated using the above CREATE statement. For ease of access to the document, the computing system <NUM> is configured to generate a structure object <NUM> that is mapped to a binary representation <NUM> and may be used for the purposes of querying, searching for data, inserting data, modifying data, deleting data, etc..

The structure object <NUM> may be configured to include an "identifier" column <NUM>, a "type" column <NUM>, a "position identifier" column <NUM> (e.g., in the CREATE statement above, "id" is at "<NUM>" position identifier level, "name" - at "<NUM>" position identifier level, "address" - at "<NUM>" level, and "street" and "city" are at position identifier sublevels "<NUM>|<NUM>" and "<NUM>|<NUM>", respectively) and an offset value <NUM> column. For example, identifier "name" corresponds to type (or object type) "string", position identifier value of "<NUM>", and offset position of "<NUM>". At query compile time, the following statement (e.g., by performing a lookup of an identifier) WHERE "name" = "Paul" -> "name" may be mapped to <NUM> at the query compilation time (e.g., cached and then re-used during subsequent query execution times).

As shown by the arrows in <FIG>, the values in the structure object <NUM> are mapped to the binary representation <NUM>. In particular, each row of the structure object <NUM> may be mapped to a predetermined offset field <NUM>, which, in turn, may be mapped to a predetermined value field <NUM>.

Alternatively, documents may be stored in the document store <NUM> using a mixed schema. This means, for example, that documents may be stored with additional fields at all hierarchical levels, such as using, the following:
CREATE COLLECTION WITH MIXED SCHEMA
"id": "integer",
"name": "string",
"address": {
"street": "string",
"city": "string"
} });.

In some cases, an additional value may need to be added to the above document collection (which might not be permissible if a fixed schema is used for storage of documents). The following statement may be used, for example, to insert "age" value:
INSERT INTO myCollection VALUES({
"id": <NUM>,
"name": "Joe",
"address": {
"street": "Main Street",
"city": "Heidelberg"
},
"age": <NUM>
});.

<FIG> illustrates an exemplary mixed document storage structure and/or schema <NUM>, according to some implementations of the current subject matter. The mixed structure and/or schema <NUM> may be generated using the above CREATE statement. Additionally, an INSERT statement may be added to include additional values (e.g., "age"). Similar to the fixed structure and/or schema shown in <FIG>, the computing system <NUM> generates a structure object <NUM> that is mapped to a binary representation <NUM> and may be used for the purposes of querying, searching for data, inserting data, modifying data, deleting data, etc..

Again similar to the fixed schema structure object <NUM> shown in <FIG>, the structure object <NUM> may include an "identifier" column <NUM>, a "type" column <NUM>, a "position identifier" column <NUM> (e.g., in the CREATE statement above, "id" is at "<NUM>" position identifier level, "name" - at "<NUM>" position identifier level, "address" - at "<NUM>" level, and "street" and "city" are at position identifier sublevels "<NUM>|<NUM>" and "<NUM>|<NUM>", respectively) and an offset value <NUM> column. Because this is a mixed schema, an additional row <NUM> may be added to the structure object that may be used to insert "age" values corresponding to the INSERT statement above. In this case, the "age" position identifier level may be <NUM> and its offset position - <NUM>. As shown in <FIG>, the field "age" is only encountered for a single document so far. However, this field causes extension of a structure object used for all documents in a particular collection of JSON documents, and/or a particular partition. The extended structure object determines a position of the value of the newly inserted field in the compressed binary JSON representation. All subsequently inserted documents will re-use the above structure object and the binary representation is generated accordingly.

As shown by the arrows in <FIG>, the values in the structure object <NUM> are mapped to the binary representation <NUM>. In particular, each row of the structure object <NUM> is mapped to a predetermined offset field <NUM>, which, in turn, is mapped to a predetermined value field <NUM>. With regard to inserted value of "age" (i.e., "<NUM>"), it may be positioned in the binary representation <NUM> after the string "Heidelberg" corresponding to the "city".

<FIG> illustrates another exemplary mixed document storage structure and/or schema <NUM>, according to some implementations of the current subject matter. The mixed structure and/or schema <NUM> may be generated using the above CREATE and INSERT statements, where the INSERT statement may be added to include additional values (e.g., "age"). Similar to the mixed structure and/or schema shown in <FIG>, the computing system <NUM> may generate a structure object <NUM> that is mapped to a binary representation <NUM> and may be used for the purposes of querying, searching for data, inserting data, modifying data, deleting data, etc. As shown in <FIG>, the structure object <NUM> is configured to include multiple rows, optionally with multiple identifiers. For example, the structure object <NUM> may include an "identifier" column <NUM>, a "type" column <NUM>, a "position identifier" column <NUM> (e.g., in the CREATE statement above, "id" is at "<NUM>" position identifier level, "name" - at "<NUM>" position identifier level, "address" - at "<NUM>" level, and "street" and "city" are at position identifier sublevels "<NUM>|<NUM>" and "<NUM>|<NUM>", respectively) and an offset value <NUM> column. Because there are multiple rows in the mixed structure and/or schema <NUM>, a row <NUM>, for example, may include "age" values corresponding to the INSERT statement above, where the "age" position identifier level may be <NUM> and its offset position - <NUM>. The structure and/or schema <NUM> may be configured to address a situation where addition of many inserts may significantly extend the structure object over time, thereby wasting memory space, such as in an exemplary situation, where all newly inserted/created documents would need to provide for a space to store many offsets for values that do not exist. For instance, assuming that a document is inserted/created that only includes the identifiers <NUM> shown in <FIG>, where offset values <NUM> "<NUM>" to "<NUM>" are not used, however, it will be necessary to create a reserve space for offset values "<NUM>" to "<NUM>" and store an "not present" and/or "null" flags in it, thus, wasting memory.

As such, in some implementations, the binary representation <NUM> corresponding to the structure object <NUM> is configured to use one or more skip lists <NUM> to avoid such memory waste. A skip list may be referred to as a probabilistic data structure and may be used to store a sorted list of elements and/or data with a linked list. Using a skip list, the computing system <NUM>, in a single step, may skip several elements of the entire list. The skip list may allow quickly searching, removing, and/or inserting elements. The skip list may include a base list that includes a set of elements which maintains the link hierarchy of the subsequent elements. A lower layer of the skip list may include a common sorted linked list, and one or more of its top layers may be used to skip elements during processing (e.g., searching, querying, etc.), thereby removing the need to reserve a space for offset values that are not used in a particular document.

As shown by the arrows in <FIG>, the values in the structure object <NUM> are mapped to the binary representation <NUM>. In this case, the skip list <NUM> may be used in connection with the "street" row <NUM>. The skip list <NUM> may be configured to allowing skipping multiple rows that may exist in the object <NUM>, e.g., between the row <NUM> ("street") and row <NUM> ("age") to get directly to data contained in the binary representation <NUM> related to the value <NUM> corresponding to the "street" (i.e., to reach offset position "<NUM>", the current subject matter system may be configured to search the skip list and find <NUM> and <NUM>. As the searched value <NUM> is between <NUM> and <NUM>, the current subject matter system may follow a pointer of <NUM> to go through the "lower-level" data structure. A substantial performance gain may be realized for large documents that may include a multi-level skip list, as there can be a gain with an algorithm of logarithmic complexity), which in this case is "Main Street" (as indicated in the binary representation <NUM>). While the binary representation <NUM> is mapped to each row of the structure object <NUM>, as shown in <FIG>, when searching for a specific value (e.g., as may be requested by a query, inserting a new value, deleting a value, modifying a value, etc.), certain values are skipped using the skip list <NUM>, and data is obtained (or inserted, deleted, modified, etc.) by going directly to the offset position requested in the query.

<FIG> illustrates another exemplary mixed document storage structure and/or schema <NUM> that implements a skip list, according to some implementations of the current subject matter. The mixed structure and/or schema <NUM> may be generated using the above CREATE and INSERT statements, where the INSERT statement may be added to include additional values (e.g., "age"). Similar to the mixed structure and/or schema shown in <FIG>, the computing system <NUM> generates a structure object <NUM> that is mapped to a binary representation <NUM> and may be used for the purposes of querying, searching for data, inserting data, modifying data, deleting data, etc. As shown in <FIG>, similar to <FIG>, the structure object <NUM> is configured to include multiple rows, optionally with multiple identifiers. The binary representation <NUM> corresponding to the structure object <NUM> is configured to use one or more skip lists <NUM>. In this case, the skip list <NUM> is used to skip all rows in the object <NUM> to directly go to the last row <NUM> ("age") that has an offset position <NUM><NUM> in the binary representation <NUM>. Here, similar to <FIG>, the processing of the object <NUM> and the binary representation <NUM> may start at the beginning of the binary representation (position "<NUM>"). The skip list <NUM> may then be detected (allowing bypassing positions "<NUM>" and "<NUM>". Position "<NUM>", i.e., "city", may be the last position before "age" (or any other values) may need to be skipped, at which point the skip list <NUM> may be used to go directly to the offset position <NUM> "<NUM>" corresponding to the "age", which may point to the value <NUM> "<NUM>".

In some implementations, the skip list may be incorporated into the binary representation of data. <FIG> illustrates another exemplary mixed document storage structure and/or schema <NUM> that implements a skip list incorporated into a binary representation, according to some implementations of the current subject matter. The mixed structure and/or schema <NUM> may be generated using the above CREATE and INSERT statements discussed above. Similar to the mixed structures and/or schemas shown in <FIG>, the computing system <NUM> generates a structure object <NUM> that is mapped to a binary representation <NUM> and may be used for the purposes of querying, searching for data, inserting data, modifying data, deleting data, etc..

The structure object <NUM> includes multiple rows, optionally with multiple identifiers. The binary representation <NUM> corresponding to the structure object <NUM> uses one or more skip lists <NUM>, where the skip list <NUM> may be incorporated into the binary representation <NUM>. Similar to <FIG>, the skip list <NUM> may be used to skip all rows in the object <NUM> to directly go to the last row <NUM> ("age") that has an offset position <NUM><NUM> in the binary representation <NUM>.

As shown in <FIG>, the skip list <NUM> may be inserted prior to the rest of the data represented in the structure object <NUM>. Thus, the processing of the object <NUM> and the binary representation <NUM> may detect that a skip list is present at the beginning <NUM> of the binary representation (position "<NUM>"). Once the skip list <NUM> is detected, the system <NUM> may be configured to bypass positions "<NUM>", "<NUM>" and "<NUM>" and go directly to the offset position <NUM> "<NUM>" corresponding to the "age", which may point to the value <NUM> "<NUM>".

In some implementations, the current subject matter system may be used with or without schema for document collections of data. In particular, the current subject matter's structure objects (e.g., structure objects shown in <FIG>) may be used for document collections without schema. In this case, the fixed portion of the structure object (e.g., as shown in <FIG>) may be empty and may be populated with data with receiving a first insertion of data/documents.

In some implementations, the current subject matter can be implemented in various in-memory database systems, such as the HANA Database system as developed by SAP SE, Walldorf, Germany. Various systems, such as, enterprise resource planning ("ERP") system, supply chain management system ("SCM") system, supplier relationship management ("SRM") system, customer relationship management ("CRM") system, and/or others, can interact with the in-memory system for the purposes of accessing data, for example. Other systems and/or combinations of systems can be used for implementations of the current subject matter. The following is a discussion of an exemplary in-memory system.

<FIG> illustrates an exemplary system <NUM> in which a computing system <NUM>, which can include one or more programmable processors that can be collocated, linked over one or more networks, etc., executes one or more modules, software components, or the like of a data storage application <NUM>, according to some implementations of the current subject matter. The data storage application <NUM> can include one or more of a database, an enterprise resource program, a distributed storage system (e.g. NetApp Filer available from NetApp of Sunnyvale, CA), or the like.

The one or more modules, software components, or the like can be accessible to local users of the computing system <NUM> as well as to remote users accessing the computing system <NUM> from one or more client machines <NUM> over a network connection <NUM>. One or more user interface screens produced by the one or more first modules can be displayed to a user, either via a local display or via a display associated with one of the client machines <NUM>. Data units of the data storage application <NUM> can be transiently stored in a persistence layer <NUM> (e.g., a page buffer or other type of temporary persistency layer), which can write the data, in the form of storage pages, to one or more storages <NUM>, for example via an input/output component <NUM>. The one or more storages <NUM> can include one or more physical storage media or devices (e.g. hard disk drives, persistent flash memory, random access memory, optical media, magnetic media, and the like) configured for writing data for longer term storage. It should be noted that the storage <NUM> and the input/output component <NUM> can be included in the computing system <NUM> despite their being shown as external to the computing system <NUM> in <FIG>.

Data retained at the longer-term storage <NUM> can be organized in pages, each of which has allocated to it a defined amount of storage space. In some implementations, the amount of storage space allocated to each page can be constant and fixed. However, other implementations in which the amount of storage space allocated to each page can vary are also within the scope of the current subject matter.

<FIG> illustrates exemplary software architecture <NUM>, according to some implementations of the current subject matter. A data storage application <NUM>, which can be implemented in one or more of hardware and software, can include one or more of a database application, a network-attached storage system, or the like. According to at least some implementations of the current subject matter, such a data storage application <NUM> can include or otherwise interface with a persistence layer <NUM> or other type of memory buffer, for example via a persistence interface <NUM>. A page buffer <NUM> within the persistence layer <NUM> can store one or more logical pages <NUM>, and optionally can include shadow pages, active pages, and the like. The logical pages <NUM> retained in the persistence layer <NUM> can be written to a storage (e.g. a longer term storage, etc.) <NUM> via an input/output component <NUM>, which can be a software module, a subsystem implemented in one or more of software and hardware, or the like. The storage <NUM> can include one or more data volumes <NUM> where stored pages <NUM> are allocated at physical memory blocks.

In some implementations, the data storage application <NUM> can include or be otherwise in communication with a page manager <NUM> and/or a savepoint manager <NUM>. The page manager <NUM> can communicate with a page management module <NUM> at the persistence layer <NUM> that can include a free block manager <NUM> that monitors page status information <NUM>, for example the status of physical pages within the storage <NUM> and logical pages in the persistence layer <NUM> (and optionally in the page buffer <NUM>). The savepoint manager <NUM> can communicate with a savepoint coordinator <NUM> at the persistence layer <NUM> to handle savepoints, which are used to create a consistent persistent state of the database for restart after a possible crash.

In some implementations of a data storage application <NUM>, the page management module of the persistence layer <NUM> can implement a shadow paging. The free block manager <NUM> within the page management module <NUM> can maintain the status of physical pages. The page buffer <NUM> can include a fixed page status buffer that operates as discussed herein. A converter component <NUM>, which can be part of or in communication with the page management module <NUM>, can be responsible for mapping between logical and physical pages written to the storage <NUM>. The converter <NUM> can maintain the current mapping of logical pages to the corresponding physical pages in a converter table <NUM>. The converter <NUM> can maintain a current mapping of logical pages <NUM> to the corresponding physical pages in one or more converter tables <NUM>. When a logical page <NUM> is read from storage <NUM>, the storage page to be loaded can be looked up from the one or more converter tables <NUM> using the converter <NUM>. When a logical page is written to storage <NUM> the first time after a savepoint, a new free physical page is assigned to the logical page. The free block manager <NUM> marks the new physical page as "used" and the new mapping is stored in the one or more converter tables <NUM>.

The persistence layer <NUM> can ensure that changes made in the data storage application <NUM> are durable and that the data storage application <NUM> can be restored to a most recent committed state after a restart. Writing data to the storage <NUM> need not be synchronized with the end of the writing transaction. As such, uncommitted changes can be written to disk and committed changes may not yet be written to disk when a writing transaction is finished. After a system crash, changes made by transactions that were not finished can be rolled back. Changes occurring by already committed transactions should not be lost in this process. A logger component <NUM> can also be included to store the changes made to the data of the data storage application in a linear log. The logger component <NUM> can be used during recovery to replay operations since a last savepoint to ensure that all operations are applied to the data and that transactions with a logged "commit" record are committed before rolling back still-open transactions at the end of a recovery process.

With some data storage applications, writing data to a disk is not necessarily synchronized with the end of the writing transaction. Situations can occur in which uncommitted changes are written to disk and while, at the same time, committed changes are not yet written to disk when the writing transaction is finished. After a system crash, changes made by transactions that were not finished must be rolled back and changes by committed transaction must not be lost.

To ensure that committed changes are not lost, redo log information can be written by the logger component <NUM> whenever a change is made. This information can be written to disk at latest when the transaction ends. The log entries can be persisted in separate log volumes while normal data is written to data volumes. With a redo log, committed changes can be restored even if the corresponding data pages were not written to disk. For undoing uncommitted changes, the persistence layer <NUM> can use a combination of undo log entries (from one or more logs) and shadow paging.

The persistence interface <NUM> can handle read and write requests of stores (e.g., in-memory stores, etc.). The persistence interface <NUM> can also provide write methods for writing data both with logging and without logging. If the logged write operations are used, the persistence interface <NUM> invokes the logger <NUM>. In addition, the logger <NUM> provides an interface that allows stores (e.g., in-memory stores, etc.) to directly add log entries into a log queue. The logger interface also provides methods to request that log entries in the in-memory log queue are flushed to disk.

Log entries contain a log sequence number, the type of the log entry and the identifier of the transaction. Depending on the operation type additional information is logged by the logger <NUM>. For an entry of type "update", for example, this would be the identification of the affected record and the after image of the modified data.

When the data application <NUM> is restarted, the log entries need to be processed. To speed up this process the redo log is not always processed from the beginning. Instead, as stated above, savepoints can be periodically performed that write all changes to disk that were made (e.g., in memory, etc.) since the last savepoint. When starting up the system, only the logs created after the last savepoint need to be processed. After the next backup operation the old log entries before the savepoint position can be removed.

When the logger <NUM> is invoked for writing log entries, it does not immediately write to disk. Instead it can put the log entries into a log queue in memory. The entries in the log queue can be written to disk at the latest when the corresponding transaction is finished (committed or aborted). To guarantee that the committed changes are not lost, the commit operation is not successfully finished before the corresponding log entries are flushed to disk. Writing log queue entries to disk can also be triggered by other events, for example when log queue pages are full or when a savepoint is performed.

With the current subject matter, the logger <NUM> can write a database log (or simply referred to herein as a "log") sequentially into a memory buffer in natural order (e.g., sequential order, etc.). If several physical hard disks / storage devices are used to store log data, several log partitions can be defined. Thereafter, the logger <NUM> (which as stated above acts to generate and organize log data) can load-balance writing to log buffers over all available log partitions. In some cases, the load-balancing is according to a round-robin distributions scheme in which various writing operations are directed to log buffers in a sequential and continuous manner. With this arrangement, log buffers written to a single log segment of a particular partition of a multi-partition log are not consecutive. However, the log buffers can be reordered from log segments of all partitions during recovery to the proper order.

As stated above, the data storage application <NUM> can use shadow paging so that the savepoint manager <NUM> can write a transactionally-consistent savepoint. With such an arrangement, a data backup comprises a copy of all data pages contained in a particular savepoint, which was done as the first step of the data backup process. The current subject matter can be also applied to other types of data page storage.

In some implementations, the current subject matter can be configured to be implemented in a system <NUM>, as shown in <FIG>. The system <NUM> can include a processor <NUM>, a memory <NUM>, a storage device <NUM>, and an input/output device <NUM>. Each of the components <NUM>, <NUM>, <NUM> and <NUM> can be interconnected using a system bus <NUM>. The processor <NUM> can be configured to process instructions for execution within the system <NUM>. In some implementations, the processor <NUM> can be a single-threaded processor. In alternate implementations, the processor <NUM> can be a multi-threaded processor. The processor <NUM> can be further configured to process instructions stored in the memory <NUM> or on the storage device <NUM>, including receiving or sending information through the input/output device <NUM>. The memory <NUM> can store information within the system <NUM>. In some implementations, the memory <NUM> can be a computer-readable medium. In alternate implementations, the memory <NUM> can be a volatile memory unit. In yet some implementations, the memory <NUM> can be a non-volatile memory unit. The storage device <NUM> can be capable of providing mass storage for the system <NUM>. In some implementations, the storage device <NUM> can be a computer-readable medium. In alternate implementations, the storage device <NUM> can be a floppy disk device, a hard disk device, an optical disk device, a tape device, non-volatile solid state memory, or any other type of storage device. The input/output device <NUM> can be configured to provide input/output operations for the system <NUM>. In some implementations, the input/output device <NUM> can include a keyboard and/or pointing device. In alternate implementations, the input/output device <NUM> can include a display unit for displaying graphical user interfaces.

<FIG> illustrates an exemplary method <NUM> for accessing data using a schema, according to some implementations of the current subject matter. The method <NUM> may be executed by the system <NUM> shown in <FIG>. At <NUM>, a schema representing a structure of an object in a plurality of objects stored in a storage location (e.g., document store <NUM> as shown in <FIG>) is generated. The objects may be various data, documents, etc. Such objects have a binary representation, such as the one shown in <FIG>. Example schemas (e.g., structure objects <NUM>, <NUM>, <NUM>, <NUM>, <NUM>) are illustrated in <FIG>. Each object in the plurality of objects includes one or more data elements (e.g., "name", "address", etc.). Each schema identifies one or more data elements of the object, an offset location (e.g., <NUM>, <NUM>, etc.) of each data element of the object, and a value of each data element (e.g., <NUM>, <NUM>, etc.) of the object.

At <NUM>, a query requesting access to one or more data elements of the object in the plurality of objects is received by the computing system <NUM>. The computing system <NUM> identifies a generated schema in a plurality of generated schemas that represents the queried object, at <NUM>. Using the identified generated schema, the computing system <NUM> then accesses the data elements being sought, at <NUM>, and retrieves them, at <NUM>.

In some implementations, the current subject matter can include one or more of the following optional features.

In some implementations, the generated schema may be a mixed schema. The mixed schema may allow modification of the schema. The method <NUM> may further include adding identification of one or more another data elements (e.g., "age") of the object, an offset location of each another data element of the object, and a value of each another data element of the object. Accessing the data elements may include accessing another data elements of the object. Retrieval may include retrieving another data elements of the object.

The generated schema identifies one or more skip lists (e.g., skip lists <NUM>, <NUM>, etc., as shown in <FIG>) that permit skipping at least a portion of the one or more data elements during the access and the retrieval, thereby reducing data access times (e.g., yielding logarithmic access times) when retrieving a value for a particular identifier. The schema may identify each skip list using a skip list offset location in the object.

The generated schema identifies an offset location (e.g., position identifier <NUM>, <NUM>, <NUM>, <NUM>, <NUM>) of each data element.

In some implementations, receipt of the query may include generating a query execution plan for the query. At a query compilation time of the received query, an offset location of a first data element in one or more data elements may be determined. The determined offset location of the first data element may be stored in the generated query execution plan. The query execution plan may also be stored (e.g., by the system <NUM> shown in <FIG>). In some implementations, the method may also include receiving another query to access the first data element, and accessing, using the stored query execution plan, the first data element.

In some implementations, the object in the plurality of objects might not include an object schema (e.g., schema-less objects, where one or more portions of the structure object may be populated at a first insertion of data).

The systems and methods disclosed herein can be embodied in various forms including, for example, a data processor, such as a computer that also includes a database, digital electronic circuitry, firmware, software, or in combinations of them. Moreover, the above-noted features and other aspects and principles of the present disclosed implementations can be implemented in various environments. Such environments and related applications can be specially constructed for performing the various processes and operations according to the disclosed implementations or they can include a general-purpose computer or computing platform selectively activated or reconfigured by code to provide the necessary functionality. The processes disclosed herein are not inherently related to any particular computer, network, architecture, environment, or other apparatus, and can be implemented by a suitable combination of hardware, software, and/or firmware. For example, various general-purpose machines can be used with programs written in accordance with teachings of the disclosed implementations, or it can be more convenient to construct a specialized apparatus or system to perform the required methods and techniques.

The systems and methods disclosed herein can be implemented as a computer program product, i.e., a computer program tangibly embodied in an information carrier, e.g., in a machine readable storage device or in a propagated signal, for execution by, or to control the operation of, data processing apparatus, e.g., a programmable processor, a computer, or multiple computers.

As used herein, the term "user" can refer to any entity including a person or a computer.

Although ordinal numbers such as first, second, and the like can, in some situations, relate to an order; as used in this document ordinal numbers do not necessarily imply an order. For example, ordinal numbers can be merely used to distinguish one item from another. For example, to distinguish a first event from a second event, but need not imply any chronological ordering or a fixed reference system (such that a first event in one paragraph of the description can be different from a first event in another paragraph of the description).

The foregoing description is intended to illustrate but not to limit the scope of the invention, which is defined by the scope of the appended claims.

These computer programs, which can also be referred to programs, software, software applications, applications, components, or code, include machine instructions for a programmable processor, and can be implemented in a high-level procedural and/or object-oriented programming language, and/or in assembly/machine language. The machine-readable medium can store such machine instructions non-transitorily, such as for example as would a non-transient solid state memory or a magnetic hard drive or any equivalent storage medium.

To provide for interaction with a user, the subject matter described herein can be implemented on a computer having a display device, such as for example a cathode ray tube (CRT) or a liquid crystal display (LCD) monitor for displaying information to the user and a keyboard and a pointing device, such as for example a mouse or a trackball, by which the user can provide input to the computer. For example, feedback provided to the user can be any form of sensory feedback, such as for example visual feedback, auditory feedback, or tactile feedback; and input from the user can be received in any form, including, but not limited to, acoustic, speech, or tactile input.

The subject matter described herein can be implemented in a computing system that includes a back-end component, such as for example one or more data servers, or that includes a middleware component, such as for example one or more application servers, or that includes a front-end component, such as for example one or more client computers having a graphical user interface or a Web browser through which a user can interact with an implementation of the subject matter described herein, or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication, such as for example a communication network. Examples of communication networks include, but are not limited to, a local area network ("LAN"), a wide area network ("WAN"), and the Internet.

A client and server are generally, but not exclusively, remote from each other and typically interact through a communication network.

Claim 1:
A computer-implemented method (<NUM>), comprising:
generating (<NUM>) a schema (<NUM>, <NUM>) representing a structure of an object in a plurality of objects stored in a storage location, each object in the plurality of objects including one or more data elements, each schema identifying one or more data elements of the object, an offset location of each data element of the object, and a value of each data element of the object;
generating a structure object (<NUM>, <NUM>),
wherein the structure object (<NUM>, <NUM>) is used for all objects in the plurality of objects;
wherein each object in the plurality of objects has a corresponding binary representation;
wherein the structure object (<NUM>, <NUM>) is mapped to each of the binary representations (<NUM>);
wherein the structure object (<NUM>, <NUM>) includes multiple rows and multiple columns;
wherein each row of the structure object (<NUM>, <NUM>) is mapped to a predetermined offset field (<NUM>, <NUM>) of the binary representation (<NUM>, <NUM>), wherein the predetermined offset field (<NUM>, <NUM>) of the binary representation (<NUM>, <NUM>) is mapped to a predetermined value field (<NUM>, <NUM>) of the binary representation (<NUM>, <NUM>);
inserting an offset (<NUM>) and a value (<NUM>) into the corresponding binary representation (<NUM>) of another object of the plurality of objects, comprising, adding an additional row (<NUM>) to the structure object (<NUM>, <NUM>), whereby the structure object (<NUM>,<NUM>) is extended to include the additional row (<NUM>) for all objects in the plurality of objects and for all subsequently inserted objects;
receiving (<NUM>) a query requesting access to one or more data elements of the object in the plurality of objects;
identifying (<NUM>) a generated schema (<NUM>, <NUM>) in a plurality of generated schemas representing the queried object, wherein the generated schema (<NUM>, <NUM>) includes the structure object (<NUM>, <NUM>);
accessing (<NUM>), using the identified generated schema (<NUM>, <NUM>), the one or more data elements, comprising:
using a skip list to skip multiple rows of the structure object (<NUM>) to get directly to an offset of the corresponding binary representation (<NUM>) of the object for a value of the corresponding binary representation (<NUM>) corresponding to the one or more data elements; and
retrieving (<NUM>) the one or more data elements.