{"id":20683908,"url":"https://github.com/tudb-labs/tudb","last_synced_at":"2025-04-22T12:31:22.717Z","repository":{"id":61952918,"uuid":"502833459","full_name":"TUDB-Labs/TuDB","owner":"TUDB-Labs","description":"A distributed graph database system (GDBMS)","archived":false,"fork":false,"pushed_at":"2023-02-20T03:27:19.000Z","size":4032,"stargazers_count":11,"open_issues_count":54,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T15:11:27.299Z","etag":null,"topics":["database","distributed-database","distributed-systems","graph-database"],"latest_commit_sha":null,"homepage":"https://tudb-labs.github.io/TuDB/","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TUDB-Labs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-13T06:32:58.000Z","updated_at":"2025-03-03T14:27:05.000Z","dependencies_parsed_at":"2023-02-10T00:46:06.223Z","dependency_job_id":null,"html_url":"https://github.com/TUDB-Labs/TuDB","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUDB-Labs%2FTuDB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUDB-Labs%2FTuDB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUDB-Labs%2FTuDB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TUDB-Labs%2FTuDB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TUDB-Labs","download_url":"https://codeload.github.com/TUDB-Labs/TuDB/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250240859,"owners_count":21397880,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","distributed-database","distributed-systems","graph-database"],"created_at":"2024-11-16T22:18:22.260Z","updated_at":"2025-04-22T12:31:22.632Z","avatar_url":"https://github.com/TUDB-Labs.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![CI](https://github.com/TUDB-Labs/TuDB/workflows/CI/badge.svg)](https://github.com/TUDB-Labs/TuDB/actions?query=event%3Apush+branch%3Amain)\n\n# TuDB \n\n## What is TuDB?\n\nTuDB is a cloud native graph database. TuDB aims to support Hybrid Transactional and Analytical Processing (HTAP)\nworkloads. It is compatible with Cypher and features horizontal scalability, strong consistency, and high availability.\nTuDB aims to provide a unified graph process interface for constructing and managing graphs on different key-value\nstorage engines, such as RocksDB, HBase, and TiKV.\n\n## Quick Start\n\n### Installation\n\nYou can install TuDB by following these steps:\n\n1. Download or clone the repo locally.\n2. [Install Maven](https://maven.apache.org/install.html).\n3. Run the following to build TuDB binary:\n\n```bash\nmvn clean compile install\n```\n\n### Examples\n\nBelow is an example to start the server and client locally and interact with the database\nvia Cypher queries. For more examples, please check out the [examples folder](examples).\n\n```scala\nimport org.apache.commons.io.FileUtils\nimport org.grapheco.lynx.types.structural.{LynxNode, LynxRelationship}\nimport org.grapheco.tudb.{TuDBServer, TuDBServerContext}\nimport org.grapheco.tudb.client.TuDBClient\nimport org.grapheco.tudb.test.TestUtils\nimport java.io.File\n\nobject CypherExample {\n  val port = 7600\n  var server: TuDBServer = _\n  var client: TuDBClient = _\n  def main(args: Array[String]): Unit = {\n    val dbPath: String = s\"${TestUtils.getModuleRootPath}/testSpace/testBase\"\n    server = startServer(dbPath, port)\n    startClient()\n\n    createNode()\n    queryNode()\n    createRelation()\n    queryRelation()\n\n    stopClient()\n    shutdownServer()\n  }\n  \n  def startServer(\n      dbPath: String,\n      port: Int,\n      indexUrl: String = \"tudb://index?type=dummy\"\n    ): TuDBServer = {\n    FileUtils.deleteDirectory(new File(dbPath))\n    val serverContext = new TuDBServerContext()\n    serverContext.setPort(port)\n    serverContext.setDataPath(dbPath)\n    serverContext.setIndexUri(indexUrl)\n    val server = new TuDBServer(serverContext)\n    new Thread(new Runnable {\n      override def run(): Unit = server.start()\n    }).start()\n    server\n  }\n  def shutdownServer() = server.shutdown()\n\n  def startClient(): Unit = {\n    client = new TuDBClient(\"127.0.0.1\", port)\n  }\n  def stopClient() = client.shutdown()\n\n  def createNode(): Unit = {\n    client.query(\"create (n:DataBase{name:'TuDB'})\")\n    client.query(\"create (n: Company{name:'TUDB'})\")\n  }\n  def queryNode(): Unit = {\n    val res = client.query(\"match (n) return n\")\n    println()\n    println(\"Query Node result: \", res)\n    println()\n  }\n\n  def createRelation(): Unit = {\n    client.query(\"\"\"\n        |match (n:DataBase{name:'TuDB'})\n        |match (c: Company{name:'TUDB'})\n        |create (n)-[r: belongTo{year: 2022}]-\u003e(c)\n        |\"\"\".stripMargin)\n  }\n  def queryRelation(): Unit = {\n    val res = client.query(\"match (n)-[r: belongTo]-\u003e(m) return n,r,m\")\n    println()\n    println(\"Query Relation Result: \", res)\n  }\n}\n```\n\n\n## Development\n\nYou can run all the tests via the following:\n\n```bash\nmvn clean install test\n```\n\nYou can start a database instance locally via `./bin/start`\nor start an interactive shell via `./bin/cypher`.\n\nFor more details on how to contribute, please check out our [contributing guide](docs/CONTRIBUTING.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftudb-labs%2Ftudb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftudb-labs%2Ftudb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftudb-labs%2Ftudb/lists"}