Skip to content

Commit

Permalink
modify details of introduction (#978)
Browse files Browse the repository at this point in the history
  • Loading branch information
izhuxiaoqing authored Dec 21, 2021
1 parent 3413b84 commit 6ecb5d3
Show file tree
Hide file tree
Showing 8 changed files with 57 additions and 47 deletions.
7 changes: 3 additions & 4 deletions docs-2.0/1.introduction/1.what-is-nebula-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Graph databases are well suited for storing most kinds of data models abstracted

Nebula Graph, as a typical native graph database, allows you to store the rich relationships as edges with edge types and properties directly attached to them.

## Benefits of Nebula Graph
## Advantages of Nebula Graph

### Open-source

Expand All @@ -40,16 +40,15 @@ Nebula Graph supports strict role-based access control and external authenticati

More and more native tools of Nebula Graph have been released, such as [Nebula Graph Studio](https://github.com/vesoft-inc/nebula-web-docker), [Nebula Console](https://github.com/vesoft-inc/nebula-console), and [Nebula Exchange](https://github.com/vesoft-inc/nebula-exchange). For more ecosystem tools, see [Ecosystem tools overview](../20.appendix/6.eco-tool-version.md).

Besides, Nebula Graph has the ability to be integrated with many cutting-edge technologies, such as Spark, Flink, and HBase, for the purpose of mutual strengthening in a world of increasing challenges and chances. For more information, see [Ecosystem development](../20.appendix/6.eco-tool-version.md).
Besides, Nebula Graph has the ability to be integrated with many cutting-edge technologies, such as Spark, Flink, and HBase, for the purpose of mutual strengthening in a world of increasing challenges and chances.

### OpenCypher-compatible query language

The native Nebula Graph Query Language, also known as nGQL, is a declarative, openCypher-compatible textual query language. It is easy to understand and easy to use. For more information, see [nGQL guide](../3.ngql-guide/1.nGQL-overview/1.overview.md).

### Future-oriented hardware with balanced reading and writing

Solid-state drives have extremely high performance and [they are getting cheaper](https://blocksandfiles.com/wp-content/uploads/2021/01/Wikibon-SSD-less-than-HDD-in-2026.jpg).
Nebula Graph is a product based on SSD. Compared with products based on HDD and large memory, it is more suitable for future hardware trends and easier to achieve balanced reading and writing.
Solid-state drives have extremely high performance and [they are getting cheaper](https://blocksandfiles.com/wp-content/uploads/2021/01/Wikibon-SSD-less-than-HDD-in-2026.jpg). Nebula Graph is a product based on SSD. Compared with products based on HDD and large memory, it is more suitable for future hardware trends and easier to achieve balanced reading and writing.

### Easy data modeling and high flexibility

Expand Down
14 changes: 7 additions & 7 deletions docs-2.0/1.introduction/2.1.path.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ In graph theory, a path in a graph is a finite or infinite sequence of edges whi

Paths can be categorized into 3 types: `walk`, `trail`, and `path`. For more information, see [Wikipedia](https://en.wikipedia.org/wiki/Path_(graph_theory)#Walk,_trail,_path).

The following picture is an example for a brief introduction.
The following figure is an example for a brief introduction.

![path](../images/path1.png)

## Walk

A `walk` is a finite or infinite sequence of edges. Both vertices and edges can be repeatedly visited in graph traversal.

In the above picture C, D, and E form a cycle. So, this picture contains infinite paths, such as `A->B->C->D->E`, `A->B->C->D->E->C`, and `A->B->C->D->E->C->D`.
In the above figure C, D, and E form a cycle. So, this figure contains infinite paths, such as `A->B->C->D->E`, `A->B->C->D->E->C`, and `A->B->C->D->E->C->D`.

!!! note

Expand All @@ -22,26 +22,26 @@ In the above picture C, D, and E form a cycle. So, this picture contains infinit

A `trail` is a finite sequence of edges. Only vertices can be repeatedly visited in graph traversal. The Seven Bridges of Königsberg is a typical `trail`.

In the above picture, edges cannot be repeatedly visited. So, this picture contains finite paths. The longest path in this picture consists of 5 edges: `A->B->C->D->E->C`.
In the above figure, edges cannot be repeatedly visited. So, this figure contains finite paths. The longest path in this figure consists of 5 edges: `A->B->C->D->E->C`.

!!! note

`MATCH`, `FIND PATH`, and `GET SUBGRAPH` statements use `trail`.

There are two special cases of trail, `cycle`, and `circuit`. The following picture is an example for a brief introduction.
There are two special cases of trail, `cycle` and `circuit`. The following figure is an example for a brief introduction.

![trail](../images/Circuits1.png)

- cycle

A `cycle` refers to a closed `trail`. Only the terminal vertices can be repeatedly visited. The longest path in this picture consists of 3 edges: `A->B->C->A` or `C->D->E->C`.
A `cycle` refers to a closed `trail`. Only the terminal vertices can be repeatedly visited. The longest path in this figure consists of 3 edges: `A->B->C->A` or `C->D->E->C`.

- circuit

A `circuit` refers to a closed `trail`. Edges cannot be repeatedly visited in graph traversal. Apart from the terminal vertices, other vertices can also be repeatedly visited. The longest path in this picture: `A->B->C->D->E->C->A`.
A `circuit` refers to a closed `trail`. Edges cannot be repeatedly visited in graph traversal. Apart from the terminal vertices, other vertices can also be repeatedly visited. The longest path in this figure: `A->B->C->D->E->C->A`.

## Path

A `path` is a finite sequence of edges. Neither vertices nor edges can be repeatedly visited in graph traversal.

So, the above picture contains finite paths. The longest path in this picture consists of 4 edges: `A->B->C->D->E`.
So, the above figure contains finite paths. The longest path in this figure consists of 4 edges: `A->B->C->D->E`.
15 changes: 10 additions & 5 deletions docs-2.0/1.introduction/2.data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,27 @@ A data model is a model that organizes data and specifies how they are related t
Nebula Graph data model uses six data structures to store data. They are graph spaces, vertices, edges, tags, edge types and properties.

- **Graph spaces**: Graph spaces are used to isolate data from different teams or programs. Data stored in different graph spaces are securely isolated. Storage replications, privileges, and partitions can be assigned.

- **Vertices**: Vertices are used to store entities.
- In Nebula Graph, vertices are identified with vertex identifiers (i.e. `VID`). The `VID` must be unique in the same graph space. VID should be int64, or fixed_string(N).
- A vertex must have at least one tag or multiple tags.

- **Edges**: Edges are used to connect vertices. An edge is a connection or behavior between two vertices.
- There can be multiple edges between two vertices.
- Edges are directed. `->` identifies the directions of edges. Edges can be traversed in either direction.
- An edge is identified uniquely with a source vertex, an edge type, a rank value, and a destination vertex. Edges have no EID.
- An edge is identified uniquely with `<a source vertex, an edge type, a rank value, and a destination vertex>`. Edges have no EID.
- An edge must have one and only one edge type.
- The rank value is an immutable user-assigned 64-bit signed integer. It identifies the edges with the same edge type between two vertices. Edges are sorted by their rank values. The edge with the greatest rank value is listed first. The default rank value is zero.

- **Tags**: Tags are used to categorize vertices. Vertices that have the same tag share the same definition of properties.

- **Edge types**: Edge types are used to categorize edges. Edges that have the same edge type share the same definition of properties.

- **Properties**: Properties are key-value pairs. Both vertices and edges are containers for properties.

!!! Note

Tag and Edge type are similar to the vertex table and edge table in the relational databases.
Tags and Edge types are similar to "vertex tables" and "edge tables" in the relational databases.

## Directed property graph

Expand All @@ -35,12 +40,12 @@ Nebula Graph stores data in directed property graphs. A directed property graph
- **P<sub>V</sub>** is the property of vertices.
- **P<sub>E</sub>** is the property of edges.

The following table is an example of the structure of the basketball player dataset. We have two types of vertices, that is **player** and **team**, and two types of edges, that is **_serve_** and **_follow_**.
The following table is an example of the structure of the basketball player dataset. We have two types of vertices, that is **player** and **team**, and two types of edges, that is **serve** and **follow**.

| Element | Name | Property name (Data type) | Description |
| :--- | :--- | :--- | :--- |
| Tag | **player** | name (string) <br>age (int) | Represents players in the team. |
| Tag | **team** | name (string) | Represents the teams.
| Tag | **team** | name (string) | Represents the teams. |
| Edge type | **serve** | start_year (int) <br> end_year (int) | Represents actions taken by players in the team.<br>An action links a player with a team, and the direction is from a player to a team. |
| Edge type | **follow** | degree (int) | Represents actions taken by players in the team.<br>An action links a player with another player, and the direction is from one player to the other player. |

Expand All @@ -49,7 +54,7 @@ The following table is an example of the structure of the basketball player data
Nebula Graph supports only directed edges.

!!! compatibility

Nebula Graph {{ nebula.release }} allows dangling edges. Therefore, when adding or deleting, you need to ensure the corresponding source vertex and destination vertex of an edge exist. For details, see [INSERT VERTEX](../3.ngql-guide/12.vertex-statements/1.insert-vertex.md), [DELETE VERTEX](../3.ngql-guide/12.vertex-statements/4.delete-vertex.md), [INSERT EDGE](../3.ngql-guide/13.edge-statements/1.insert-edge.md), and [DELETE EDGE](../3.ngql-guide/13.edge-statements/4.delete-edge.md).

The MERGE statement in openCypher is not supported.
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,20 @@ Nebula Graph applies the separation of storage and computing architecture. The G

* Great scalability

The separated structure makes both the Graph Service and the Storage Service flexible and easy to scale in or out.
The separated structure makes both the Graph Service and the Storage Service flexible and easy to scale in or out.

* High availability

If part of the Graph Service fails, the data stored by the Storage Service suffers no loss. And if the rest part of the Graph Service is still able to serve the clients, service recovery can be performed quickly, even unfelt by the users.
If part of the Graph Service fails, the data stored by the Storage Service suffers no loss. And if the rest part of the Graph Service is still able to serve the clients, service recovery can be performed quickly, even unfelt by the users.

* Cost-effective

The separation of storage and computing architecture provides a higher resource utilization rate, and it enables clients to manage the cost flexibly according to business demands. The cost savings can be more distinct if the [Nebula Graph Cloud](https://www.nebula-cloud.io/ "Nebula Graph Cloud official website") service is used.
The separation of storage and computing architecture provides a higher resource utilization rate, and it enables clients to manage the cost flexibly according to business demands.

<!--The cost savings can be more distinct if the [Nebula Graph Cloud](https://www.nebula-cloud.io/ "Nebula Graph Cloud official website") service is used.-->

* Open to more possibilities

With the ability to run separately, the Graph Service may work with multiple types of storage engines, and the Storage Service may also serve more types of computing engines.
With the ability to run separately, the Graph Service may work with multiple types of storage engines, and the Storage Service may also serve more types of computing engines.

For details on the Graph Service and the Storage Service, see [Graph Service](3.graph-service.md) and [Storage Service](4.storage-service.md).
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The leader is elected by the majorities and only the leader can provide service

The Meta Service stores the information of user accounts and the privileges granted to the accounts. When the clients send queries to the Meta Service through an account, the Meta Service checks the account information and whether the account has the right privileges to execute the queries or not.

For more information on Nebula Graph access control, see [Authentication and authorization](../../7.data-security/1.authentication/1.authentication.md).
For more information on Nebula Graph access control, see [Authentication](../../7.data-security/1.authentication/1.authentication.md).

### Manages partitions

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Graph Service

Graph Service is used to process the query. It has four submodules: Parser, Validator, Planner, and Executor. This topic will describe Graph Service accordingly.
The Graph Service is used to process the query. It has four submodules: Parser, Validator, Planner, and Executor. This topic will describe the Graph Service accordingly.

## The architecture of Graph Service
## The architecture of the Graph Service

![The architecture of the Graph Service](https://docs-cdn.nebula-graph.com.cn/docs-2.0/1.introduction/2.nebula-graph-architecture/query-engine-architecture.png)

After a query is sent to Graph Service, it will be processed by the following four submodules:
After a query is sent to the Graph Service, it will be processed by the following four submodules:

1. **Parser**: Performs lexical analysis and syntax analysis.

Expand All @@ -18,9 +18,9 @@ After a query is sent to Graph Service, it will be processed by the following fo

## Parser

After receiving a request, the statements will be parsed by the Parser composed of Flex (lexical analysis tool) and Bison (syntax analysis tool), and its corresponding AST will be generated. Statements will be directly intercepted in this stage because of its invalid syntax.
After receiving a request, the statements will be parsed by Parser composed of Flex (lexical analysis tool) and Bison (syntax analysis tool), and its corresponding AST will be generated. Statements will be directly intercepted in this stage because of its invalid syntax.

For example, the structure of the AST of `GO FROM "Tim" OVER like WHERE properties(edge).likeness > 8.0 YIELD dst(edge)` is shown in the following picture.
For example, the structure of the AST of `GO FROM "Tim" OVER like WHERE properties(edge).likeness > 8.0 YIELD dst(edge)` is shown in the following figure.

![AST](https://docs-cdn.nebula-graph.com.cn/docs-2.0/1.introduction/2.nebula-graph-architecture/parser-ast-tree.png)

Expand Down Expand Up @@ -70,7 +70,7 @@ In the `nebula-graphd.conf` file, when `enable_optimizer` is set to be `true`, P

- Before optimization

In the execution plan on the right side of the preceding picture, each node directly depends on other nodes. For example, the root node `Project` depends on the `Filter` node, the `Filter` node depends on the `GetNeighbor` node, and so on, up to the leaf node `Start`. Then the execution plan is (not truly) executed.
In the execution plan on the right side of the preceding figure, each node directly depends on other nodes. For example, the root node `Project` depends on the `Filter` node, the `Filter` node depends on the `GetNeighbor` node, and so on, up to the leaf node `Start`. Then the execution plan is (not truly) executed.

During this stage, every node has its input and output variables, which are stored in a hash table. The execution plan is not truly executed, so the value of each key in the associated hash table is empty (except for the `Start` node, where the input variables hold the starting data), and the hash table is defined in `src/context/ExecutionContext.cpp` under the `nebula-graph` repository.

Expand Down
Loading

0 comments on commit 6ecb5d3

Please sign in to comment.