AdBlock Detected

It looks like you're using an ad-blocker!

Our team work realy hard to produce quality content on this website and we noticed you have ad-blocking enabled. Advertisements and advertising enable us to continue working and provide high-quality content.

graph database

In this post, we are going to see What are Graph Databases and why they are used since they have emerged as an alternative to document databases in recent times.

What are Graph Databases?

Graph databases, or Graph-Oriented Databases (GODB), are based on Graph Theory, representing information in terms of vertices and edges. You may be familiar with the Dijkstra’s Algorithm.

GODB consists of nodes and relationships. A node can be identified as an entity that stores information, and a relationship or edge is the way these nodes are connected. Edges always have a start and an end, while nodes have an exact number of relationships.

When it comes to this type of databases, there are two common concepts regarding their structure: Labeled-Property Graph and Resource Description Framework (RDF).

In a Labeled-Property Graph structure, specific properties are assigned to both nodes and edges. On the other hand, if it is of the Resource Description Framework type, the structure is regulated using triples (node-edge-node schema) and quads (which have additional contextual information).

When to Use a Graph Database?

Graph databases can be used in a wide range of cases as they allow for a good analysis of information and utilization of nodes and relationships.

Perhaps the most typical use case for a graph database is analyzing the relationships between users in social networks, enabling recommendations for purchases or friends. Another common case is risk analysis or detecting tax frauds. They are also well-suited for route calculations, where the shortest path can be obtained using algorithms like Kruskal or Dijkstra.

Anything that comes to mind, which can be represented with nodes, can be modeled with a Graph Database, such as a neural network, computer network, etc.

Graph Database Characteristics

These types of Graph-Oriented Databases belong to the NoSQL group. Following the CAP theorem, they can be classified as either CA (Consistency, Availability) or PA (Partitioning, Availability). This is because, depending on the database engine used, one aspect can be sacrificed in favor of the other. For example, Neo4j is ACID and transactional but is penalized in partitioning.

Advantages and Disadvantages of a Graph Database

Advantages:

  • Difficult to scale as they are server-oriented.
  • No defined query language.

Disadvantages:

  • Offer real-time results.
  • Flexible structures.
  • The speed depends on the number of relationships, not the volume of data as it might happen in a relational database.
  • Although we mentioned that they are difficult to scale, we can improve performance by adding nodes at any time.

Examples of Graph Databases

  • Neo4j: The most well-known and popular, it is open-source.
  • Amazon Neptune: A graph database that can be used through AWS.
  • OrientDB: Offers high speed.

Conclusion

Although we have not delved into technical details or development examples in this post about What are graph databases and why are used, we have seen some highlights of their usage and gained a better understanding of what they consist of.

Leave a Reply

Your email address will not be published. Required fields are marked *