> ## Documentation Index
> Fetch the complete documentation index at: https://docs.monk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# DolphinDB

> Ready-to-run DolphinDB container template you can run directly or inherit to integrate a high-performance time-series database into your stack.

## Overview

This template provides a production‑ready DolphinDB instance as a Monk runnable. You can:

* Run it directly to get a managed DolphinDB container with sensible defaults
* Inherit it in your own runnable to seamlessly add a high-performance time-series database to your stack

DolphinDB is a high-performance distributed time-series database designed for financial and IoT data analytics. It combines in-memory computing with a columnar storage engine to deliver exceptional query performance on massive datasets.

It exposes DolphinDB on port 8848, persists data to a host volume, and provides a web-based interface for database management and queries.

## What this template manages

* DolphinDB container (configurable image tag)
* Network service on port 8848
* Persistent volumes for data storage

## Quick start (run directly)

1. Load templates

```bash theme={null}
monk load MANIFEST
```

2. Run DolphinDB with defaults

```bash theme={null}
monk run dolphindb/dolphindb
```

3. Customize settings (recommended via inheritance)

Running directly uses the defaults defined in this template's `variables`. Secrets added with `monk secrets add` will not affect this runnable unless you inherit it and reference those secrets.

* Preferred: inherit and replace variables with `secret("...")` as shown below.
* Alternative: fork/clone and edit the `variables` in `dolphindb.yml`, then `monk load MANIFEST` and run.

Once started, connect to `localhost:8848` (or the runnable hostname inside Monk networks) to access the DolphinDB web interface.

## Configuration

Key variables you can customize in this template:

```yaml theme={null}
variables:
  image_tag: "v2.00.9"    # container image tag
  db_port: "8848"         # DolphinDB service port (default: 8848)
```

Data is persisted under `${monk-volume-path}/dolphindb` on the host.

## Use by inheritance (recommended for apps)

Inherit the DolphinDB runnable in your time-series application and declare a connection. Example:

```yaml theme={null}
namespace: myapp
tsdb:
  defines: runnable
  inherits: dolphindb/dolphindb
analytics:
  defines: runnable
  containers:
    app:
      image: myorg/analytics
  connections:
    database:
      runnable: tsdb
      service: dolphindb
  variables:
    database-host:
      value: <- connection-hostname("database")
    database-port:
      value: "8848"
```

Then run your app group:

```bash theme={null}
monk run myapp/analytics
```

## Ports and connectivity

* Service: `dolphindb` on TCP port `8848`
* From other runnables in the same process group, use `connection-hostname("\<connection-name>")` to resolve the DB host.

## Persistence and configuration

* Data path: `${monk-volume-path}/dolphindb:/data`
* DolphinDB stores all databases and time-series data in this directory

## Use cases

DolphinDB excels at:

* Financial market data analysis
* IoT sensor data processing
* Real-time streaming analytics
* High-frequency trading systems
* Time-series forecasting

## Related templates

* Combine with `grafana/` for time-series visualization
* Integrate with `telegraf/` for metrics collection and monitoring

## Troubleshooting

* Ensure the host volumes are writable by the container user.
* Check logs:

```bash theme={null}
monk logs -l 500 -f dolphindb/dolphindb
```
