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
:
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:
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.
Distributed Projections
To project the entire current graphset to its shard servers as distGraph
:
create().project("distGraph", ["*"], ["*"], {
node_properties: ["*"],
edge_properties: ["*"],
orientation: "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", ["account", "movie"], ["rate"], {
node_properties: ["name", "year", "gender"],
edge_properties: ["*"],
orientation: "in",
load_id: false
})
For details on managing distributed projections, see Distributed Projections.