Database structure for distributed key-value pair, document and graph models
First Claim
1. A computer-implemented method for defining a NoSQL database structure that supports wide-column, document, and graph data models, the method comprising executing on a processor the steps of:
- defining a plurality of documents, each with a unique key that is different from a key of any other of the documents;
defining a plurality of columns, one for each of a plurality of document rows, within a wide-column store, wherein the columns each have a field comprising a pair of a name and a value that is selected from the group consisting of a nested object and an array, wherein each of the column fields have different column names;
indicating a data type of the column field values via a type of notation;
storing each of the plurality of documents to different rows in the wide-column store by mapping the unique keys directly to different row keys of the wide-column store and adding a first prefix to each of the different column names of the columns of the fields comprising the pairs of the name and the values;
defining a graph edge as a function of a relationship between a first source document and a second of the documents as a tuple of a source, a target, a tag and a value, wherein the source is the first source document key, the target is the second document key, the tag is a label of the relationship, and the value is an object associated with the relationship; and
storing the graph edge as a graph column within the row of the first source document with a name that is different from names of other columns within said row of the first source document by adding a second prefix to the graph column name that is different from the first prefix;
wherein the array value is an ordered list of a plurality of array values, and wherein the defining the plurality of columns for the field pair of the name and the array comprises defining a cell value of the column fields as a size of the array, and defining a plurality of additional columns for the row for each of the array values in recursively named columns of a form of [“
name[0]”
, “
name[1]”
, . . . , “
name [n−
1]”
], where “
n”
is the array value; and
wherein the nested object comprises a quantity of “
y”
of a plurality of sub fields, and wherein the defining the plurality of columns for the field pair of the name and the nested object comprises defining a cell value of the column fields as a combination of the nested object sub fields, and defining the plurality of additional columns for the row for each of the array values in recursively named columns of a form of [“
name.subfield-1”
, “
name.subfield-2”
, . . . “
name.subfield-y”
].
2 Assignments
0 Petitions
Accused Products
Abstract
Aspects define NoSQL database structures that support wide-column, document, and graph data models. Documents are defined with different, unique keys and stored to different rows in a wide-column store by mapping their respective, unique keys directly to different row keys. Columns are defined for the document rows as including pairs of names and values, each column field having a different column name. Graph edges are defined as a function of relationships between a first source document and a second of the documents as tuples of first source document keys, second document keys as targets, tags as labels of relationships, and values of objects associated with the relationships. The graph edges are stored as graph columns within rows of the first source documents with names that are different from names of other columns within the first source document rows.
-
Citations
12 Claims
-
1. A computer-implemented method for defining a NoSQL database structure that supports wide-column, document, and graph data models, the method comprising executing on a processor the steps of:
-
defining a plurality of documents, each with a unique key that is different from a key of any other of the documents; defining a plurality of columns, one for each of a plurality of document rows, within a wide-column store, wherein the columns each have a field comprising a pair of a name and a value that is selected from the group consisting of a nested object and an array, wherein each of the column fields have different column names; indicating a data type of the column field values via a type of notation; storing each of the plurality of documents to different rows in the wide-column store by mapping the unique keys directly to different row keys of the wide-column store and adding a first prefix to each of the different column names of the columns of the fields comprising the pairs of the name and the values; defining a graph edge as a function of a relationship between a first source document and a second of the documents as a tuple of a source, a target, a tag and a value, wherein the source is the first source document key, the target is the second document key, the tag is a label of the relationship, and the value is an object associated with the relationship; and storing the graph edge as a graph column within the row of the first source document with a name that is different from names of other columns within said row of the first source document by adding a second prefix to the graph column name that is different from the first prefix; wherein the array value is an ordered list of a plurality of array values, and wherein the defining the plurality of columns for the field pair of the name and the array comprises defining a cell value of the column fields as a size of the array, and defining a plurality of additional columns for the row for each of the array values in recursively named columns of a form of [“
name[0]”
, “
name[1]”
, . . . , “
name [n−
1]”
], where “
n”
is the array value; andwherein the nested object comprises a quantity of “
y”
of a plurality of sub fields, and wherein the defining the plurality of columns for the field pair of the name and the nested object comprises defining a cell value of the column fields as a combination of the nested object sub fields, and defining the plurality of additional columns for the row for each of the array values in recursively named columns of a form of [“
name.subfield-1”
, “
name.subfield-2”
, . . . “
name.subfield-y”
]. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A system, comprising:
-
a processor; a computer readable memory in circuit communication with the processor; and a computer readable storage medium in circuit communication with the processor; wherein the processor executes program instructions stored on the computer-readable storage medium via the computer readable memory and thereby; defines a plurality of documents, each with a unique key that is different from a key of any other of the documents; defines a plurality of columns, one for each of a plurality of document rows, within a wide-column store, wherein the columns each have a field comprising a pair of a name and a value that is selected from the group consisting of a nested object and an array, wherein each of the column fields have different column names; indicates a data type of the column field values via a type of notation; stores each of the plurality of documents to different rows in the wide-column store by mapping the unique keys directly to different row keys of the wide-column store and adding a first prefix to each of the different column names of the columns of the fields comprising the pairs of the name and the values; defines a graph edge as a function of a relationship between a first source document and a second of the documents as a tuple of a source, a target, a tag and a value, wherein the source is the first source document key, the target is the second document key, the tag is a label of the relationship, and the value is an object associated with the relationship; and stores the graph edge as a graph column within the row of the first source document with a name that is different from names of other columns within said row of the first source document by adding a second prefix to the graph column name that is different from the first prefix; wherein the array value is an ordered list of a plurality of array values, and wherein defining the plurality of columns for the field pair of the name and the array comprises defining a cell value of the column fields as a size of the array, and defining a plurality of additional columns for the row for each of the array values in recursively named columns of a form of [“
name[0]”
, “
name[1]”
, . . . , “
name [n−
1]”
], where “
n”
is the array value; andwherein the nested object comprises a quantity of “
y”
of a plurality of sub fields, and wherein defining the plurality of columns for the field pair of the name and the nested object comprises defining a cell value of the column fields as a combination of the nested object sub fields, and defining the plurality of additional columns for the row for each of the array values in recursively named columns of a form of [“
name.subfield-1”
, “
name.subfield-2”
, . . . “
name.subfield-y”
]. - View Dependent Claims (7, 8, 9)
-
-
10. A computer program product for defining a NoSQL database structure that supports wide-column, document, and graph data models, the computer program product comprising:
-
a computer readable hardware storage device having computer readable program code embodied therewith, wherein the hardware storage device is not a transitory signal per se, the computer readable program code comprising instructions for execution by a processor that cause the processor to; define a plurality of documents, each with a unique key that is different from a key of any other of the documents; define a plurality of columns, one for each of a plurality of document rows within a wide-column store, wherein the columns each have a field comprising a pair of a name and a value that is selected from the group consisting of a nested object and an array, wherein each of the column fields have different column names; indicate a data type of the column field values via a type of notation; store each of the plurality of documents to different rows in the wide-column store by mapping the unique keys directly to different row keys of the wide-column store and adding a first prefix to each of the different column names of the columns of the fields comprising the pairs of the name and the values; define a graph edge as a function of a relationship between a first source document and a second of the documents as a tuple of a source, a target, a tag and a value, wherein the source is the first source document key, the target is the second document key, the tag is a label of the relationship, and the value is an object associated with the relationship; and store the graph edge as a graph column within the row of the first source document with a name that is different from names of other columns within said row of the first source document by adding a second prefix to the graph column name that is different from the first prefix; wherein the array value is an ordered list of a plurality of array values, and wherein defining the plurality of columns for the field pair of the name and the array comprises defining a cell value of the column fields as a size of the array, and defining a plurality of additional columns for the row for each of the array values in recursively named columns of a form of [“
name[0]”
, “
name[1]”
, . . . , “
name [n−
1]”
], where “
n”
is the array value; andwherein the nested object comprises a quantity of “
y”
of a plurality of sub fields, and wherein defining the plurality of columns for the field pair of the name and the nested object comprises defining a cell value of the column fields as a combination of the nested object sub fields, and defining the plurality of additional columns for the row for each of the array values in recursively named columns of a form of [“
name.subfield-1”
, “
name.subfield-2”
, . . . “
name.subfield-y”
]. - View Dependent Claims (11, 12)
-
Specification