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

Figure introduction of database Neo4j and installation and deployment

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

Share

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

Neo4j is the leader of today's market graph database. It has enterprise-level functions such as scalability and high availability, and is the best choice to meet our needs.

What kind of problems does the graph database solve?

Why choose Neo4j?

Relational databases can not handle relationships well.

NoSQL database does not handle relationships

Neo4j is a graphic database based on Java. To run Neo4j, you need to start the JVM process, so you must install JDK for JAVA SE.

# step 1: install jdk

Wget-c http://download.cashalo.com/schema/auto_jdk.shsource auto_jdk.sh

# step 2: execute the following automated installation script

#! / bin/bash#neo4j installation # 1) set hosts binding IP= `ifconfig | sed-n 2p | awk'{print $2}'| cut-d ":"-f2`echo "$IP neo4j" > > / etc/hosts#2) download and install neo4jcd / home/toolswget-c https://neo4j.com/artifact.php?name=neo4j-community-3.4.14-unix.tar.gztar zxvf artifact.php\? name\ = neo4j-community-3.4.14-unix.tar.gz-C / usr/local/ln-s / usr/local/neo4j-community-3.4.14 / usr/local/neo4j-community#3) configure the environment variable cat > / etc/profile.d/neo4j & 2 exit 3 ; esacEOF#6) set permissions chmod + x / etc/init.d/neo4j#7) launch neo4jservice neo4j start#8) configure boot self-boot chkconfig neo4j on

Enter the 7474 interface of the browser

Cypher language

Cypher is a descriptive Sql-like graph manipulation language. Equivalent to the Sql of a relational database, you can see its importance!

Its grammar is designed according to the characteristics of the graph, which is very convenient and flexible.

No Join, is a major feature!

Cypher is a declarative query language suitable for developers and point-to-point mode (ad-hoc) queries on databases.

Cypher is inspired to express queries through a series of different methods and practices based on certainty. Many keywords such as like and order by are inspired by SQL. The regular expression matching implementation mimics the Scala language.

Learning Cypher well is the key and core of learning Neo4j well.

Create syntax

Create (n:Person {id:'20140101',name:' Wang Wu', age:30,card:123456})

Equivalent to the relational Sql:

Create table Person (

Id varchar2

Name varchar2

Age number

Card number)

Insert into Person values ('20140101' Wang Wu', 30meme123456)

Neo4j field type

Match

Match query syntax

Match is equivalent to select.

MATCH (n:Person) RETURN n limit 25

Equivalent to:

Select * from Person limit 25

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

Database

Wechat

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

12
Report