What Graph DB
A graph database is a NoSQL type database system based on a topographical network structure. The idea stems from graph theory in mathematics, where graphs represent data sets using nodes, edges, and properties.
- Nodes or points are instances or entities of data which represent any object to be tracked, such as people, accounts, locations, etc.
- Edges or lines are the critical concepts in graph databases which represent relationships between nodes. The connections have a direction that is either unidirectional (one way) or bidirectional (two way).
- Properties represent descriptive information associated with nodes. In some cases, edges have properties as well.
Graph DB vs. RDMS
Graph DB | RDMS |
Nodes and edges with properties | Tables with rows and columns |
Represented with edges between nodes | Created using foreign keys between tables |
Flexible | Rigid |
Quick and responsive | Requires complex joins |
Systems with highly connected relationships | Transaction focused systems with more straightforward relationships |
Graph Database Use Case Examples
There are many notable examples where graph databases outperform other database modeling techniques, some of which include:
- Real-Time Recommendation Engines. Real-time product & ecomerce recommendations provide a better user experience while maximizing profitability. Notable cases include Netflix, eBay, and Walmart.
- Master Data Management. Linking all company data to one location for a single point of reference provides data consistency and accuracy. Master data management is crucial for large-scale global companies.
- GDPR and regulation compliances. Graphs make tracking of data movement and security easier to manage. The databases reduce the potential of data breaches and provide better consistency when removing data, improving trust with sensitive information.
- Digital asset management. The amount of digital content is massive and constantly increasing. Graph databases provide a scalable and straightforward database model to keep track of digital assets, such as documents, evaluations, contracts, etc.
- Context-aware services. Graphs help provide services related to actual-world characteristics. Whether it is natural disaster warnings, traffic updates, or product recommendations for a given location, graph databases offer a logical solution to real-life circumstances.
- Fraud detection. Finding suspicious patterns and uncovering fraudulent payment transactions is done in real-time using graph databases. Targeting and isolating parts of graphs provide quicker detection of deceptive behaviour.
- Semantic search. Natural language processing is ambiguous. Semantic searches help provide meaning behind keywords for more relevant results, which is easier to map using graph databases.
- Network management. Networks are linked graphs in their essence. Graphs reduce the time needed to alert a network administrator about problems in a network.
- Routing. Information travels through a network by finding optimal paths makes graph databases the perfect choice for routing.
Graph Databases?
Graph databases became more popular with the rise of big data and social media analytics. Many multi-model databases support graph modeling. However, there are numerous graph native databases available as well.
JanusGraph
JanusGraph is a distributed, open-source and scalable graph database system with a wide range of integration options catered to big data analytics. Some of the main features of JanusGraph include:
- Support for ACID Transaction with the ability to bear thousands of concurrent users.
- Multiple options for storing the graph data, such as cassandara or HBase.
- Complex search is available by default as well as optional support for Elasticsearch.
- Full integration with Apache Spark for advanced data analytics.
- JanusGraph uses the graph transversal query language Gremlin, which is Turing complete.
Neo4j
Neo4j (Network Exploration and Optimization 4 Java) is a graph database written in Java with native graph storage and processing. The main features of Neo4j are:
- The database is scalable through data partitioning into pieces known as shards.
- High availability provided through continuous backups and rolling upgrades.
- Multiple instances of databases are separable while remaining on one dedicated server, providing a high level of security.
- Neo4j uses the Cypher graph query language, which is programmer friendly.
DGraph
DGraph (Distributed graph) is an open-source distributed graph database system designed with scalability in mind. Some exciting features of DGraph include:
- Horizontal scalability for running in production with ACID transactions.
- DGraph is an open-source system with support for many open standards.
- The query language is GraphQL, which is designed for APIs.
DataStax Enterprise Graph
The DataStax Enterprise Graph is a distributed graph database based on Cassandra and optimized for enterprises. Features include:
- DataStax provides continuous availability for enterprise needs.
- The database integrates with offline Apache Spark seamlessly.
- Real-time search and analytics are fully integrated.
- Scalability available through multiple data centres.
- It supports Gremlin as well as CQL for querying.
Graph Database Pros & Cons
Pros
Some advantages of graph databases include:
- The structures are agile and flexible.
- The representation of relationships between entities is explicit.
- Queries output real-time results. The speed depends on the number of relationships.
Cons
The general disadvantages of graph databases are:
- There is no standardized query language. The language depends on the platform used.
- Graphs are inappropriate for transactional-based systems.
- The user base is small, making it hard to find support when facing a problem.
Article By:
“Rajendra Pachouri Hands-on Software Engineering, API, Cloud, IoT & DevOps experience, and a proven track record of architecting and delivering reliable and scalable systems in a variety of areas such as e-commerce, payments, security, home automation, financial systems, messaging services, EDI, EAI Microservices”.
Leave a Reply