Skip to content

9 - Added ReSQL - DuckDB support#224

Open
Burnfireblaze wants to merge 45 commits intoapache:masterfrom
DDS-Project-Team:feature/resql-service
Open

9 - Added ReSQL - DuckDB support#224
Burnfireblaze wants to merge 45 commits intoapache:masterfrom
DDS-Project-Team:feature/resql-service

Conversation

@Burnfireblaze
Copy link

@Burnfireblaze Burnfireblaze commented Jan 12, 2026

Linked Issue

Closes #238
Discussion: #238

Description

This PR introduces ReSQL, a SQL-based service layer for ResilientDB that enables relational querying capabilities on top of the existing distributed ledger execution model. The ReSQL service provides an alternative or replacement for traditional key-value storage with a structured relational storage model backed by DuckDB, allowing decentralized applications to interact with ResilientDB using standard SQL semantics rather than low-level KV operations.

Under the hood

Storage & Execution

  • Integrates DuckDB as an embedded SQL backend within ResilientDB.
  • Extends the existing KV executor to support SQL-based read and write execution paths.
  • Adds runtime flags for enabling and configuring ReSQL mode.
  • Introduces relational metadata and schema management via DuckDB catalogs.
  • Enables relational table creation, insertion, selection, and update semantics over decentralized application data.

Service Layer

Implements a dedicated ReSQL service responsible for:

  • Initializing and managing the embedded DuckDB instance.
  • Handling SQL connection contexts and query execution lifecycles.
  • Parsing and executing SQL statements.
  • Returning structured tabular results to clients.
  • Providing a higher-level interface suitable for decentralized application workflows.

Tooling & Scripts

  • Adds standalone startup scripts for launching the ReSQL service.
  • Adds test tooling (test_sql) for validating execution of SQL workloads.
  • Provides developer-facing utilities to bootstrap relational schemas and queries on ResilientDB.

Motivation

ResilientDB currently exposes a key-value storage abstraction, which limits expressiveness for applications requiring relational schemas, joins, range queries, or analytical operators. ReSQL introduces an embedded relational interface backed by SQL, enabling application developers to model state with structured schemas without relying on external DBMS systems.

Compatibility & Deployment

  • ReSQL is an optional module and does not modify or interfere with ResilientDB’s core consensus or ledger protocols.
  • KV-based applications remain fully compatible without changes.
  • SQL execution can be selectively enabled through runtime flags.

Testing & Validation

Validation included:

  • Data insertion and retrieval queries.
  • Selection and projection operators.
  • Basic relational schema management.
  • End-to-end execution tests via test_sql.

Benefits

  • Enables RDBMS-style semantics for decentralized applications.
  • Allows structured data modeling and querying without external services.
  • Leverages DuckDB’s in-process analytical engine for efficient SQL execution.
  • Improves developer ergonomics through familiar SQL abstractions.

Sudarsan Srivathsun and others added 30 commits November 9, 2025 16:25
…kdbinfo, modified BUILD files for lib inclusions
…rface_extension

added new duckdb files, modified storage headers, added proto for duc…
…-backend-DuckDB

Adds duckDB runtime flag to kv_service
removed passing of path to rely on default
added a test_sql script that tests the functionalities offered by the…
Sudarsan Srivathsun and others added 15 commits December 4, 2025 22:24
…script

[temp] added creation of folders to start_resql_script to avoid node …
…kdbinfo, modified BUILD files for lib inclusions
fixes for kv service build

fixes for kv service build

server config modified

Adds duckDB runtime flag to kv_service

Removes Changes made to kv

RESQL Start Service added

removed passing of path to rely on default
… duckdb version of resdb as resql

Logging enabled

Logging enabled 2

Logging enabled 3

Logging enabled 4

Logging enabled 5
modified

modified

Autocomplete flags
[temp] added creation of folders to start_resql_script to avoid node crashing
@Burnfireblaze Burnfireblaze changed the title Team 9 - Added ReSQL - DuckDB support 9 - Added ReSQL - DuckDB support Jan 12, 2026
@msadoghi msadoghi requested review from cjcchen and harish876 January 13, 2026 01:42
@msadoghi msadoghi added this to the Release v1.13.0 Planning milestone Feb 17, 2026
@Burnfireblaze
Copy link
Author

@cjcchen and @harish876 Could you please review this pull request and let us know of the changes we need to do to get this PR merged?

return std::make_unique<ResQL>(cfg);
}

ResQL::ResQL(const DuckDBInfo& config) : config_(config) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The filename is dockdb. Why is this called ResQL?

@@ -0,0 +1,145 @@
#!/bin/bash
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

source header

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why remove the header?

}


5 127.0.0.1 20005
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you need this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add ReSQL: SQL-Based Relational Service Layer for ResilientDB

6 participants