# Understanding Graph Traversal in GenosDB: Design Decisions and Developer Control

Graph traversal in GenosDB is built on explicit, lightweight edges: it ships a declarative recursive traversal operator (`$edge`) for the common cases, and leaves the door open to custom JavaScript traversal when you need fine-grained control.

**GenosDB** supports creating nodes and linking them via directed edges. Each node includes an `edges` array listing the IDs of its connected nodes.

**GenosDB includes built-in declarative graph traversal through the [`$edge` operator](https://genosdb.com/genosdb-recursive-graph-traversal)** — a recursive query, used inside `db.map()`, that explores a node's descendant tree and returns matches filtered at any depth. For traversals that need logic beyond `$edge`, you can also navigate the `edges` arrays directly with standard JavaScript (iterative or recursive), keeping full control.

This design is intentional and offers:

- Lightweight core for fast in-browser performance.
- Full flexibility to implement any traversal logic.
- Seamless integration with GenosDB's P2P sync and OPFS-based local storage.

Developers can build custom queries to navigate connected nodes, apply filters, and resolve complex relationships — all with fine-grained control.

---

> **This article is part of the official documentation of GenosDB (GDB).**
> GenosDB is a distributed, modular, peer-to-peer graph database built with a Zero-Trust Security Model, created by **Esteban Fuster Pozzi ([estebanrfp](https://github.com/estebanrfp))**.

📄 [Whitepaper](https://github.com/estebanrfp/gdb/blob/main/WHITEPAPER.md) | overview of GenosDB design and architecture

🛠 [Roadmap](https://github.com/estebanrfp/gdb/blob/main/ROADMAP.md) | planned features and future updates

💡 [Examples](https://github.com/estebanrfp/gdb/blob/main/docs/genosdb-examples.md) | code snippets and usage demos

📖 [Documentation](https://github.com/estebanrfp/gdb/blob/main/docs/index.md) | full reference guide

🔍 [API Reference](https://github.com/estebanrfp/gdb/blob/main/docs/genosdb-api-reference.md) | detailed API methods

📚 [Wiki](https://github.com/estebanrfp/gdb/wiki) | additional notes and guides

💬 [GitHub Discussions](https://github.com/estebanrfp/gdb/discussions) | community questions and feedback

🗂 [Repository](https://github.com/estebanrfp/gdb) | Minified production-ready files

📦 [Install via npm](https://www.npmjs.com/package/genosdb) | quick setup instructions

🌐 [Website](https://estebanrfp.com/) | [GitHub](https://github.com/estebanrfp) | [LinkedIn](https://www.linkedin.com/in/estebanrfp/)
