Skip to content

Graph Database (Dgraph) for Persistence #9

@TigerWhiteDev

Description

@TigerWhiteDev

Objective

Add plugin on Horizon for interact with dgraph databases

Justify and implement the chosen technical solution for persistence: Dgraph.

Why not relational or other NoSQL?

  • Relational databases: not well-suited for deep hierarchies (queries become expensive with many joins).
  • Document databases: require duplication/denormalization, leading to consistency issues.
  • Key-value or column-oriented stores: good for simple analytics, but not suited for complex, dynamic relationships.

Why Dgraph?

  • Performance and scalability: designed to distribute data and queries across multiple nodes.
  • Natural modeling: hierarchies and dependencies are directly expressed as a graph.
  • Flexibility: adding new relationship types does not require heavy refactoring.
  • Powerful queries: fast hierarchical traversals (e.g., retrieve all descendants of an object).
  • Consistency: ACID transactions, unlike some NoSQL solutions.

Concrete use cases

  • Persisting player state (location, stats, active missions) so that a player can log out and reconnect seamlessly.
  • Tracking containers such as cargo holds, storage crates, or loot chests, with all nested items stored and retrievable.
  • Updating player or ship movements: only relative positions are recalculated, minimizing the amount of data updated in the graph.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request
    No fields configured for Feature.

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions