Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data model #525

Merged
merged 5 commits into from
Jun 23, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 16 additions & 8 deletions docs-2.0/1.introduction/1.what-is-nebula-graph.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@ Nebula Graph is open under the Apache 2.0 and the Commons Clause 1.0 licenses. M

Written in C++ and born for graph, Nebula Graph handles graph queries in milliseconds. Among most databases, Nebula Graph shows superior performance in providing graph data services. The larger the data size, the greater the superiority of Nebula Graph. For more information, see [Nebula Graph benchmarking](https://discuss.nebula-graph.io/t/nebula-graph-1-0-benchmark-report/581).

### High scalability

Nebula Graph is designed in a shared-nothing architecture and supports scaling in and out without interrupting the database service.

### Developer friendly

Nebula Graph supports clients in popular programming languages like Java, Python, C++, and Go, and more are being developed. For more information, see Nebula Graph [clients](../20.appendix/6.eco-tool-version.md).

### Reliable access control

Nebula Graph supports strict role-based access control and external authentication servers such as LDAP (Lightweight Directory Access Protocol) servers to enhance data security. For more information, see [Authentication and authorization](../7.data-security/1.authentication/1.authentication.md).

### Diversified ecosystem

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-spark-utils/tree/v2.0.0/nebula-exchange). 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).
Expand All @@ -36,14 +44,6 @@ The native Nebula Graph Query Language, also known as nGQL, is a declarative, op

You can easily model the connected data into Nebula Graph for your business without forcing them into a structure such as a relational table, and properties can be added, updated, and deleted freely. For more information, see [Data modeling](2.data-model.md).

### Reliable access control

Nebula Graph supports strict role-based access control and external authentication servers such as LDAP (Lightweight Directory Access Protocol) servers to enhance data security. For more information, see [Authentication and authorization](../7.data-security/1.authentication/1.authentication.md).

### High scalability

Nebula Graph is designed in a shared-nothing architecture and supports scaling in and out without interrupting the database service.

### High popularity

Nebula Graph is being used by tech leaders such as Tencent, Vivo, Meituan, and JD Digits. For more information, visit the [Nebula Graph official website](https://nebula-graph.io/).
Expand All @@ -67,3 +67,11 @@ Natural languages can be transformed into knowledge graphs and stored in Nebula
### Social networking

Information on people and their relationships are typical graph data. Nebula Graph can easily handle the social networking information of billions of people and trillions of relationships, and provide lightning-fast queries for friend recommendations and job promotions in the case of massive concurrency.

## Related links

- [Official website](https://www.vesoft.com/en/)
- [Docs](https://docs.nebula-graph.io/master/)
- [Blog](https://nebula-graph.io/posts/)
- [Forum](https://discuss.nebula-graph.io)
- [GitHub](https://github.com/vesoft-inc)
28 changes: 19 additions & 9 deletions docs-2.0/1.introduction/2.data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,29 @@ A data model is a model that organizes data and specifies how they are related t

## Data structures

Nebula Graph data model uses five data structures to store data. They are vertices, edges, properties, tags, and edge types.
Nebula Graph data model uses six data structures to store data. They are graph spaces, vertices, edges, properties, tags, and edge types.

- **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.
- A vertex must have at least one tag.
- 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.
- An edge is identified uniquely with a source vertex, an edge type, a rank value, and a destination vertex.
- 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 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.
- **Properties**: Properties are key-value pairs. Both vertices and edges are containers for properties.
- **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 graph and edge graph in the relational databases.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vertex table and edge table


## Directed property graph

Nebula Graph stores data in directed property graphs. A directed property graph has a set of vertices connected by edges. And the edges have directions. A directed property graph is represented as:
Nebula Graph stores data in directed property graphs. A directed property graph has a set of vertices connected by directed edges. Both vertices and edges can have properties. A directed property graph is represented as:

**G = < V, E, P<sub>V</sub>, P<sub>E</sub> >**

Expand All @@ -29,11 +35,15 @@ 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 **_like_**.
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.
| Edge type | **serve** | start_year (int) <br /> end_year (int) | Represents actions taken by players in the team. An action links a player and a team and the direction is from a player to a team. |
| Edge type | **like** | likeness (int) | Represents actions taken by players in the team. An action links a player and another player and the direction is from one player to the other player. |
| Edge type | **serve** | start_year (int) <br /> end_year (int) | Represents actions taken by players in the team. 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. An action links a player with another player, and the direction is from one player to the other player. |

!!! Note

Nebula Graph supports only directed edges.