Many businesses today still store persistent application data
(unstructured data) in cloud file systems or external storage devices
like local HDDs and structured data in relational database management
systems (RDBMSs). NoSQL graph database technology is, however, gaining
in popularity, begging the question; is this new technology likely to
ever overtake the time-tested SQL technology?
Benefits of NoSQL Graph DBs over Relational DBs
1. No explicit data scheme: The schema-defined relational model in RDBMSs has tables made up of a collection of rows and columns that is strictly defined and relationships between a row in one table and a row in another can be established. However, there might be other kinds of relationships between records that you may want to query and storing data in a table is not convenient in some circumstances. NoSQL is the emerging alternative.
2. With NoSQL, there’s no explicit data scheme – the scheme used (if at all) is inferred from the stored data. This means you will not be forcing a data model for something it is not designed for. Graph DBs is one such model, the other being Column-Oriented Stores, Document Stores, and Key-Value (K-V) Stores.
3. Emphasis on navigation: Graph DBs emphasize navigation. A group of related objects are pulled together by a root object (nodes, properties, and edges). With relational DBs, navigation is via joins, join tables, and foreign keys, and this navigation is both unnatural and cumbersome (and many DB developers are not skilled in such navigations).
4. Great recursion handling: Relational DBs do not handle recursion very well. Although most vendor products have recursion extensions, they are awkward, unnatural grafts on SQL. You should, therefore, use graph databases for applications where recursion occurs.
5. Fewer overheads: Relational DBs, because of the nature of SQL, have a lot of overhead when it comes to multi-user locking. This makes it difficult to access not only their data, but also individual objects.
6. Easy information retrieval: On social network, connections between data are just as important as the data itself. With the graph data model, the node and all node connections are stored and so only the node’s memory needs to be read (there are no additional steps of computing connected data as is the case with relational DBs). This means faster and more scalable finding of interconnected data.
7. Improved capacity: A good modern graph DB can handle many nodes and edges with a huge number of properties while some can even handle transactions. The likes of Oracle DB can handle tens of billions of relationships and nodes, but note the speed will depend on your server’s RAM.
8. ACID support: One of the greatest benefits of SQL DBs is ACID support, but more and more distributed graph DBs can today support eventual consistency or ACID. Today’s distributed graph DBs can also be configured to run atop popular NoSQL DBs.
How do Graph DBs work?
Graph DBs use graph structures for semantic queries. Data is stored and represented by nodes, properties, and edges. Data items in the store are directly related and you can retrieve them with a single operation.
Graph DBs are different from relational DBs in that the links between data are in the data itself. The JOIN concept is used to collect related data following queries search. Graph DBs are similar tonetwork-model DBs of the 70s in that they both represent general graphs, but the latter operate at a lower abstraction level and traversing them over a chain of edges is not easy.
The storage mechanism used by different graph DB products varies. Some use document oriented DB OR key-value store for storage and others use relational engine and the graph data is stored in a table. This makes graph DBs NoSQL.
Although standardization efforts are being made (leading to the likes of Gremlin and SPARQL), no single query language has risen to prominence. Most of the systems used are dependent on the particular product.
Nodes represent such entities as people, accounts, and businesses that you may want to track. They are the rough equivalent of rows, relations, or record in relational DB and documents in document DBs.
Edges (relationships/graphs) are the lines that interconnect nodes and they represent the relationships between them. You get patterns when you examine the connections and interconnections of edges, properties, and nodes. Edges form the major difference between graph DBs and relational DBs.
Properties refer to the pertinent info relating to the node. An example of this is the letter “O”, downloads, and website would be the properties of Oracle if Oracle were a node.
How to move from Relational DB to Graph DB
You can seamlessly migrate from a relational DB to a graph DB. To transform from relational DB to graph DB, some of the changes you need to make include:
• Use your entry tables as nodes.
• Use rows in entity tables as nodes.
• Use columns in tables as node properties.
• Keep business primary keys and remove technical primary keys
• Use unique constraints for your business primary keys
• Add indexes for attributes that are frequently looked up
• Remove foreign keys and replace them with relationships to the other table
• Remove data that has default values
• Pull out data in tables that are duplicated and de-normalized into separate nodes to get a clean model
• Use indexed column names as array property
• Transform join tables into relationships. Columns on these tables will be relationship properties.
You will need an understanding of the graph model before you start data importation. After the importation, all you will need to do is hydrate the model. Consider hiring a pro for the job to prevent data loss during the migration. If you have an Oracle DB, you can get Oracle Remote DBA service for this.
The great benefits of NoSQL graph DBs is the reason the likes of Twitter and Facebook have homegrown graph DBs.Even The NSA uses graph databases. Other than social media data mining, which has been described here, graph DBs are also useful in business disciplines that involve dynamic schema and complex relationships such as supply chain management, in recommendations, and in finding the source of IP telephone issues.
Author Bio: Sujain Thomas is a database admin with many years of experience. She has skills in both SQL and NoSQL technologies. She also offers Oracle Remote DBA services.
Benefits of NoSQL Graph DBs over Relational DBs
1. No explicit data scheme: The schema-defined relational model in RDBMSs has tables made up of a collection of rows and columns that is strictly defined and relationships between a row in one table and a row in another can be established. However, there might be other kinds of relationships between records that you may want to query and storing data in a table is not convenient in some circumstances. NoSQL is the emerging alternative.
2. With NoSQL, there’s no explicit data scheme – the scheme used (if at all) is inferred from the stored data. This means you will not be forcing a data model for something it is not designed for. Graph DBs is one such model, the other being Column-Oriented Stores, Document Stores, and Key-Value (K-V) Stores.
3. Emphasis on navigation: Graph DBs emphasize navigation. A group of related objects are pulled together by a root object (nodes, properties, and edges). With relational DBs, navigation is via joins, join tables, and foreign keys, and this navigation is both unnatural and cumbersome (and many DB developers are not skilled in such navigations).
4. Great recursion handling: Relational DBs do not handle recursion very well. Although most vendor products have recursion extensions, they are awkward, unnatural grafts on SQL. You should, therefore, use graph databases for applications where recursion occurs.
5. Fewer overheads: Relational DBs, because of the nature of SQL, have a lot of overhead when it comes to multi-user locking. This makes it difficult to access not only their data, but also individual objects.
6. Easy information retrieval: On social network, connections between data are just as important as the data itself. With the graph data model, the node and all node connections are stored and so only the node’s memory needs to be read (there are no additional steps of computing connected data as is the case with relational DBs). This means faster and more scalable finding of interconnected data.
7. Improved capacity: A good modern graph DB can handle many nodes and edges with a huge number of properties while some can even handle transactions. The likes of Oracle DB can handle tens of billions of relationships and nodes, but note the speed will depend on your server’s RAM.
8. ACID support: One of the greatest benefits of SQL DBs is ACID support, but more and more distributed graph DBs can today support eventual consistency or ACID. Today’s distributed graph DBs can also be configured to run atop popular NoSQL DBs.
How do Graph DBs work?
Graph DBs use graph structures for semantic queries. Data is stored and represented by nodes, properties, and edges. Data items in the store are directly related and you can retrieve them with a single operation.
Graph DBs are different from relational DBs in that the links between data are in the data itself. The JOIN concept is used to collect related data following queries search. Graph DBs are similar tonetwork-model DBs of the 70s in that they both represent general graphs, but the latter operate at a lower abstraction level and traversing them over a chain of edges is not easy.
The storage mechanism used by different graph DB products varies. Some use document oriented DB OR key-value store for storage and others use relational engine and the graph data is stored in a table. This makes graph DBs NoSQL.
Although standardization efforts are being made (leading to the likes of Gremlin and SPARQL), no single query language has risen to prominence. Most of the systems used are dependent on the particular product.
Nodes represent such entities as people, accounts, and businesses that you may want to track. They are the rough equivalent of rows, relations, or record in relational DB and documents in document DBs.
Edges (relationships/graphs) are the lines that interconnect nodes and they represent the relationships between them. You get patterns when you examine the connections and interconnections of edges, properties, and nodes. Edges form the major difference between graph DBs and relational DBs.
Properties refer to the pertinent info relating to the node. An example of this is the letter “O”, downloads, and website would be the properties of Oracle if Oracle were a node.
How to move from Relational DB to Graph DB
You can seamlessly migrate from a relational DB to a graph DB. To transform from relational DB to graph DB, some of the changes you need to make include:
• Use your entry tables as nodes.
• Use rows in entity tables as nodes.
• Use columns in tables as node properties.
• Keep business primary keys and remove technical primary keys
• Use unique constraints for your business primary keys
• Add indexes for attributes that are frequently looked up
• Remove foreign keys and replace them with relationships to the other table
• Remove data that has default values
• Pull out data in tables that are duplicated and de-normalized into separate nodes to get a clean model
• Use indexed column names as array property
• Transform join tables into relationships. Columns on these tables will be relationship properties.
You will need an understanding of the graph model before you start data importation. After the importation, all you will need to do is hydrate the model. Consider hiring a pro for the job to prevent data loss during the migration. If you have an Oracle DB, you can get Oracle Remote DBA service for this.
The great benefits of NoSQL graph DBs is the reason the likes of Twitter and Facebook have homegrown graph DBs.Even The NSA uses graph databases. Other than social media data mining, which has been described here, graph DBs are also useful in business disciplines that involve dynamic schema and complex relationships such as supply chain management, in recommendations, and in finding the source of IP telephone issues.
Author Bio: Sujain Thomas is a database admin with many years of experience. She has skills in both SQL and NoSQL technologies. She also offers Oracle Remote DBA services.
No comments:
Post a Comment