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

# Data Store Configuration

> Set up PostgreSQL, Redis, and Typesense for your Blnk deployment.

Blnk relies on PostgreSQL and Redis to run core ledger operations, and can optionally use TypeSense for search and indexing. This page explains the settings used to connect and tune each service.

***

## Database settings

Use these settings to configure Blnk’s PostgreSQL connection and connection pool.

<Note>
  **Note:** Blnk only supports PostgreSQL as its database engine. You cannot use other database engines like MySQL or SQLite with Blnk.
</Note>

<CodeGroup>
  ```bash blnk.env theme={"system"}
  BLNK_DATA_SOURCE_DNS="postgres://user:pass@postgres:5432/blnk?sslmode=disable"
  BLNK_DATABASE_MAX_OPEN_CONNS=25
  BLNK_DATABASE_MAX_IDLE_CONNS=10
  BLNK_DATABASE_CONN_MAX_LIFETIME=30m
  BLNK_DATABASE_CONN_MAX_IDLE_TIME=5m
  ```

  ```json blnk.json theme={"system"}
  {
    "data_source": {
      "dns": "postgres://user:pass@postgres:5432/blnk?sslmode=disable",
      "max_open_conns": 25,
      "max_idle_conns": 10,
      "conn_max_lifetime": "30m",
      "conn_max_idle_time": "5m"
    }
  }
  ```
</CodeGroup>

|                                    | Description                                                                       | Default |
| ---------------------------------- | --------------------------------------------------------------------------------- | ------- |
| `BLNK_DATA_SOURCE_DNS`             | PostgreSQL connection string used by Blnk. This is required.                      | None    |
| `BLNK_DATABASE_MAX_OPEN_CONNS`     | Maximum number of open database connections in the pool.                          | `25`    |
| `BLNK_DATABASE_MAX_IDLE_CONNS`     | Maximum number of idle database connections kept ready.                           | `10`    |
| `BLNK_DATABASE_CONN_MAX_LIFETIME`  | Maximum amount of time a database connection can be reused before it is recycled. | `30m`   |
| `BLNK_DATABASE_CONN_MAX_IDLE_TIME` | Maximum amount of time an idle database connection is kept before it is recycled. | `5m`    |

### `BLNK_DATA_SOURCE_DNS`

This is the PostgreSQL connection string Blnk uses to connect to its database. **This setting is required.** Blnk will not start without it.

1. Make sure the database is reachable from the environment where Blnk is running. This includes verifying the hostname, port, credentials, and network access rules before starting the server.

2. You should also make sure the `sslmode` in the connection string matches what your database provider expects. If this is set incorrectly, Blnk may fail to connect even when the rest of the connection string is valid.

<Tip>
  Some hosted PostgreSQL providers expose more than one connection URL. For application workloads, use the direct PostgreSQL connection string that is intended for normal client connections.
</Tip>

### Best practices

1. Always set `BLNK_DATA_SOURCE_DNS` explicitly.
2. Start with the default pool settings unless you already know your database limits.
3. Increase `BLNK_DATABASE_MAX_OPEN_CONNS` only if your PostgreSQL instance can handle more concurrent connections.
4. Use the connection lifetime and idle time settings to recycle stale connections in long-running deployments.

***

## Redis configuration

<CodeGroup>
  ```bash blnk.env theme={"system"}
  BLNK_REDIS_DNS=redis://:password@redis:6379/0
  BLNK_REDIS_SKIP_TLS_VERIFY=false
  ```

  ```json blnk.json theme={"system"}
  {
    "redis": {
      "dns": "redis://:password@redis:6379/0",
      "skip_tls_verify": false
    }
  }
  ```
</CodeGroup>

|                              | Description                                                     | Default |
| ---------------------------- | --------------------------------------------------------------- | ------- |
| `BLNK_REDIS_DNS`             | Redis address or connection URL used by Blnk. This is required. | None    |
| `BLNK_REDIS_SKIP_TLS_VERIFY` | Disables TLS certificate verification for Redis connections.    | `false` |

### `BLNK_REDIS_DNS`

`BLNK_REDIS_DNS` is the Redis address or connection URL Blnk uses for queueing and coordination. **This setting is required.**

Why? Because Blnk uses Redis for distributed balance locks, transaction and webhook queues, hot-pair state, and other worker coordination. If Redis is unavailable, queue processing and lock coordination are affected even if PostgreSQL is healthy.

<Tip>
  Use a full Redis URL when authentication or TLS is involved. For TLS-enabled Redis connections, make sure the URL starts with `rediss://`.
</Tip>

### `BLNK_REDIS_SKIP_TLS_VERIFY`

This disables certificate verification for TLS Redis connections.

Only set to `true` when you are working in a controlled environment and understand the risk. Disabling certificate verification weakens transport security and should not be the default for production deployments.

***

## Typesense configuration

Use these settings to enable Blnk search and indexing via Typesense.

<CodeGroup>
  ```bash blnk.env theme={"system"}
  BLNK_TYPESENSE_DNS=http://typesense:8108
  BLNK_TYPESENSE_KEY=blnk-api-key
  ```

  ```json blnk.json theme={"system"}
  {
    "typesense": {
      "dns": "http://typesense:8108"
    },
    "type_sense_key": "blnk-api-key"
  }
  ```
</CodeGroup>

|                      | Description                                                                                   | Default             |
| :------------------- | :-------------------------------------------------------------------------------------------- | :------------------ |
| `BLNK_TYPESENSE_DNS` | TypeSense server address. If unset, Blnk disables search and indexing features via Typesense. | Disabled when unset |
| `BLNK_TYPESENSE_KEY` | API key used to connect to TypeSense.                                                         | `blnk-api-key`      |

### When to use Typesense

TypeSense is optional. If it is not configured, Blnk starts just fine, but search and indexing features via Typesense are disabled.

For most search use cases, start with the [Direct DB filter API](/search/db/filtering). It is a better fit when you need precise database-backed filtering, sorting, and pagination without running a separate search service.

Use Typesense when you need full-text search, faceted filtering, faster queries across very large datasets, or search-oriented workflows that benefit from a dedicated index.

<Tip>
  **Tip:** If you are using TypeSense, we recommend `BLNK_TYPESENSE_KEY` explicitly instead of relying on the default key.
</Tip>

***

## Need help?

We are very happy to help you make the most of Blnk, regardless of whether it is your first time or you are switching from another tool.

To ask questions or discuss issues, please [contact us](mailto:support@blnkfinance.com) or [join our Discord community](https://discord.gg/7WNv94zPpx).

***

<Tip>
  **Tip:** Connect to Blnk Cloud to see your Core data.

  You can view your transactions, manage identities, create custom reports, invite other team members to collaborate, and perform operations on your Core — all in one dashboard.

  [Check out Blnk Cloud →](https://www.blnkfinance.com/products/cloud)
</Tip>
