Graph database knowledge for developers

image


What business architects should know


The graph databases we can get on Google are all academic content, such as descriptions about graph databases, such as the seven bridges of Koigsberg, and Berners-Lee, the inventor of the World Wide Web.


Some theories and visions are good, but for me, I think guiding relevance is very important.


So why are graph databases so important to us?


image


Imagine saving the data of a local restaurant chain. For example, if we want to track customer information, we can store the TA's information in a data table, and the sales data in a table. If we want to know the status of the products sold, the detours in the ordering library, and who the most loyal customers are, you can Very convenient query.


However, the relational database lacks the organizational structure and the connection relationship between projects. The graph database stores the same type of data and can also store the links between things. For example, Lao Wang bought a lot of Coke, and Lao Zhang and Xiaoli got married and bought a red wine drink. I don't need to use JOIN to query what product should be pushed to each customer. Through the relationship in the data, I don't need to make assumptions to test it.


This new layer of connected information does a lot to help us. It is not only related to customer intentions, but also provides value for many use cases. It is especially useful in machine learning or when you want machines to perform analysis or inference.


image


Since traditional databases are designed with tables instead of data links, SQL will no longer be used. Graph databases provide languages ​​similar to SQL, such as SparQL, Gremlin, and Cypher.


One major difference is the need to use analysis capabilities for link data. For example, if we want to find the most popular item to buy on the website, if we want to rank the popularity of an item, then we have to use a new grammar, and we need to learn a language that connects data to make the most of it.


Can't this be done with RDBMS


Of course, you can create these relational links in a traditional relational database management system (RDBMS). However, if you want to perform tasks in a traditional database, the DBA must carefully design the relationship between the unique key and the JOIN. If we use a graph database, then the topics and their relationships (called subject and predicate) are known, and there is no need to rebuild the connection.


For example, if you define Ma Li as Xiaowan's mother, then you can steal the example of Xiaowan as Ma Li. We don't need to specify two kinds of relations anymore, the graph database is very smart in this respect. In contrast, RDBMS cannot understand any undefined content. Therefore, this reasoning ability has obvious value when looking at interests, families, and communities.


Expertise of Graph Database


Like RDBMS, graph databases can be transactional or analytical. The graph database has a different focus. For example, the popular Neo4j focuses on transaction (OLTP) graph databases, while AnzoGraph is an analytical (OLAP) graph database. When we use a graph database for the first time, there will be some differences. Therefore, we may need a different engine to run quick queries involving a single entity, such as what car Susan has, and query analysis that polls the entire database, such as the average price of Susan and others for buying a car.


With the development of machine learning and artificial intelligence, graph database OLAP has become more and more important. Many machine learning algorithms are essentially graph computing, so running on graph OLAP database will be more effective than running on RDBMS.


Guess you like

Origin blog.51cto.com/15127566/2665858