Skip to content

PostGraphDB/AsterDB

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

asterdb-logo

maven-central nuget pypi npm go module codecov Javadoc License

AsterDB is a robust and versatile graph database that supports Gremlin query language facilitating various graph applications.

AsterDB provides two high-level features:

  • AsterDB utilizes a hybrid mechanism to handle edge insertions and deletions with optimized I/O efficiency..
  • AsterDB exploits the skewness of graph data to encode the key-value entries concisely and effectivel.

Installation

Build AsterDB from Scratch

Install Dependencies

export USER_HOME_PATH=/path/to/user/directory

# install g++-10, make, libboost-all-dev
sudo apt-get update
sudo apt-get install g++-10 make libboost-all-dev -y
ln -s /usr/bin/g++-10 /usr/bin/g++

# install openjdk-11
sudo apt-get install openjdk-11-jdk
export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

# install maven
mkdir /usr/local/maven/
mkdir $USER_HOME_PATH/.m2/ && mkdir $USER_HOME_PATH/.m2/repository
wget https://dlcdn.apache.org/maven/maven-3/3.9.9/binaries/apache-maven-3.9.9-bin.tar.gz
tar -xvzf apache-maven-3.9.9-bin.tar.gz -C /usr/local/maven

Build AsterDB from Source

Clone this repo:

cd $USER_HOME_PATH
git clone --recurse-submodules https://github.com/NTU-Database-Group/AsterDB.git

Build LSM-Tree based graph storage engine for AsterDB:

cd $USER_HOME_PATH/AsterDB/GraphKV
sudo make -j8 install-static DEBUG_LEVEL=0 DISABLE_WARNING_AS_ERROR=1 EXTRA_CXXFLAGS=-fPIC JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
sudo make -j8 install-shared DEBUG_LEVEL=0 DISABLE_WARNING_AS_ERROR=1 EXTRA_CXXFLAGS=-fPIC JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
sudo make -j8 rocksdbjava DEBUG_LEVEL=0 DISABLE_WARNING_AS_ERROR=1 EXTRA_CXXFLAGS=-fPIC JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

build-graphkv

Build gremlin console for AsterDB:

cd $USER_HOME_PATH/AsterDB/
mvn install:install-file \
    -Dfile=GraphKV/java/target/rocksdbjni-8.9.0-linux64.jar \
    -DgroupId=org.rocksdb \
    -DartifactId=rocksdbjni \
    -Dversion=8.9.0 \
    -Dpackaging=jar \
    -DlocalRepositoryPath=/root/.m2/repository
mvn clean install -pl tinkergraph-gremlin,gremlin-console -Dmaven.test.skip=true

build-asterdb

Docker Image

Use Pre-built assets

TODO: upload pre-build image to docker hub

Build the Image Yourself

Clone this repo:

cd $USER_HOME_PATH
git clone --recurse-submodules https://github.com/NTU-Database-Group/AsterDB.git

Build docker image:

docker build -t asterdb:v1.0 .

Getting Started

Load Graph Dataset into AsterDB

Prepare your dataset for testing, e.g.

# cur dir: $USER_HOME_PATH
mkdir datasets && cd datasets
wget https://snap.stanford.edu/data/bigdata/communities/com-orkut.ungraph.txt.gz
gzip -d com-orkut.ungraph.txt.gz
# delete graph info lines if necessary
sed '1,4d' com-orkut.ungraph.txt > temp_file && mv temp_file com-orkut.ungraph.txt

tips: For each row in graph dataset file, the format should be: <source_id> <dest_id>

Load dataset into AsterDB instance:

# cur dir: $USER_HOME_PATH/AsterDB/
g++ ./GraphKV/tools/bulkload.cc -O3 -std=c++17 -lrocksdb -lgflags -o ./bin/bulkload
export WRITE_SST_PATH=/udf/sst/file/path
./bin/bulkload -dataset=../datasets/com-dblp.ungraph.txt -is_undirected=true -write_sst_path=$WRITE_SST_PATH

build-asterdb

A Toy Example to Try AsterDB

Try AsterDB with gremlin console in a interactive way:

bin/gremlin.sh

         \,,,/
         (o o)
-----oOOo-(3)-oOOo-----
plugin activated: tinkerpop.server
plugin activated: tinkerpop.utilities
plugin activated: tinkerpop.tinkergraph
gremlin> conf = new BaseConfiguration();
==>org.apache.commons.configuration2.BaseConfiguration@52454457
gremlin> conf.setProperty("updatePolicy", 2); # adaptive
==>null
gremlin> graph = TinkerGraph.open(conf);
using update policy: 2
==>tinkergraph[vertices:12290508 edges:937480664]
gremlin> g = graph.traversal();
==>graphtraversalsource[tinkergraph[vertices:12290508 edges:937480664], standard]
gremlin> g.V().id().fold().next();
...

You can also implement your own graph algorithm with groovy scripts, here is an example:

# cur dir: $USER_HOME_PATH/AsterDB/
./bin/gremlin.sh -e ./scripts/bfs.groovy

build-asterdb

Deploy AsterDB in Docker Container

mount directory /tmp/demo/ (db path) for data persistence:

docker run -it --name asterdb_container -v /tmp/demo:/tmp/demo asterdb:v1.0

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 66.7%
  • C# 11.0%
  • Go 5.8%
  • Gherkin 5.2%
  • Python 4.4%
  • JavaScript 2.8%
  • Other 4.1%
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy