Basics Of Graph Database

Introduction

In this article, we will explore the graph database and all related main components of the graph database.

Graph Database

  • Graph Database is a database designed to treat the relationship between data as equal to the data itself.
  • Graph Database stores the data without creating any data model.
  • In today's world of big data, the only database which is able to store and process-related information will be able to correlate all the related information along with the data.
  • A graph database can store actual data along with the related information to work with such a big amount of data.
  • Since the Graph database maintains all the relationships along with the data, it is very efficient and faster to access the data.
  • For small as well big size data, a Graph database is able to manage interconnection between the data sources and it also supports complex queries.

Graph Database Properties

After understanding the basics of Graph Database, we will explore about properties of Graph Database.

Nodes

  • Nodes can be defined as the entity in the graph. It mainly consists of key-value pair.
  • The node can contain any number of key-value pairs.
  • Node key-value pairs are known as "properties".
  • We can define labels while creating nodes.
  • We can attach metadata with the node while defining the label properties.

Relationship

  • The relationship can be defined as a bridge between the nodes.
  • When we define the relationship between the node, it always has a direction.
  • Similar to node, the relationship can also have properties defined.
  • Most of the relationship properties will be defined in quantitative ways.

Basics of Graph Database

Use Cases for Graph Database

Graph Databases are most useful when we want to store data for which we also want to maintain the relationship between the data.

Knowledge Graphs

Enterprise organizations use a graph database to maintain the logical connections between the experiments and projects.

Recommendation Engine

We can use a recommendation engine with Graph Database to provide recommendations for the eCommerce products etc.

Supply Chain Management

Graph database helps organizations to identify the single point of failure to protect and safeguard production supplies.

Available Graph Database in the Market

In today's market, there are multiple graph databases available from different service providers. Below are few examples of available graph databases in the market.

  • Neo4j
  • ArangoDB
  • OrientDB
  • Dgraph
  • Amazon Neptune
  • FlockDB
  • DataStax
  • Cassandra
  • Azure Cosmos DB

After understanding the core concepts of Graph Databases, Let's explore the Azure Cosmos DB offering with Gremlin API for Graph Database.

Cosmos DB with Gremlin API

  • Cosmos DB with Gremlin API allows end-users to run the graph queries and store data as edges and vertices.
  • It is also possible to handle multiple connections and handle complex queries with Cosmos DB with Gremlin API
  • Azure Cosmos DB is a combination of graph databases with scalable infrastructure.
  • Azure Cosmos DB with Gremlin API is built on top of Apache Tinker Pop.
  • It uses the same query language as Tinker Pop to query and insert data into Azure Cosmos DB.

Features of Azure Cosmos DB

  • Scalable Storage
  • High Available Replication with multiple regions
  • Reduce latency
  • Efficient Query Execution
  • Automatic Indexing
  • Compatibility with Apache TinkerPop
  • Multiple support of consistency level

We can query the data in Azure Cosmos DB as follows,

g.V().count()

To count the number of vertices in the Graph Database.

Conclusion

In this article, we explored the Graph Database, its components, available graph databases in the market. In addition to that, we also explored the Azure Cosmos DB with Gremlin API and its features.

Want to learn more about Graph Databases, read What is a Graph Database


Similar Articles