Google News
logo
OrientDB - Interview Questions
What is the difference between a vertex and an edge in OrientDB?
In OrientDB, a vertex and an edge are fundamental components of the graph data model, representing entities and relationships, respectively. Here are the key differences between vertices and edges in OrientDB:

Vertex :

* A vertex represents an entity or a node in the graph.
* Vertices are used to model individual objects, entities, or entities with attributes.
* Each vertex can have properties (attributes) associated with it, which describe the characteristics or attributes of the entity it represents.
* Examples of vertices include people, places, products, documents, or any other entity in the domain being modeled.
* Vertices are identified by a unique identifier within the graph database.
* Vertices can be connected to other vertices via edges, forming the structure of the graph.

Edge :

* An edge represents a relationship or connection between two vertices in the graph.
* Edges are used to model the associations, connections, or relationships between entities represented by vertices.
* Each edge has a source vertex (the starting point) and a target vertex (the ending point), indicating the directionality of the relationship.
* Edges can also have properties (attributes) associated with them, which describe additional information about the relationship.
* Examples of edges include "friendship" between people, "likes" between users and posts, "follows" between users in a social network, or "contains" between a folder and a document in a file system.
* Edges play a crucial role in defining the structure and connectivity of the graph by establishing relationships between vertices.
Advertisement