A graph projection is an in-memory graph containing all or part of the data loaded from a graphset. Ultipa graph algorithms run on graph projections for peak efficiency.
Based on the Shards + HDCs architecture of Ultipa Powerhouse (v5), graph data can be projected to either an HDC server or shard servers, resulting in HDC or distributed projections.
Selecting between a HDC or distributed projection involves factors such as physical infrastructure, data volume, and specific business needs. The table below highlights key distinctions between them:
Projection Type |
Algorithm Efficiency | Algorithm Execution Modes | Computing Framework |
---|---|---|---|
HDC | Faster | Writebacks, Returns | Centralized high-density computing |
Distributed | Fast | Writebacks | Distributed computing |
HDC Projections
To project the entire current graphset to hdc-server-1
as hdcGraph
:
CALL hdc.graph.create("hdc-server-1", "hdcGraph", {
nodes: {"*": ["*"]},
edges: {"*": ["*"]},
direction: "undirected",
load_id: true,
update: "static",
query: "query",
default: false
})
hdc.graph.create("hdcGraph", {
nodes: {"*": ["*"]},
edges: {"*": ["*"]},
direction: "undirected",
load_id: true,
update: "static",
query: "query",
default: true
}).to("hdc-server-1")
To project account
and movie
nodes with selected properties and incoming rate
edges in the current graphset to hdc-server-1
as hdcGraph_1
, while omitting nodes' _id
values:
CALL hdc.graph.create("hdc-server-1", "hdcGraph_1", {
nodes: {
"account": ["name", "gender"],
"movie": ["name", "year"]
},
edges: {"rate": ["*"]},
direction: "in",
load_id: false,
update: "static",
query: "query",
default: false
})
hdc.graph.create("hdcGraph_1", {
nodes: {
"account": ["name", "gender"],
"movie": ["name", "year"]
},
edges: {"*": ["*"]},
direction: "in",
load_id: false,
update: "static",
query: "query",
default: false
}).to("hdc-server-1")
For details on managing HDC projections, see HDC Projections (GQL) or HDC Projections (UQL).
Distributed Projections
To project the entire current graphset to its shard servers as distGraph
:
create().project("distGraph", {
nodes: {"*": ["*"]},
edges: {"*": ["*"]},
direction: "undirected",
load_id: true
})
To project account
and movie
nodes with selected properties and incoming rate
edges in the current graphset to its shard servers as distGraph_1
, while omitting nodes' _id
values:
create().project("distGraph_1", {
nodes: {
"account": ["name", "gender"],
"movie": ["name", "year"]
},
edges: {"rate": ["*"]},
direction: "in",
load_id: false
})
For details on managing distributed projections, see Distributed Projections (UQL). This hasn't been supported in GQL yet.