{"id":13411895,"url":"https://github.com/krotik/eliasdb","last_synced_at":"2025-04-12T19:46:01.525Z","repository":{"id":37732920,"uuid":"65619619","full_name":"krotik/eliasdb","owner":"krotik","description":"EliasDB a graph-based database.","archived":false,"fork":false,"pushed_at":"2022-08-14T09:04:27.000Z","size":37621,"stargazers_count":1012,"open_issues_count":13,"forks_count":50,"subscribers_count":27,"default_branch":"master","last_synced_at":"2025-04-03T22:11:11.259Z","etag":null,"topics":["cluster","clustering","database","embedded","golang","graph","graph-database","graphql","graphql-server","query-language","rest-api","standalone","supports-transactions","swagger","tutorial"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/krotik.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-13T13:53:28.000Z","updated_at":"2025-04-03T12:42:58.000Z","dependencies_parsed_at":"2022-09-03T02:10:24.724Z","dependency_job_id":null,"html_url":"https://github.com/krotik/eliasdb","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krotik%2Feliasdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krotik%2Feliasdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krotik%2Feliasdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/krotik%2Feliasdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/krotik","download_url":"https://codeload.github.com/krotik/eliasdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625491,"owners_count":21135513,"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":["cluster","clustering","database","embedded","golang","graph","graph-database","graphql","graphql-server","query-language","rest-api","standalone","supports-transactions","swagger","tutorial"],"created_at":"2024-07-30T20:01:18.175Z","updated_at":"2025-04-12T19:46:01.503Z","avatar_url":"https://github.com/krotik.png","language":"Go","funding_links":[],"categories":["Database","Databases","Go","数据库","Graph Data Model","tutorial","Data Integration Frameworks","\u003cspan id=\"数据库-database\"\u003e数据库 Database\u003c/span\u003e","Uncategorized","數據庫","数据库  `go语言实现的数据库`","Generators"],"sub_categories":["Databases Implemented in Go","Graph Databases","Go中实现的数据库","Advanced Console UIs","标准 CLI","\u003cspan id=\"高级控制台用户界面-advanced-console-uis\"\u003e高级控制台用户界面 Advanced Console UIs\u003c/span\u003e","高级控制台界面","高級控制台界面"],"readme":"EliasDB\n=======\n\n\u003cp align=\"center\"\u003e\n  \u003cimg height=\"300px\" style=\"height:300px;\" src=\"eliasdb_logo.png\"\u003e\n\u003c/p\u003e\n\nEliasDB is a graph-based database which aims to provide a lightweight solution for projects which want to store their data as a graph.\n\n[![Code coverage](https://void.devt.de/pub/eliasdb/test_result.svg)](https://void.devt.de/pub/eliasdb/coverage.txt)\n[![Go Report Card](https://goreportcard.com/badge/devt.de/krotik/eliasdb?style=flat-square)](https://goreportcard.com/report/devt.de/krotik/eliasdb)\n[![Go Reference](https://pkg.go.dev/badge/krotik/eliasdb.svg)](https://pkg.go.dev/devt.de/krotik/eliasdb)\n[![Mentioned in Awesome Go](https://awesome.re/mentioned-badge-flat.svg)](https://github.com/avelino/awesome-go)\n\nFeatures\n--------\n- Build on top of a custom key-value store which supports transactions and memory-only storage.\n- Data is stored in nodes (key-value objects) which are connected via edges.\n- Stored graphs can be separated via partitions.\n- Stored graphs support cascading deletions - delete one node and all its \"children\".\n- All stored data is indexed and can be quickly searched via a full text phrase search.\n- EliasDB has a GraphQL interface which can be used to store and retrieve data.\n- For more complex queries EliasDB has an own query language called EQL with an sql-like syntax.\n- Includes a scripting interpreter to define alternative actions for database operations or writing backend logic.\n- Written in Go from scratch. Only uses gorilla/websocket to support websockets for GraphQL subscriptions.\n- The database can be embedded or used as a standalone application.\n- When used as a standalone application it comes with an internal HTTPS webserver which provides user management, a REST API and a basic file server.\n- When used as an embedded database it supports transactions with rollbacks, iteration of data and rule based consistency management.\n\nGetting Started (standalone application)\n----------------------------------------\nYou can download a pre-compiled package for Windows (win64) or Linux (amd64) [here](https://void.devt.de/pub/eliasdb).\n\nExtract it and execute the executable with:\n```\neliasdb server\n```\nThe executable should automatically create 3 subfolders and a configuration file. It should start an HTTPS server on port 9090. To see a terminal point your webbrowser to:\n```\nhttps://localhost:9090/db/term.html\n```\nAfter accepting the self-signed certificate from the server you should see a web terminal. EliasDB can be stopped with a simple CTRL+C or by overwriting the content in eliasdb.lck with a single character.\n\nGetting Started (docker image)\n------------------------------\nYou can pull the latest docker image of EliasDB from [Dockerhub](https://hub.docker.com/r/krotik/eliasdb):\n```\ndocker pull krotik/eliasdb\n```\n\nCreate an empty directory, change into it and run the following to start the server:\n```\ndocker run --user $(id -u):$(id -g) -v $PWD:/data -p 9090:9090 krotik/eliasdb server\n```\nThis exposes port 9090 from the container on the local machine. All runtime related files are written to the current directory as the current user/group.\n\nConnect to the running server with a console by running:\n```\ndocker run --rm --network=\"host\" -it -v $PWD:/data --user $(id -u):$(id -g) -v $PWD:/data krotik/eliasdb console\n```\n\n### Tutorial:\n\nTo get an idea of what EliasDB is about have a look at the [tutorial](examples/tutorial/doc/tutorial.md). This tutorial will cover the basics of EQL and show how data is organized.\n\nThere is a separate [tutorial](examples/tutorial/doc/tutorial_graphql.md) on using ELiasDB with GraphQL.\n\n### REST API:\n\nThe terminal uses a REST API to communicate with the backend. The REST API can be browsed using a dynamically generated swagger.json definition (https://localhost:9090/db/swagger.json). You can browse the API of EliasDB's latest version [here](http://petstore.swagger.io/?url=https://devt.de/krotik/eliasdb/raw/master/swagger.json).\n\n### Scripting\n\nEliasDB supports a scripting language called [ECAL](ecal.md) to define alternative actions for database operations such as store, update or delete. The actions can be taken before, instead (by calling `db.raiseGraphEventHandled()`) or after the normal database operation. The language is powerful enough to write backend logic for applications.\n\nThere is a [VSCode integration](https://devt.de/krotik/ecal/src/master/ecal-support/README.md) available which supports syntax highlighting and debugging via the debug server. More information can be found in the [code repository](https://devt.de/krotik/ecal) of the interpreter.\n\n### Clustering:\n\nEliasDB supports to be run in a cluster by joining multiple instances of EliasDB together. You can read more about it [here](cluster.md).\n\n### Command line options\nThe main EliasDB executable has two main tools:\n```\nUsage of ./eliasdb \u003ctool\u003e\n\nEliasDB graph based database\n\nAvailable commands:\n\n    console   EliasDB server console\n    server    Start EliasDB server\n```\nThe most important one is server which starts the database server. The server has several options:\n```\nUsage of ./eliasdb server [options]\n\n  -export string\n    \tExport the current database to a zip file\n  -help\n    \tShow this help message\n  -import string\n    \tImport a database from a zip file\n  -no-serv\n    \tDo not start the server after initialization\n```\nIf the `EnableECALScripts` configuration option is set the following additional option is available:\n```\n-ecal-console\n    Start an interactive interpreter console for ECAL\n```\nThe interactive console can be used to inspect and modify the runtime state of the ECAL interpreter.\n\nOnce the server is started the console tool can be used to interact with the server. The options of the console tool are:\n```\nUsage of ./eliasdb console [options]\n\n  -exec string\n    \tExecute a single line and exit\n  -file string\n    \tRead commands from a file and exit\n  -help\n    \tShow this help message\n  -host string\n    \tHost of the EliasDB server (default \"localhost\")\n  -port string\n    \tPort of the EliasDB server (default \"9090\")\n```\nOn the console type 'q' to exit and 'help' to get an overview of available commands:\n```\nCommand Description\nexport  Exports the last output.\nfind    Do a full-text search of the database.\nhelp    Display descriptions for all available commands.\ninfo    Returns general database information.\npart    Displays or sets the current partition.\nver     Displays server version information.\n```\nIt is also possible to directly run EQL and GraphQL queries on the console. Use the arrow keys to cycle through the command history.\n\n### Configuration\nEliasDB uses a single configuration file called eliasdb.config.json. After starting EliasDB for the first time it should create a default configuration file. Available configurations are:\n\n| Configuration Option | Description |\n| --- | --- |\n| ClusterConfigFile | Cluster configuration file. |\n| ClusterLogHistory | File which is used to store the console history. |\n| ClusterStateInfoFile | File which is used to store the cluster state. |\n| CookieMaxAgeSeconds | Lifetime for cookies used by EliasDB. |\n| ECALDebugServerHost | Hostname the ECAL debug server should listen to. |\n| ECALDebugServerPort | Port on which the debug server should listen on. |\n| ECALEntryScript | Entry script for ECAL interpreter. |\n| ECALLogFile | Logfile for ECAL interpreter. An empty string will cause the logger to write to the console. |\n| ECALLogLevel | Log level for ECAL interpreter. Can be debug, info or error. |\n| ECALScriptFolder | Directory for ECAL scripts. |\n| ECALWorkerCount | Number of worker threads in the ECA engine's thread pool. |\n| EnableAccessControl | Flag if access control for EliasDB should be enabled. This provides user authentication and authorization features. |\n| EnableCluster | Flag if EliasDB clustering support should be enabled. EXPERIMENTAL! |\n| EnableClusterTerminal | Flag if the cluster terminal file /web/db/cluster.html should be created. |\n| EnableECALDebugServer | Flag if the ECAL debug server should be started. Note: This will slow ECAL performance significantly. |\n| EnableECALScripts | Flag if ECAL scripts should be executed on startup. |\n| EnableReadOnly | Flag if the datastore should be open read-only. |\n| EnableWebFolder | Flag if the files in the webfolder /web should be served up by the webserver. If false only the REST API is accessible. |\n| EnableWebTerminal | Flag if the web terminal file /web/db/term.html should be created. |\n| HTTPSCertificate | Name of the webserver certificate which should be used. A new one is created if it does not exist. |\n| HTTPSHost | Hostname the webserver should listen to. This host is also used in the dynamically generated swagger definition. |\n| HTTPSKey | Name of the webserver private key which should be used. A new one is created if it does not exist. |\n| HTTPSPort | Port on which the webserver should listen on. |\n| LocationAccessDB | File which is used to store access control information. This file can be edited while the server is running and changes will be picked up immediately. |\n| LocationDatastore | Directory for datastore files. |\n| LocationHTTPS | Directory for the webserver's SSL related files. |\n| LocationUserDB | File which is used to store (hashed) user passwords. |\n| LocationWebFolder | Directory of the webserver's webfolder. |\n| LockFile | Lockfile for the webserver which will be watched duing runtime. Replacing the content of this file with a single character will shutdown the webserver gracefully. |\n| MemoryOnlyStorage | Flag if the datastore should only be kept in memory. |\n| ResultCacheMaxAgeSeconds | EQL queries create result sets which are cached. The value describes the amount of time in seconds a result is kept in the cache. |\n| ResultCacheMaxSize | EQL queries create result sets which are cached. The value describes the number of results which can be kept in the cache. |\n\nNote: It is not (and will never be) possible to access the REST API via HTTP.\n\nEnabling Access Control\n-----------------------\nIt is possible to enforce access control by enabling the `EnableAccessControl` configuration option. When started with enabled access control EliasDB will only allow known users to connect. Users must authenticate with a password before connecting to the web interface or the REST API. On the first start with the flag enabled the following users are created by default:\n\n|Username|Default Password|Groups|Description|\n|---|---|---|---|\n|elias|elias|admin/public|Default Admin|\n|johndoe|doe|public|Default unprivileged user|\n\nUsers can be managed from the console. Please do either delete the default users or change their password after starting EliasDB.\n\nUsers are organized in groups and permissions are assigned to groups. Permissions are given to endpoints of the REST API. The following permissions are available:\n\n|Type|Allowed HTTP Request Type|Description|\n|---|---|---|\n|Create|Post|Creating new data|\n|Read|Get|Read data|\n|Update|Put|Modify existing data|\n|Delete|Delete|Delete data|\n\nThe default group permissions are:\n\n|Group|Path|Permissions|\n|---|---|---|\n|admin|/db/*|`CRUD`|\n|public|/|`-R--`|\n||/css/*|`-R--`|\n||/db/*|`-R--`|\n||/img/*|`-R--`|\n||/js/*|`-R--`|\n||/vendor/*|`-R--`|\n\n\nBuilding EliasDB\n----------------\nTo build EliasDB from source you need to have Go installed (go \u003e= 1.12):\n\n- Create a directory, change into it and run:\n```\ngit clone https://github.com/krotik/eliasdb/ .\n```\n\n- You can build EliasDB's executable with:\n```\ngo build cli/eliasdb.go\n```\n\nBuilding EliasDB as Docker image\n--------------------------------\nEliasDB can be build as a secure and compact Docker image.\n\n- Create a directory, change into it and run:\n```\ngit clone https://github.com/krotik/eliasdb/ .\n```\n\n- You can now build the Docker image with:\n```\ndocker build --tag krotik/eliasdb .\n```\n\nExample Applications\n--------------------\n- [Chat](examples/chat/doc/chat.md) - A simple chat application showing node modification via ECAL script, user management and subscriptions.\n- [Data-mining](examples/data-mining/doc/data-mining.md) - A more complex application which uses the cluster feature of EliasDB and GraphQL for data queries.\n- [Game](examples/game/doc/game.md) - A multiplayer game example using ECAL for simulating the game scene in the backend.\n\nFurther Reading\n---------------\n- A design document which describes the different components of the graph database. [Link](eliasdb_design.md)\n- A reference for EliasDB's custom query language EQL. [Link](eql.md)\n- A reference for EliasDB's support for GraphQL. [Link](graphql.md)\n- A quick overview of what you can do when you embed EliasDB in your own Go project. [Link](embedding.md)\n\nLicense\n-------\nEliasDB source code is available under the [Mozilla Public License](/LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrotik%2Feliasdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkrotik%2Feliasdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkrotik%2Feliasdb/lists"}