DEV Community

Cover image for GenosDB: Distributed Graph Database with Module Support
Esteban Fuster Pozzi
Esteban Fuster Pozzi

Posted on • Originally published at genosdb.com

GenosDB: Distributed Graph Database with Module Support


Distributed Graph Databases with AI and Geospatial Query Support Modules

In the fast-paced world of web development, the ability to manage data efficiently, in real time, and in a distributed manner is more crucial than ever. GenosDB emerges as an innovative solution — not only due to its robust foundation as a client-side P2P graph database — but also because of its inherently modular and extensible architecture. Today, we explore how this modularity unlocks a new paradigm of possibilities by integrating artificial intelligence directly into its core.

The Solid Foundations of GenosDB

Before diving into its modular extensions, let’s recall the core features that make GenosDB a powerful platform:- Real-Time P2P Synchronization: Using WebRTC (via GenosRTC internal module) and BroadcastChannel, GenosDB allows automatic data sync across multiple peers and browser tabs without a central server.- Conflict-Free Consistency: Powered by Hybrid Logical Clocks (HLC) and a Last-Write-Wins (LWW) conflict resolution strategy, ensuring data convergence even under concurrent operations.- Advanced Client-Side Persistence: Leverages Origin Private File System (OPFS) for efficient storage with fallback to IndexedDB, all managed asynchronously in Web Workers to avoid blocking the main thread.- Optimal Efficiency: Uses MessagePack for binary serialization and Pako (zlib) for compression, minimizing bandwidth and storage usage.

The Power of Modularity: A Growing Ecosystem

The true magic of GenosDB lies in its design, which allows clean and decoupled injection of new features and operators. This is especially evident in its dynamic query and data processing capabilities.

1. A Dynamic and Extensible Query System .map()

The core of data interaction in GenosDB is its .map() method. It’s not just for retrieving data; it’s a live interface supporting:- Rich and Familiar Operators: A built-in set of operators ($eq, $ne, $gt, $gte, $lt, $lte, $in, $between, $exists, $text, $like, $regex) enables precise filtering.- Complex Logical Queries: Use of $and, $or, and $not allows building advanced logical conditions, applied recursively via createFilter.- Access to Nested Fields: With getNestedValue, it’s possible to query and sort by deeply nested fields within node value objects (e.g., user.address.city).- Pagination & Sorting: Full control over results with $limit, $after, $before, and order (asc / desc) on any field.- Real-Time Updates: By providing a callback function, .map() becomes reactive — emitting initial, added, updated, and removed events, essential for dynamic UIs.

2. Smart Integration: AI-Powered Data

GenosDB enhances data handling with natural language queries that integrate seamlessly into the query flow.

NL-Enhanced Data Processing

How it works: The GenosDB instance is wrapped. When using .map(), a prompt option can be passed.The Process:- GenosDB filters nodes using standard operators.- The value of the resulting nodes, along with the user prompt.- The AI is instructed to modify fields within the value objects and return a JSON array with the same structure and transformed data.Use Cases: Data enrichment, translation, summarization, content generation, classification, etc. — all within the query stream.

NL-Guided Query Generation

How it works: Similar setup with natural language queries (via a dedicated module).- Instead of a structured query object, users can pass a natural language prompt to .map() (e.g., “find active users from Spain”).- This prompt is sent to the API with instructions to convert it into a structured GenosDB query object (with query, order, field).- The generated query is then executed as the original .map() call.Use Cases: Makes queries accessible to non-technical users, enables natural language search, and simplifies flexible query UI design.

3. Conquering Space: Geospatial Operators

For applications that handle location data, GenosDB provides a geospatial operators module.New Available Operators:- $near: Filters nodes whose coordinates (e.g., node.value.location.latitude, node.value.location.longitude) are within a specific radius (in kilometers) of a given center point.- $bbox: Filters nodes whose coordinates fall within a geographical bounding box defined by min/max latitudes and longitudes.Seamless Integration: These operators can be used in the .map() query object like any standard operator, allowing geographic filters to be combined with others.Distance Calculation: Includes an internal function for Haversine distance calculation between two geographic points.

What Makes GenosDB Unique?

The combination of these features and its modular design make GenosDB stand out:- Merging Worlds: One of the few (if not the only) client-side solutions to natively and modularly integrate graph databases, P2P sync, advanced persistence, and now, AI and geo-extensions.- True Decentralization with Local Intelligence: Doesn’t rely on a central server for business logic or sync, yet can extend local capabilities via controlled interaction with external APIs (like AI).- Extensibility at its Core: The ease of adding new operators and processing modules (as demonstrated with AI and Geo) means GenosDB can evolve with any application’s needs.- Enhanced Developer Experience: Using natural language for queries (via AIQuery.js) or enriching data on the fly (via AIModule.js) simplifies complex tasks and enables new data interaction patterns.- Client-Side Efficiency and Autonomy: Running mostly on the client with optimized storage and async processing, it reduces server load and delivers faster, more resilient UX.

The Future is Distributed, Intelligent, and Modular

GenosDB isn’t just a database — it’s a platform for building the next generation of decentralized and intelligent web applications. Its modular architecture invites the community to contribute new operators, processing systems, and extensions, shaping a future where client-side database capabilities are limited only by our imagination.If you’re seeking an innovative way to handle graph data, sync it in real time, and extend its power in previously unthinkable ways — GenosDB deserves your attention.


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).

📄 Whitepaper | overview of GenosDB design and architecture

🛠 Roadmap | planned features and future updates

💡 Examples | code snippets and usage demos

📖 Documentation | full reference guide

🔍 API Reference | detailed API methods

📚 Wiki | additional notes and guides

💬 GitHub Discussions | community questions and feedback

🗂 Repository | Minified production-ready files

📦 Install via npm | quick setup instructions

🌐 Website | GitHub | LinkedIn

Top comments (0)