Sign inSign up

daniknik/metagraph_db

By daniknik

•Updated 4 months ago

Image
Databases & storage
0

966

daniknik/metagraph_db repository overview

⁠Metagraph-DB

⁠Overview

Metagraph-DB is a distributed database designed for storing and querying metagraph data. It can be configured using a YAML configuration file and/or environment variables.

⁠Configuration

Caution

IN-MEMORY STORAGE IS UNIMPLEMENTED YET
⁠Configuration File

By default, the application looks for a configuration file named config.yaml. You can specify a different file path using the --config flag.

⁠Example config.yaml
node_storage:
  dirpath: "/path/to/node/storage"
  in_memory: false

edge_storage:
  dirpath: "/path/to/edge/storage"
  in_memory: true

attribute_storage:
  dirpath: "/path/to/attribute/storage"
  in_memory: false

fragment_storage:
  dirpath: "/path/to/fragment/storage"
  in_memory: true

metastore:
  dirpath: "/path/to/metastore"
  in_memory: false

system:
  machine_id: 1
  clear_on_start: false
  port: 8000

logging:
  level: "trace"
⁠Running the Application with a Config File
./main --config /path/to/config.yaml
⁠Environment Variables

Environment variables can be used to override values specified in the configuration file or to provide configuration when no file is used. The environment variable names should be prefixed with MDB and use underscores as delimiters.

⁠Example Environment Variables
export MDB_NODE_STORAGE_DIRPATH=/path/to/node/storage
export MDB_NODE_STORAGE_IN_MEMORY=false
export MDB_EDGE_STORAGE_DIRPATH=/path/to/edge/storage
export MDB_EDGE_STORAGE_IN_MEMORY=true
export MDB_ATTRIBUTE_STORAGE_DIRPATH=/path/to/attribute/storage
export MDB_ATTRIBUTE_STORAGE_IN_MEMORY=false
export MDB_FRAGMENT_STORAGE_DIRPATH=/path/to/fragment/storage
export MDB_FRAGMENT_STORAGE_IN_MEMORY=true
export MDB_METASTORE_DIRPATH=/path/to/metastore
export MDB_METASTORE_IN_MEMORY=false
export MDB_SYSTEM_MACHINE_ID=1
export MDB_SYSTEM_CLEAR_ON_START=false
export MDB_LOGGING_LEVEL=info
⁠Running the Application with Environment Variables
export MDB_NODE_STORAGE_DIRPATH=/path/to/node/storage
export MDB_EDGE_STORAGE_DIRPATH=/path/to/edge/storage
export MDB_ATTRIBUTE_STORAGE_DIRPATH=/path/to/attribute/storage
export MDB_FRAGMENT_STORAGE_DIRPATH=/path/to/fragment/storage
export MDB_METASTORE_DIRPATH=/path/to/metastore
export MDB_SYSTEM_MACHINE_ID=1
export MDB_SYSTEM_CLEAR_ON_START=false

./main
⁠Logging
  • Log Level: The application supports different log levels. Use the -v flag to enable verbose (debug) logging.
  • Log File: By default, logs are written to stderr. You can specify a file path using the -log flag.
⁠Default Configuration

If no configuration file or environment variables are provided, the application will use default values. However, it is recommended to provide a configuration to ensure the application behaves as expected.

⁠Example Full Configuration
⁠Using a Configuration File and Environment Variables
# Configuration File
node_storage:
  dirpath: "/path/to/node/storage"
  in_memory: false

edge_storage:
  dirpath: "/path/to/edge/storage"
  in_memory: true

attribute_storage:
  dirpath: "/path/to/attribute/storage"
  in_memory: false

fragment_storage:
  dirpath: "/path/to/fragment/storage"
  in_memory: true

metastore:
  dirpath: "/path/to/metastore"
  in_memory: false

system:
  machine_id: 1
  clear_on_start: false

# Environment Variables
export MDB_SYSTEM_MACHINE_ID=2
export MDB_SYSTEM_CLEAR_ON_START=true

./main --config /path/to/config.yaml

In this example, the system.machine_id and system.clear_on_start values from the configuration file will be overridden by the environment variables.

Tag summary

Content type

Image

Digest

sha256:5dcc9e6d8…

Size

150.5 MB

Last updated

8 months ago

docker pull daniknik/metagraph_db