arangodb
- native multi-model database
- key-values
- documents (key-values whose values are JSON documents)
- graphs defined through vertexes (nodes) and edges (links)
- edges are oriented => arangodb manages oriented graph
- from A to B (A->B) : a->B is OUTBOUND while B->A is INBOUND (reverse direction)
- single query language
- N databases
- 1 database -> N collections
- 1 Collection -> N documents (2 collection types : either document or edge collections)
- 1 document = json object
- document = json object enriched with system attributes
- (
_key
,_id
,_rev
) for default documents - (
_key
,_id
,_rev
,_from
,_to
) for edge documents
- (
- document = json object enriched with system attributes
- 1 document = json object
- 1 Collection -> N documents (2 collection types : either document or edge collections)
- 1 database -> N collections
- vertex are just documents while edges are defined through dedicated collection types
which add
_from
and_to
dedicated attributes.- edges are also json documents so can comes with many information
- edges defines relations !
- kafka arango db connector is available
cd $HOME/arango-commons
curl -L https://www.arangodb.com/arangodb_graphcourse_demodata/ -o data.zip
unzip data.zip
docker exec -it arango arangoimport --file /commons/airports.csv --collection airports --create-collection true --type csv
docker exec -it arango arangoimport --file /commons/flights.csv --collection flights --create-collection true --type csv --create-collection-type edge
java driver java driver (official)
import $ivy.`com.arangodb:arangodb-java-driver:6.6.3`
After various experiments run perfectly, no fully friendly with scala, but it exists an external module which help scala integration. Well designed, quite easy to take benefits of scala features to enrich and simplify the API, also very simple to customize JSON processing with any high level scala JSON library ! :)
proteus scala driver
Some scala instructions using ammonite REPL :
import $ivy.`com.cornfluence::proteus:0.7.3`
Looks like queries are not supported :(
avokka scala driver
Some scala instructions using ammonite REPL :
import $ivy.`avokka::avokka-arangodb:0.0.3`
Very young :(
scarango scala driver
Some scala instructions using ammonite REPL :
import $ivy.`com.outr::scarango-driver:2.3.5`
import com.outr.arango._,query._,profig.Profig
import scala.concurrent.ExecutionContext.Implicits.global
object TestIt {
Profig.loadDefaults()
val db = new Graph(
databaseName = "example",
baseURL=io.youi.net.URL("http://127.0.0.1:8279"),
credentials=Some(Credentials("root@example", "password"))
)
println(db.databaseName)
println(db.collections.size)
println(db.collections.map(_.name))
println(db.query(aql"RETURN COUNT(sample)").as[Int].one)
def init:Unit
}
TestIt.init
HAS ISSUES at least when used from ammonite