Skip to content

Added DuckDB as log backend#1656

Open
zbalkan wants to merge 49 commits intoTechnitiumSoftware:masterfrom
zbalkan:app/querylogsduckdbapp
Open

Added DuckDB as log backend#1656
zbalkan wants to merge 49 commits intoTechnitiumSoftware:masterfrom
zbalkan:app/querylogsduckdbapp

Conversation

@zbalkan
Copy link
Contributor

@zbalkan zbalkan commented Jan 5, 2026

DuckDB is an embedded columnar database, designed for OLAP loads. It is very fast in appending and querying. The usage is similar to SQLite. The ability to extend via plugins is the biggest plus.

I do have an internal use case for this, but a generic app may help others as well.

Copilot AI review requested due to automatic review settings January 5, 2026 19:20
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds DuckDB as a new log backend for the DNS Server, providing an embedded columnar database option for storing and querying DNS request logs. DuckDB is designed for OLAP workloads and offers fast appending and querying capabilities similar to SQLite but optimized for analytical queries.

Key changes:

  • Adds a new QueryLogsDuckDBApp application that implements IDnsQueryLogger and IDnsQueryLogs interfaces
  • Uses channel-based batching for efficient bulk inserts with a capacity of 20,000 entries and batch size of 1,000
  • Creates a comprehensive database schema with indexes on all queryable fields

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 16 comments.

File Description
DnsServer.sln Adds QueryLogsDuckDBApp project to the solution with appropriate build configurations and folder nesting
Apps/QueryLogsDuckDBApp/dnsApp.config Provides default configuration enabling logging with a local database path
Apps/QueryLogsDuckDBApp/QueryLogsDuckDBApp.csproj Defines project structure targeting .NET 9.0 with DuckDB.NET.Data.Full package dependency
Apps/QueryLogsDuckDBApp/App.cs Implements the main application logic for logging DNS queries to DuckDB and querying the stored logs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ShreyasZare
Copy link
Member

Thanks for the PR. Will check it soon.

@Shaaan
Copy link

Shaaan commented Jan 15, 2026

I see that DuckDB is added as a plugin. Wouldn't it be better if DuckDB is used for the internal logs and as a default for query logs instead of the current log files? It will make the internal logs more performant, especially if queries are logged in the system log

@zbalkan
Copy link
Contributor Author

zbalkan commented Jan 27, 2026

Hi @Shaaan,

What do you mean by internal logs? The system logs that Technitium DNS Server stores in ./log by default? That adds a dependency when users can troubleshoot with plaintext. And if they just redirect to Console, that'd make it less useful.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 22 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zbalkan zbalkan force-pushed the app/querylogsduckdbapp branch from 0bb1780 to 72cb9a1 Compare January 27, 2026 19:48
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 10 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zbalkan zbalkan marked this pull request as draft January 28, 2026 11:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 14 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 11 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zbalkan zbalkan marked this pull request as ready for review January 28, 2026 19:33
@zbalkan
Copy link
Contributor Author

zbalkan commented Jan 28, 2026

Ready for review.

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.

3 participants