❶ 關於圖資料庫neo4j的關系建立
Neo4J的安裝使用非常簡單。下載一個穩定版本,解壓,運行Neo4j.bat(windows版本) 即可。下載地址http://www.neo4j.org/download , 目前比較好用的穩定版本是1.9.1。
然後可以訪問WEB管理界面,地址:http://localhost:7474/webadmin
Neo4J的使用方式包括:
1)可以寫程序,添加,更新,用JAVA,Python,PHP, .NET等語言都可以實現。
2)可以用命令行,添加,更新,查看,Neo4J提供基於WEB的執行界面,提供類sql語言執行,這些語言包括Cypher,Gremlin等。
如下圖:
3)可以基於Neo4J提供的WEB UI界面添加,更新節點和關系,如下:
4) 可以使用附加工具(ETL)導入數據。也可以從關系資料庫中導入數據。
❷ 圖計算引擎Neo4j和Graphscope有什麼區別
Neo4j是單機系統,主要做圖資料庫。GraphScope是由阿里巴巴達摩院智能計算實驗室研發的圖計算平台,是全球首個一站式超大規模分布式圖計算平台,並且還入選了中 國科學技術協會「科創中 國」平台。Graphscope的代碼在github.com/alibaba/graphscope上開源。SSSP演算法上,GraphScope單機模式下平均要比Neo4j快176.38倍,最快在datagen-9.2_zf數據集上快了292.2倍。
❸ 想問一下圖資料庫neo4j和spark下面的graphx有什麼區別
Neo4j就是一個資料庫(可以理解成一個類似HBASE的東西,不過Neo4j是幾乎是單機資料庫,於HBASE不同,HBASE的數據時存儲在
HDFS上,由HDFS進行維護,HDFS將數據存儲在exfat等單機文件系統上。Neo4j直接將數據格式化到單機文件系統)
每一個伺服器保存完整的圖數據。
GraphX是一個計算引擎(類似於maprece的東西),它的數據是從SHARK中使用SQL讀取數據,或者RDD運算符從文件中讀取,然後直接進行計算
另外資料庫和計算引擎都可以進行計算任務,不過資料庫的介面比較弱,只支持簡單的查詢
計算引擎提供了強大的計算介面,方便了編程,可以很容易的實現pagerank等圖演算法
GraphX做數據挖掘應該更方便,有通用的編程幾口
Neo4j就需要自己寫代碼了 編程比較麻煩,不過性能上或許有優勢
❹ 有哪些輕型的非關系型資料庫
常見的非關系型資料庫有:1、mongodb;2、cassandra;3、redis;4、hbase;5、neo4j。其中mongodb是非常著名的NoSQL資料庫,它是一個面向文檔的開源資料庫。
常見的幾種非關系型資料庫:
1、MongoDB
MongoDB是最著名的NoSQL資料庫。它是一個面向文檔的開源資料庫。MongoDB是一個可伸縮和可訪問的資料庫。它在c++中。MongoDB同樣可以用作文件系統。在MongoDB中,JavaScript可以作為查詢語言使用。通過使用sharding MongoDB水平伸縮。它在流行的JavaScript框架中非常有用。
人們真的很享受分片、高級文本搜索、gridFS和map-rece功能。驚人的性能和新特性使這個NoSQL資料庫在我們的列表中名列第一。
特點:提供高性能;自動分片;運行在多個伺服器上;支持主從復制;數據以JSON樣式文檔的形式存儲;索引文檔中的任何欄位;由於數據被放置在碎片中,所以它具有自動負載平衡配置;支持正則表達式搜索;在失敗的情況下易於管理。
優點:易於安裝MongoDB;MongoDB Inc.為客戶提供專業支持;支持臨時查詢;高速資料庫;無模式資料庫;橫向擴展資料庫;性能非常高。
缺點:不支持連接;數據量大;嵌套文檔是有限的;增加不必要的內存使用。
2、Cassandra
Cassandra是Facebook為收件箱搜索開發的。Cassandra是一個用於處理大量結構化數據的分布式數據存儲系統。通常,這些數據分布在許多普通伺服器上。您還可以添加數據存儲容量,使您的服務保持在線,您可以輕松地完成這項任務。由於集群中的所有節點都是相同的,因此不需要處理復雜的配置。
Cassandra是用Java編寫的。Cassandra查詢語言(CQL)是查詢Cassandra資料庫的一種類似sql的語言。因此,Cassandra在最佳開源資料庫中排名第二。Facebook、Twitter、思科(Cisco)、Rackspace、eBay、Twitter、Netflix等一些最大的公司都在使用Cassandra。
特點:線性可伸縮;;保持快速響應時間;支持原子性、一致性、隔離性和耐久性(ACID)等屬性;使用Apache Hadoop支持MapRece;分配數據的最大靈活性;高度可伸縮;點對點架構。
優點:高度可伸縮;無單點故障;Multi-DC復制;與其他基於JVM的應用程序緊密集成;更適合多數據中心部署、冗餘、故障轉移和災難恢復。
缺點:對聚合的有限支持;不可預知的性能;不支持特別查詢。
3、Redis
Redis是一個鍵值存儲。此外,它是最著名的鍵值存儲。Redis支持一些c++、PHP、Ruby、Python、Perl、Scala等等。Redis是用C語言編寫的。此外,它是根據BSD授權的。
特點:自動故障轉移;將其資料庫完全保存在內存中;事務;Lua腳本;將數據復制到任意數量的從屬伺服器;鑰匙的壽命有限;LRU驅逐鑰匙;支持發布/訂閱。
優點:支持多種數據類型;很容易安裝;非常快(每秒執行約11萬組,每秒執行約81000次);操作都是原子的;多用途工具(在許多用例中使用)。
缺點:不支持連接;存儲過程所需的Lua知識;數據集必須很好地適應內存。
4、HBase
HBase是一個分布式的、面向列的開源資料庫,該技術來源於 Fay Chang 所撰寫的Google論文「Bigtable:一個結構化數據的分布式存儲系統」。就像Bigtable利用了Google文件系統(File System)所提供的分布式數據存儲一樣,HBase在Hadoop之上提供了類似於Bigtable的能力。
HBase是Apache的Hadoop項目的子項目。HBase不同於一般的關系資料庫,它是一個適合於非結構化數據存儲的資料庫。另一個不同的是HBase基於列的而不是基於行的模式。
5、neo4j
Neo4j被稱為原生圖資料庫,因為它有效地實現了屬性圖模型,一直到存儲層。這意味著數據完全按照白板的方式存儲,資料庫使用指針導航和遍歷圖。Neo4j有資料庫的社區版和企業版。企業版包括Community Edition必須提供的所有功能,以及額外的企業需求,如備份、集群和故障轉移功能。
特點:它支持唯一的約束;Neo4j支持完整的ACID(原子性、一致性、隔離性和持久性)規則;Java API: Cypher API和本機Java API;使用Apache Lucence索引;簡單查詢語言Neo4j CQL;包含用於執行CQL命令的UI: Neo4j Data Browser。
優點:容易檢索其相鄰節點或關系細節,無需連接或索引;易於學習Neo4j CQL查詢語言命令;不需要復雜的連接來檢索數據;非常容易地表示半結構化數據;大型企業實時應用程序的高可用性;簡化的調優。
缺點:不支持分片
❺ 如何在java程序中引入neo4j資料庫
neo4j採納java語言開發,如果我們要在java程序中以內嵌方式應用neo4j,只需導入neo4j的對應包即可。
首先,我們來創建一個maven項目並改動pom.xml添加對neo4j的依附。
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 "> <modelVersion>4.0.0</modelVersion> <groupId>neo4j-learn</groupId> <artifactId>neo4j-learn</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j</artifactId> <version>1.9.4</version> </dependency> </dependencies> </project>
然後,我們在項目中創建一個neo4j.properties(資料庫的配置文件)文件和一個java類(調用資料庫)。
neo4j.properties
# Default values for the low-level graph engine #neostore.nodestore.db.mapped_memory=25M #neostore.relationshipstore.db.mapped_memory=50M #neostore.propertystore.db.mapped_memory=90M #neostore.propertystore.db.strings.mapped_memory=130M #neostore.propertystore.db.arrays.mapped_memory=130M # Autoindexing # Enable auto-indexing for nodes, default is false #node_auto_indexing=true # The node property keys to be auto-indexed, if enabled #node_keys_indexable=name,age # Enable auto-indexing for relationships, default is false #relationship_auto_indexing=true # The relationship property keys to be auto-indexed, if enabled #relationship_keys_indexable=name,age # Keep logical logs, needed for online backups to work keep_logical_logs=true # Enable online backups to be taken from this database. online_backup_enabled=true # Uncomment and specify these lines for running Neo4j in High Availability mode. # ha.server_id is a unique integer for each instance of the Neo4j database in the cluster. # (as opposed to the coordinator instance IDs) # example: ha.server_id=1 #ha.server_id= # ha.coordinators is a comma-separated list (without spaces) of the host:port of where to # find one or more of the Neo4j coordinator servers. # Avoid localhost e to IP resolution issues on some systems. # example: ha.coordinators=localhost:2181,1.2.3.4:4321 #ha.coordinators=localhost:2181 # You can also, optionally, configure the ha.cluster_name. This is the name of the cluster this # instance is supposed to join. Accepted characters are alphabetical, numerical, dot and dash. # This configuration is useful if you have multiple Neo4j HA clusters managed by the same # Coordinator cluster. # Example: ha.cluster_name = my.neo4j.ha.cluster #ha.cluster_name = # IP and port for this instance to bind to to communicate data with the # other neo4j instances in the cluster. This is broadcasted to the other # cluster members, so different members can have different communication ports. # Optional if the members are on different machines so the IP is different for every member. #ha.server = localhost:6001 # The interval at which slaves will pull updates from the master. Comment out # the option to disable periodic pulling of updates. Unit is seconds. ha.pull_interval = 10 # The session timeout for the zookeeper client. Lower values make new master # election happen closer to the master loosing connection but also more sensitive # to zookeeper quorum hiccups. If experiencing master switches without reason # consider increasing this value. Unit is seconds #ha.zk_session_timeout = 5 # Amount of slaves the master will try to push a transaction to upon commit (default is 1). # The master will optimistically continue and not fail the transaction even if it fails to # reach the push factor. Setting this to 0 will increase write performance when writing # through master but could potentially lead to branched data (or loss of transaction) # if the master goes down. #ha.tx_push_factor=1 # Strategy the master will use when pushing data to slaves (if the push factor is greater than 0). # There are two options available "fixed" (default) or "round_robin". Fixed will start by # pushing to slaves ordered by server id (highest first) improving performance since the # slaves only have to cache up one transaction at a time. #ha.tx_push_strategy=fixed # Enable this to be able to upgrade a store from 1.4 -> 1.5 or 1.4 -> 1.6 #allow_store_upgrade=true # Enable this to specify a parser other than the default one. 1.5, 1.6, 1.7 are available #cypher_parser_version=1.6
java文件(neo4j示例文件改動而來)