on master help sign in
Review: point to media.urbit.org
e5d7febYaseen
userspace/graph-store/overview.md+6−6
@@ -11,7 +11,7 @@ insert_anchor_links = "right"
11Graph store is a non-relational database suitable for use in building social media applications. It is primarily designed for storing text-based content and data that is generally threaded and nested. It is not suitable as a general purpose database for highly structured or pure binary data.
11Graph store is a non-relational database suitable for use in building social media applications. It is primarily designed for storing text-based content and data that is generally threaded and nested. It is not suitable as a general purpose database for highly structured or pure binary data.
12
12
13<p align="center">
13<p align="center">
14− <img src="images/1_graph_store_overview.png"/>
14+ <img src="https://media.urbit.org/docs/userspace/graph-store/1_graph_store_overview.png"/>
15</p>
15</p>
16
16
17Graph Store is mainly in charge of two things: data storage and retrieval, and schema validation. There are two related tools: Graph Push Hook, which provides permissioning support to Graph Store and acts as a proxy layer to Graph Store for outside ships to access, and Graph Pull Hook, which can be used to request Graph Store data from other ships. Importantly, Graph Store itself does not have a built-in permissions system (or rather, is permissions-agnostic), and acts in a purely trusted manner, and assumes that all inputs are trusted. However, it only allows local, authenticated connections to communicate with it, meaning that by default, no one else on the network may modify the state of your Graph Store agent. This is why Graph Push Hook exists: to mediate untrusted requests from outside ships to your instance of Graph Store, rejecting invalid ones where a ship should not be able to modify the data.
17Graph Store is mainly in charge of two things: data storage and retrieval, and schema validation. There are two related tools: Graph Push Hook, which provides permissioning support to Graph Store and acts as a proxy layer to Graph Store for outside ships to access, and Graph Pull Hook, which can be used to request Graph Store data from other ships. Importantly, Graph Store itself does not have a built-in permissions system (or rather, is permissions-agnostic), and acts in a purely trusted manner, and assumes that all inputs are trusted. However, it only allows local, authenticated connections to communicate with it, meaning that by default, no one else on the network may modify the state of your Graph Store agent. This is why Graph Push Hook exists: to mediate untrusted requests from outside ships to your instance of Graph Store, rejecting invalid ones where a ship should not be able to modify the data.
@@ -20,7 +20,7 @@ Graph Store is mainly in charge of two things: data storage and retrieval, and s
20### Posts
20### Posts
21
21
22<p align="center">
22<p align="center">
23− <img src="images/2_post_explanation_diagram.png"/>
23+ <img src="https://media.urbit.org/docs/userspace/graph-store/2_post_explanation_diagram.png"/>
24</p>
24</p>
25
25
26Above, we can see a representation of a post on the left, along with its table form on the right.
26Above, we can see a representation of a post on the left, along with its table form on the right.
@@ -42,11 +42,11 @@ Currently, Graph Store supports 5 data types for content that is to be stored wi
42### Graphs and Nodes
42### Graphs and Nodes
43
43
44<p align="center">
44<p align="center">
45− <img src="images/3_graph_node_diagram_a.png"/>
45+ <img src="https://media.urbit.org/docs/userspace/graph-store/3_graph_node_diagram_a.png"/>
46</p>
46</p>
47
47
48<p align="center">
48<p align="center">
49− <img src="images/4_graph_node_diagram_b.png"/>
49+ <img src="https://media.urbit.org/docs/userspace/graph-store/4_graph_node_diagram_b.png"/>
50</p>
50</p>
51
51
52A graph is a flat, ordered map of nodes, where each node can have a child graph, which is itself a flat ordered map of nodes. Nodes contain a post and a child graph. In the above diagram, we can see an example of a basic graph on the top, along with the underlying structure of the data in table form underneath.
52A graph is a flat, ordered map of nodes, where each node can have a child graph, which is itself a flat ordered map of nodes. Nodes contain a post and a child graph. In the above diagram, we can see an example of a basic graph on the top, along with the underlying structure of the data in table form underneath.
@@ -63,7 +63,7 @@ A few vocab terms:
63### Index
63### Index
64
64
65<p align="center">
65<p align="center">
66− <img src="images/5_index_diagram.png"/>
66+ <img src="https://media.urbit.org/docs/userspace/graph-store/5_index_diagram.png"/>
67</p>
67</p>
68
68
69Indexes are a way of uniquely identifying a node within a graph. You can think of `index`es as similar to file paths, although they aren't exactly the same. Roughly, a file path is a unique reference to a file or folder located in the filesystem. Similarly, an index is a unique reference to a node nested within a graph. The written syntax for a full index is very similar to file paths. It consists of every index fragment in order separated by a slash. A node's **level of nesting** refers to how deeply it is nested within the context of the root graph. The level of nesting directly corresponds to the number of items in the index. An index fragment is the atom by which a node is uniquely identified within it's graph, and roughly corresponds to a specific name of a directory along a path. In the diagrams that follow, we'll use the index fragment instead of the index to avoid repeating redundant information, but please note that internally graph-store still store the full index in every node's post.
69Indexes are a way of uniquely identifying a node within a graph. You can think of `index`es as similar to file paths, although they aren't exactly the same. Roughly, a file path is a unique reference to a file or folder located in the filesystem. Similarly, an index is a unique reference to a node nested within a graph. The written syntax for a full index is very similar to file paths. It consists of every index fragment in order separated by a slash. A node's **level of nesting** refers to how deeply it is nested within the context of the root graph. The level of nesting directly corresponds to the number of items in the index. An index fragment is the atom by which a node is uniquely identified within it's graph, and roughly corresponds to a specific name of a directory along a path. In the diagrams that follow, we'll use the index fragment instead of the index to avoid repeating redundant information, but please note that internally graph-store still store the full index in every node's post.
@@ -81,7 +81,7 @@ However, there is no strict requirement for them to be numbers; they can be cord
81### Structural Nodes vs. Content-Centric Nodes
81### Structural Nodes vs. Content-Centric Nodes
82
82
83<p align="center">
83<p align="center">
84− <img src="images/6_structural_vs_content_centric_diagram.png"/>
84+ <img src="https://media.urbit.org/docs/userspace/graph-store/6_structural_vs_content_centric_diagram.png"/>
85</p>
85</p>
86
86
87When using Graph Store, there is a notion of **structural nodes** vs. **content-centric nodes**. In the example diagram, we've color coded the different nodes based on what type of node they are. **Content-centric nodes** represent data created or consumed directly by the user. **Structural nodes**, on the other hand do not directly represent user data, and instead represent a higher level relationship between different user data. Structural nodes are used to implement the structure of the schema that is being implemented. In other words, they exist away from the eyes of the user, solely for organizational purposes.
87When using Graph Store, there is a notion of **structural nodes** vs. **content-centric nodes**. In the example diagram, we've color coded the different nodes based on what type of node they are. **Content-centric nodes** represent data created or consumed directly by the user. **Structural nodes**, on the other hand do not directly represent user data, and instead represent a higher level relationship between different user data. Structural nodes are used to implement the structure of the schema that is being implemented. In other words, they exist away from the eyes of the user, solely for organizational purposes.
userspace/graph-store/validator-walkthrough.md+8−8
@@ -24,7 +24,7 @@ Here's the source if you want to explore: [`sur/metadata-store.hoon#L20-L30`](ht
24Here's what the schema of chat looks like:
24Here's what the schema of chat looks like:
25
25
26<p align="center">
26<p align="center">
27− <img src="images/7_chat_schema_diagram.png"/>
27+ <img src="https://media.urbit.org/docs/userspace/graph-store/7_chat_schema_diagram.png"/>
28</p>
28</p>
29
29
30A chat is a flat graph, where all chat messages are nodes appended to the root of the graph.
30A chat is a flat graph, where all chat messages are nodes appended to the root of the graph.
@@ -58,7 +58,7 @@ Since the schema of the chat application is simple enough, it has no need for st
58#### Permissioning
58#### Permissioning
59
59
60<p align="center">
60<p align="center">
61− <img src="images/8_chat_permissions_diagram.png"/>
61+ <img src="https://media.urbit.org/docs/userspace/graph-store/8_chat_permissions_diagram.png"/>
62</p>
62</p>
63
63
64Let's take a look at the permissions table in the diagram.
64Let's take a look at the permissions table in the diagram.
@@ -120,7 +120,7 @@ In this example, a switch statement is used to determine the `permissions` value
120#### Schema
120#### Schema
121
121
122<p align="center">
122<p align="center">
123− <img src="images/9_link_schema_diagram.png"/>
123+ <img src="https://media.urbit.org/docs/userspace/graph-store/9_link_schema_diagram.png"/>
124</p>
124</p>
125
125
126The root graph represents the whole Links collection. Every Links entry is a child node of this graph. Every Links entry is made up of:
126The root graph represents the whole Links collection. Every Links entry is a child node of this graph. Every Links entry is made up of:
@@ -187,11 +187,11 @@ It is important to note that you cannot directly edit the url or link afterwards
187#### Permissioning
187#### Permissioning
188
188
189<p align="center">
189<p align="center">
190− <img src="images/10_links_permissions_diagram_a.png"/>
190+ <img src="https://media.urbit.org/docs/userspace/graph-store/10_links_permissions_diagram_a.png"/>
191</p>
191</p>
192
192
193<p align="center">
193<p align="center">
194− <img src="images/11_links_permissions_diagram_b.png"/>
194+ <img src="https://media.urbit.org/docs/userspace/graph-store/11_links_permissions_diagram_b.png"/>
195</p>
195</p>
196
196
197Let's analyze the permissions structure.
197Let's analyze the permissions structure.
@@ -281,7 +281,7 @@ Here's how it is implemented [(source)](https://github.com/urbit/urbit/blob/mast
281#### Schema
281#### Schema
282
282
283<p align="center">
283<p align="center">
284− <img src="images/12_publish_schema_diagram.png"/>
284+ <img src="https://media.urbit.org/docs/userspace/graph-store/12_publish_schema_diagram.png"/>
285</p>
285</p>
286
286
287Here, a notebook, which is a collection of blog posts (called notes), is represented by the root graph. All data associated with the blog post is represented by the top level node, which is the note itself along with the associated comments. One level deeper, we see two container structures. The first one is the post revision container; it holds the edit history of your blog post. Every child node of this corresponds to the actual title and text of your blog post. The second one is the comments container. This represents the comment section of your blog post. Every child node of this is not a comment, but a comment revision container, which, as before, contains the edit history of your comment.
287Here, a notebook, which is a collection of blog posts (called notes), is represented by the root graph. All data associated with the blog post is represented by the top level node, which is the note itself along with the associated comments. One level deeper, we see two container structures. The first one is the post revision container; it holds the edit history of your blog post. Every child node of this corresponds to the actual title and text of your blog post. The second one is the comments container. This represents the comment section of your blog post. Every child node of this is not a comment, but a comment revision container, which, as before, contains the edit history of your comment.
@@ -367,11 +367,11 @@ Notably, the revision container for the blog post itself allows the post to be e
367#### Permissioning
367#### Permissioning
368
368
369<p align="center">
369<p align="center">
370− <img src="images/13_publish_permissions_diagram_a.png"/>
370+ <img src="https://media.urbit.org/docs/userspace/graph-store/13_publish_permissions_diagram_a.png"/>
371</p>
371</p>
372
372
373<p align="center">
373<p align="center">
374− <img src="images/14_publish_permissions_diagram_b.png"/>
374+ <img src="https://media.urbit.org/docs/userspace/graph-store/14_publish_permissions_diagram_b.png"/>
375</p>
375</p>
376
376
377Let's take a look at the permissioning structure for Publish.
377Let's take a look at the permissioning structure for Publish.