Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to solve STEP BY STEP in NEO4J Diagram Database

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

NEO4J diagram database how to solve STEP BY STEP, in view of this problem, this article introduces the corresponding analysis and solution in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible method.

I originally wanted to close the pen, and after the meeting on the application of social networks in risk control, it was mentioned that NEO4J would be slow to update the database. Of course, the general operation flow is to find the relevant information through the traditional database, and then find the NEO4J data according to the primary key to ensure the query speed. I vaguely remember that NOE4J supports indexes, but because NEO4J and traditional databases are very inconsistent, we need to verify whether the index can improve the speed of query and update.

With this in mind, began to do research in this area, NEO4J officials are very sure that INDEXES in a node, can speed up the correlation and improve performance. Through the application of INDEX in MATCH WHERE IN these three kinds of COLUMNS to improve the speed of related aspects of NEO4J.

However, the structural design of NEO4J is obviously different from that of traditional database, which is also reflected in the creation of index.

In the graph database, you need to understand three modules, nodes, relationships, and tags.

What is a tag? in NEO4J, a tag can be understood as a table, but it is not the same for the time being, because the nodes within the tag can be regarded as a group.

What is a node: a node records attributes, and a node can record multiple attributes, so we understand that nodes are the concept of rows.

Attribute name: column (no explanation)

What's confusing here is that the concept of a table is supposed to have rows, and this row of information must belong to this table, but in NEO4J nodes (rows) can have multiple tags, that is, this row may belong to multiple tables (temporarily understood in this way, there is a good way to correct). So it got involved.

The relationship can be understood as the traditional connection between the primary and foreign keys, but not completely, there is only a relationship, there is no concept of who should obey whom.

Okay, I know, speaking of which, basically the brain is messed up.

The following is a summary of what is in the NEO4J database in a way that is not associated with any traditional database.

Nodes, relationships and attributes are important components of graph database.

Both nodes and relationships contain attributes

Relational connection node

Property is a key-value pair

Nodes are represented by circles and relationships are represented by direction keys.

Relationships have directions: one-way and two-way.

Each relationship contains "start node" or "from node" and "to node" or "end node"

Back to the specific work, here is a sentence that requires us

MATCH (e1:Borrower {ApplicationNO_ID: "rt-996899991"}), (e2:borrower) where e1e2 and e1.Phone = e2.Phone Merge (E1)-[: `phone = `{Role:'9999999999'}]-> (E2)

(the data have been desensitized and are not real data)

It roughly means that the data of E1 node and E2 node are de-duplicated, and then it is found that when the phone is the same, establish a relationship between E1 node and E2 node. As we all know, the data of E1 is not equal to E2, and it must not be fast, and every time the data is updated, it must be very slow, and the measured data (less data) is about 700-900MS.

NEO4J, the establishment of data classes (table design) and query relationships is more brain-burning than traditional databases, so poor design can also cause problems.

The index has been added above, the PHONE attribute in the E1 E2 node. But it doesn't really help, the problem is that the data search is that the node is compared with all the attributes, and E1 and E2 are selected as long as one attribute is different (which is a bit like a full-row table scan). And then pick out the same phone number in the data. Then CREATE a relationship.

Basically, logical queries in most databases are difficult to do with the above logic. It must involve full table scanning.

So at present, two methods are feasible: 1 filter the data in the traditional database, filter the data directly and insert it into NEO4J.

2 you can try REDIS to upload the data of the two nodes and compare the KEY VALUE between REDIS. After all, the speed of the in-memory database is faster than that of all databases.

This is the answer to how to solve the STEP BY STEP problem in the NEO4J map database. I hope the above content can be of some help to you. If you still have a lot of doubts to solve, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report