hugo2046/dolphindb_skill
Overview
This skill provides a complete, practical reference for DolphinDB time-series database usage, combining 1,490 technical documents and three official whitepapers. It focuses on architecture, storage engines (TSDB/OLAP), stream processing, and mid/high-frequency backtesting best practices. The collection is optimized for production design, performance tuning, and real-time/quant workflows.
How this skill works
The skill organizes content by scenario and role, exposing whitepapers for architecture, streaming, and backtesting plus a searchable index of API and function references. It includes concrete code recipes for partitioned TSDB/OLAP tables, stream engine setup, replay-based backtesting, and advanced SQL patterns. You can follow step-by-step workflows for database design, stream pipeline development, and building a production-grade backtest engine.
When to use it
- Design or deploy a production DolphinDB cluster with partitioning and high availability
- Implement real-time stream processing (K-line synthesis, CEP, sliding-window aggregation)
- Build or accelerate mid/high-frequency backtesting and simulated matching
- Optimize query performance and choose between TSDB and OLAP storage engines
- Lookup specific functions, SQL patterns, or API usage for Python/Java/C++ integration
Best practices
- Match engine to workload: TSDB for high-frequency point writes and sorted reads; OLAP for append/batch analytics
- Use composite partitioning (VALUE date + HASH symbol) for large time-series datasets to enable partition pruning
- Define sortColumns for TSDB to enable fast range scans and deduplication strategies like LAST
- Adopt stream-batch unified patterns: use TimeSeriesEngine for K-lines and replay for deterministic backtests
- Profile and pressure-test with representative data; consider C++ plugins for performance-critical backtesting components
Example use cases
- Create a composite-partitioned TSDB table for tick data with sort and dedupe settings
- Assemble 1-minute K-line streams using a TimeSeriesEngine and subscribe/append handlers
- Run deterministic replay-driven backtests with exchange simulation and order/position metrics
- Deploy OLAP partitioned tables for monthly batch analytics and pivot/Context By queries
- Optimize production queries by applying partition pruning, parallel execution, and appropriate storage engine selection
FAQ
Choose TSDB when you need high-frequency inserts, sorted access, and point queries; choose OLAP for bulk append and heavy analytical queries. Use whitepaper chapters on storage engines for tradeoffs.
Can I run deterministic backtests at scale?
Yes. Use replay or replayDS to feed replayStream, create a backtest engine with simulated exchange matching, and consider C++ plugins to accelerate CPU-bound components.
Where to find a specific function or API?
Use the included full catalog to browse 1,490 documents by category (functions, SQL, time-series, streaming) or search the references directory for keywords.