{"id":16876436,"url":"https://github.com/raphaelsc/ragedb","last_synced_at":"2025-03-19T04:43:29.717Z","repository":{"id":150403658,"uuid":"390749962","full_name":"raphaelsc/ragedb","owner":"raphaelsc","description":"In Memory Property Graph Server using the Shared Nothing design from Seastar.","archived":false,"fork":false,"pushed_at":"2021-07-29T14:26:51.000Z","size":498,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-25T03:44:35.686Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":false,"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/raphaelsc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-07-29T14:24:57.000Z","updated_at":"2021-07-29T14:24:57.000Z","dependencies_parsed_at":"2023-04-27T11:02:43.951Z","dependency_job_id":null,"html_url":"https://github.com/raphaelsc/ragedb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsc%2Fragedb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsc%2Fragedb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsc%2Fragedb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/raphaelsc%2Fragedb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/raphaelsc","download_url":"https://codeload.github.com/raphaelsc/ragedb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244358337,"owners_count":20440355,"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":[],"created_at":"2024-10-13T15:39:25.411Z","updated_at":"2025-03-19T04:43:29.699Z","avatar_url":"https://github.com/raphaelsc.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# RageDB\n\nIn Memory Property Graph Server using the Shared Nothing design from Seastar.\n\nThe RageDB server can host multiple Graphs. The graphs are accessible via a REST API (see below).\nEach Graph is split into multiple Shards. One Shard per Core of the server.\nShards communicate by explicit message passing. Nodes and Relationships have internal and external ids.\nThe external ids embed the type as well as which Shard they belong to.\nThe internal ids are pointers into vectors that hold the data of each Node and Relationship.\nThe Relationship ids are replicated to both incoming and outgoing Nodes.\nThe Relationship Object (and properties) belong to the Outgoing Node (and shard).\nEach Node must have a singular Type and unique Key on creation which the server stores in a map for retrieval.\nExternal and Internal Ids are assigned upon creation for both Nodes and Relationships.\n\nAlong side an HTTP API, RageDB also has a Lua http endpoint that allows users to send complex queries.\nThese queries are interpreted by LuaJIT, compiled and executed within a Seastar Thread that allows blocking.\nBy not having a \"query language\" we avoid parsing, query planning, query execution and a host of [problems](https://maxdemarzi.com/2020/05/25/declarative-query-languages-are-the-iraq-war-of-computer-science/).\n\n## HTTP API\n\n### Schema\n\n#### Get Node Types\n\n    :GET /db/{graph}/schema/nodes\n\n#### Get a Node Type\n\n    :GET /db/{graph}/schema/nodes/{type}\n\n#### Create a Node Type\n\n    :POST /db/{graph}/schema/nodes/{type}\n\n#### Delete a Node Type\n\n    :POST /db/{graph}/schema/nodes/{type}\n\n#### Get Relationship Types\n\n    :GET /db/{graph}/schema/relationships\n\n#### Get a Relationship Type\n\n    :GET /db/{graph}/schema/relationships/{type}\n\n#### Create a Relationship Type\n\n    :POST /db/{graph}/schema/relationships/{type}\n\n#### Delete a Relationship Type\n\n    :DELETE /db/{graph}/schema/relationships/{type}\n\nRageDB currently supports booleans, 64-bit integers, 64-bit doubles, strings and lists of the preceding data types:\n\n    boolean, integer, double, string, boolean_list, integer_list, double_list, string_list\n\n#### Get a Node Property Type\n\n    :GET /db/{graph}/schema/nodes/{type}/properties/{property}\n\n#### Create a Node Property Type\n\n    :POST /db/{graph}/schema/nodes/{type}/properties/{property}/{data_type}\n\n#### Delete a Node Property Type\n\n    :DELETE /db/{graph}/schema/nodes/{type}/properties/{property}\n\n#### Get a Relationship Property Type\n\n    :GET /db/{graph}/schema/relationships/{type}/properties/{property}\n\n#### Create a Relationship Property Type\n\n    :POST /db/{graph}/schema/relationships/{type}/properties/{property}/{data_type}\n\n#### Delete a Relationship Property Type\n\n    :DELETE /db/{graph}/schema/relationships/{type}/properties/{property}\n\n### Nodes\n\n#### Get All Nodes\n\n    :GET /db/{graph}/nodes?limit=100\u0026offset=0\n\n#### Get All Nodes of a Type\n\n    :GET /db/{graph}/nodes/{type}?limit=100\u0026offset=0\n\n#### Get A Node By Type and Key\n\n    :GET /db/{graph}/node/{type}/{key}\n\n#### Get A Node By Id\n\n    :GET /db/{graph}/node/{id}\n\n#### Create A Node\n\n    :POST /db/{graph}/node/{type}/{key}\n    JSON formatted Body: {properties}\n\n#### Delete A Node By Type and Key\n\n    :DELETE /db/{graph}/node/{type}/{key}\n\n#### Delete A Node By Id\n\n    :DELETE /db/{graph}/node/{id}\n\n### Node Properties\n\n#### Get the Properties of a Node By Type and Key\n\n    :GET /db/{graph}/node/{type}/{key}/properties\n\n#### Get the Properties of a Node By Id\n\n    :GET /db/{graph}/node/{id}/properties\n\n#### Reset the Properties of a Node By Type and Key\n\n    :POST /db/{graph}/node/{type}/{key}/properties\n    JSON formatted Body: {properties}\n\n#### Reset the Properties of a Node By Id\n\n    :POST /db/{graph}/node/{id}/properties\n    JSON formatted Body: {properties}\n\n#### Set some Properties of a Node By Type and Key\n\n    :PUT /db/{graph}/node/{type}/{key}/properties\n    JSON formatted Body: {properties}\n\n#### Set some Properties of a Node By Id\n\n    :PUT /db/{graph}/node/{id}/properties\n    JSON formatted Body: {properties}\n\n#### Delete the Properties of a Node By Type and Key\n\n    :DELETE /db/{graph}/node/{type}/{key}/properties\n\n#### Delete the Properties of a Node By Id\n\n    :DELETE /db/{graph}/node/{id}/properties\n\n#### Get a Property of a Node By Type and Key\n\n    :GET /db/{graph}/node/{type}/{key}/property/{property}\n\n#### Get a Property of a Node By Id\n\n    :GET /db/{graph}/node/{id}/property/{property}\n\n#### Create a Property of a Node By Type and Key\n\n    :PUT /db/{graph}/node/{type}/{key}/property/{property}\n    JSON formatted Body: {property}\n\n#### Create a Property of a Node By Id\n\n    :PUT /db/{graph}/node/{id}/property/{property}\n    JSON formatted Body: {property}\n\n#### Delete a Property of a Node By Type and Key\n\n    :DELETE /db/{graph}/node/{type}/{key}/property/{property}\n\n#### Delete a Property of a Node By Id\n\n    :DELETE /db/{graph}/node/{id}/property/{property}\n\n### Relationships\n\n#### Get A Relationship\n\n    :GET /db/{graph}/relationship/{id}\n\n#### Create A Relationship By Node Types\n\n    :POST /db/{graph}/node/{type_1}/{key_1}/relationship/{type_2}/{key_2}/{rel_type}\n    JSON formatted Body: {properties}\n\n#### Create A Relationship By Node Ids\n\n    :POST /db/{graph}/node/{id_1}/relationship/{id_2}/{rel_type}\n    JSON formatted Body: {properties}\n\n#### Delete A Relationship\n\n    :DELETE /db/{graph}/relationship/{id}\n\n#### Get the Relationships of a Node By Node Type\n\n    :GET /db/{graph}/node/{type}/{key}/relationships\n    :GET /db/{graph}/node/{type}/{key}/relationships/{direction [all, in, out]} \n    :GET /db/{graph}/node/{type}/{key}/relationships/{direction [all, in, out]}/{type TYPE_ONE}\n    :GET /db/{graph}/node/{type}/{key}/relationships/{direction [all, in, out]}/{type(s) TYPE_ONE\u0026TYPE_TWO}\n\n#### Get the Relationships of a Node By Node Id\n\n    :GET /db/{graph}/node/{id}/relationships\n    :GET /db/{graph}/node/{id}/relationships/{direction [all, in, out]} \n    :GET /db/{graph}/node/{id}/relationships/{direction [all, in, out]}/{type TYPE_ONE}\n    :GET /db/{graph}/node/{id}/relationships/{direction [all, in, out]}/{type(s) TYPE_ONE\u0026TYPE_TWO}\n\n### Relationship Properties\n\n#### Get the Properties of a Relationship\n\n    :GET /db/{graph}/relationship/{id}/properties\n\n#### Reset the Properties of a Relationship\n\n    :POST /db/{graph}/relationship/{id}/properties\n    JSON formatted Body: {properties}\n\n#### Set some Properties of a Relationship\n\n    :PUT /db/{graph}/relationship/{id}/properties\n    JSON formatted Body: {properties}\n\n#### Delete the Properties of a Relationship\n\n    :DELETE /db/{graph}/relationship/{id}/properties\n\n#### Get a Property of a Relationship\n\n    :GET /db/{graph}/relationship/{id}/property/{property}\n\n#### Create a Property of a Relationship\n\n    :PUT /db/{graph}/relationship/{id}/property/{property}\n    JSON formatted Body: {property}\n\n#### Delete a Property of a Relationship\n\n    :DELETE /db/{graph}/relationship/{id}/property/{property}\n\n### Node Degrees\n\n#### Get the Degree of a Node By Node Type\n\n    :GET /db/{graph}/node/{type}/{key}/degree\n    :GET /db/{graph}/node/{type}/{key}/degree/{direction [all, in, out]} \n    :GET /db/{graph}/node/{type}/{key}/degree/{direction [all, in, out]}/{type TYPE_ONE}\n    :GET /db/{graph}/node/{type}/{key}/degree/{direction [all, in, out]}/{type(s) TYPE_ONE\u0026TYPE_TWO}\n\n#### Get the Degree of a Node By Node Id\n\n    :GET /db/{graph}/node/{id}/degree\n    :GET /db/{graph}/node/{id}/degree/{direction [all, in, out]} \n    :GET /db/{graph}/node/{id}/degree/{direction [all, in, out]}/{type TYPE_ONE}\n    :GET /db/{graph}/node/{id}/degree/{direction [all, in, out]}/{type(s) TYPE_ONE\u0026TYPE_TWO}\n\n### Node Neighbors\n\n#### Get the Neighbors of a Node By Node Type\n\n    :GET /db/{graph}/node/{type}/{key}/neighbors\n    :GET /db/{graph}/node/{type}/{key}/neighbors/{direction [all, in, out]} \n    :GET /db/{graph}/node/{type}/{key}/neighbors/{direction [all, in, out]}/{type TYPE_ONE}\n    :GET /db/{graph}/node/{type}/{key}/neighbors/{direction [all, in, out]}/{type(s) TYPE_ONE\u0026TYPE_TWO}\n\n#### Get the Neighbors of a Node By Node Id\n\n    :GET /db/{graph}/node/{id}/neighbors\n    :GET /db/{graph}/node/{id}/neighbors/{direction [all, in, out]} \n    :GET /db/{graph}/node/{id}/neighbors/{direction [all, in, out]}/{type TYPE_ONE}\n    :GET /db/{graph}/node/{id}/neighbors/{direction [all, in, out]}/{type(s) TYPE_ONE\u0026TYPE_TWO}\n\n### Lua\n\n    :POST db/{graph}/lua\n    STRING formatted Body: {script}\n\nThe script must end in one or more values that will be returned in JSON format inside an Array.\nWithin the script the user can access to graph functions. For example:\n\n    -- Get some things about a node\n    a = NodeGetId(\"Node\",\"Max\")\n    b = NodeTypesGetCount()\n    c = NodeTypesGetCountByType(\"Node\")\n    d = NodePropertyGet(\"Node\", \"Max\", \"name\")\n    e = NodePropertyGetById(a, \"name\")\n    a, b, c, d, e\n\nA second example:\n\n    -- get the names of nodes I have relationships with\n    names = {}\n    ids = NodeGetRelationshipsIds(\"Node\", \"Max\")\n    for k=1,#ids do\n        v = ids[k]\n        table.insert(names, NodePropertyGetById(v.node_id, \"name\"))\n    end\n    names\n\n\n\n## Building\n\nRageDB uses Seastar which only runs on *nix servers (no windows or mac) so use your local linux desktop or use EC2.\n\nOn EC2 launch an instance:\n\n    Step 1: Choose an Amazon Machine Image\n    Ubuntu Server 20.04 LTS(HVM), SSD Volume Type - ami-09e67e426f25ce0d7\n\n    Step 2: Choose Instance Type\n    r5.2xlarge\n\n    Step 3: Configure Instance\n    Specify CPU options\n    Threads per core = 1\n\n    Step 4: Add Storage\n    100 GiB\n\n    Launch\n\nOnce the instance is running, connect to it and start a \"screen\" session, then follow these steps:\n\nFirst let's update and upgrade to the latest versions of local software:\n\n    sudo apt-get update \u0026\u0026 sudo apt-get dist-upgrade\n\nInstall Seastar (this will take a while, that's why we are using screen):\n\n    git clone https://github.com/scylladb/seastar.git\n    cd seastar\n    sudo ./install_dependencies.sh\n    ./configure.py --mode=release --prefix=/usr/local\n    sudo ninja -C build/release install\n\nInstall Additional Dependencies\n\n    sudo apt-get install -y ccache python3-pip\n\nInstall conan\n\n    pip install --user conan\n    sudo ln -s ~/.local/bin/conan /usr/bin/conan\n\nInstall LuaJIT\n\n    sudo apt-get install -y luajit luajit-5.1-dev\n\n### Troubleshooting\n\nIf you get errors regarding conan locks, run:\n\n    conan remove --locks\n\n### Missing Features that can be added \"easily\"\n    - Allow Node and Relationship Type handlers to take a json map defining the property keys and data types\n    - Allow additional data types: 8, 16 and 32 bit integers, 32 bit floats, byte, list of bytes, nested types \n    - NodeTypes and RelationshipTypes should allow type deletion and type id reuse\n    - Allow property type conversions (int to double, string to int, int to int array, etc).\n\n### PVS Commands\n\n    pvs-studio-analyzer trace -- make\n    pvs-studio-analyzer analyze\n    plog-converter -a GA:1,2 -t tasklist  PVS-Studio.log","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsc%2Fragedb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraphaelsc%2Fragedb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraphaelsc%2Fragedb/lists"}