Files
nexus/wiki/concepts/DuckDB.md

44 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: "DuckDB"
type: concept
tags: ["database", "embedded", "sql", "analytics"]
last_updated: 2026-04-22
---
## Overview
嵌入式分析型数据库管理系统Analytical DBMSDenchClaw 的数据存储后端。完全嵌入进程、无服务器进程、无凭证、无网络依赖——只是一个文件。
## Aliases
- None
## Definition
DuckDB 是专为 OLAP在线分析处理优化的嵌入式 SQL 数据库。它是 SQLite 的分析型替代品,支持完整 SQL 语法,但针对聚合查询和大规模数据分析进行了优化。
## Key Properties
- **嵌入式**: 链接到应用程序进程,无需独立服务器
- **零配置**: 无需安装、启动或维护数据库服务器
- **无网络**: 数据在本地文件,无需远程连接
- **完全 SQL**: 支持标准 SQL 语法DML、DDL、子查询、窗口函数等
- **列式存储**: 针对分析查询优化GROUP BY、JOIN、聚合
- **向量式执行**: CPU SIMD 加速批量数据处理
## Why DuckDB for CRM
DenchClaw 选择 DuckDB 作为嵌入式 CRM 数据库的理由:
1. **最小体积**: 比 PostgreSQL/MySQL 等服务器数据库轻量得多
2. **完全 SQL**: 保留关系型数据库的全部查询能力
3. **无摩擦**: 无需管理服务器进程或连接字符串
4. **高性能**: 分析查询性能优于 SQLite
> "DuckDB is the sweet spot: Smallest, most performant embedded database that still supports full SQL. No server process, no credentials, no network — just a file."
> — DenchClaw 核心设计哲学
## Use Cases
- [[DenchClaw]]: 本地 CRM 结构化数据存储
- 分析型工作负载OLAP
- 数据科学探索pandas 集成)
- 嵌入式分析功能
## Related
- [[DenchClaw]]: 使用 DuckDB 的 CRM 框架
- [[File-System-First-UI]]: 与 DuckDB 配合的设计哲学