Concourse’s document-graph data model lets you store relationships
between records and traverse them efficiently. Relationships are
represented as Links — directional
pointers from one record to another.
Use the link method to create a directed relationship from a
source record to a destination record via a named key.
123
// Java// Create a link: record 1 --employer--> record 100concourse.link("employer",100,1);
12
// CaSHlink"employer",100,1
Links are directional. The example above creates a relationship
from record 1 to record 100, but record 100 has no automatic
back-reference to record 1.
A navigation key is a dot-separated path where each segment
before the last is a key containing links, and the final segment
is the key to read from the destination record.
1
employer.name
This means: follow the employer link, then read the name key
from the linked record.
Concourse automatically selects the most efficient traversal
strategy for navigation queries. Depending on the shape of the
data, it may use:
Forward traversal: Start from the source records and follow
links forward to find destination data. This is more efficient
when there are fewer source records than destination records.
Reverse traversal: Start from potential destination records
and trace links backward to find matching sources. This is more
efficient when there are fewer destination records than source
records.
The optimizer chooses the strategy automatically based on data
characteristics. No manual tuning is required.