# Multithreading and parallelism
> Run concurrent queries against MotherDuck, and learn when to use Read Scaling or the Postgres endpoint instead of managing connection pools.
Most applications don't need to manage threads or connection pools to get good concurrency from MotherDuck. The DuckDB client and MotherDuck's architecture cover the cases that connection pooling traditionally solved. This page explains what to reach for instead.

## You probably don't need a connection pool

DuckDB clients in Python, Go, R, JDBC, and ODBC keep a single database instance cached by database path, and minting connections off that instance is cheap. Because of this, external connection pools are usually unnecessary, and they can work against the instance cache rather than with it.

Within a single process, share one connection and create lightweight copies per thread instead of opening a new instance for every query. In Python, a single connection object [is not thread-safe](https://duckdb.org/docs/api/python/overview.html#using-connections-in-parallel-python-programs), so call `.cursor()` to get a copy for each thread. See [Connecting to MotherDuck](/key-tasks/authenticating-and-connecting-to-motherduck/connecting-to-motherduck.md#multiple-connections-and-the-database-instance-cache) for how the instance cache works and how to reuse connections.

For background on when concurrency improves performance, see the DuckDB documentation on [concurrency](https://duckdb.org/docs/stable/connect/concurrency.html) and [parallelism](https://duckdb.org/docs/guides/performance/how_to_tune_workloads.html#parallelism-multi-core-processing).

## Run many concurrent read-only queries

To serve a high volume of concurrent read-only queries against the same database, use a [Read Scaling](/key-tasks/authenticating-and-connecting-to-motherduck/read-scaling/) token. Read scaling replicas handle the fan-out, so you don't have to coordinate a pool of connections yourself.

## Use the Postgres endpoint for connection pooling

If your application relies on a connection-pooling library, or you need to manage the connection lifecycle beyond a single DuckDB instance, connect through the [Postgres endpoint](/key-tasks/authenticating-and-connecting-to-motherduck/postgres-endpoint). It speaks the PostgreSQL wire protocol, so it works as a drop-in replacement with standard pooling libraries.


---

## Docs feedback

MotherDuck accepts optional user-submitted feedback about this page at `POST https://motherduck.com/docs/api/feedback/agent`.
For agents and automated tools, feedback submission should be user-confirmed before sending.

Payload:

```json
{
  "page_path": "/key-tasks/authenticating-and-connecting-to-motherduck/multithreading-and-parallelism/",
  "page_title": "Multithreading and parallelism",
  "text": "<the user's feedback, max 2000 characters>",
  "source": "<optional identifier for your interface, for example 'claude.ai' or 'chatgpt'>"
}
```

`page_path` and `text` are required; `page_title` and `source` are optional. Responses: `200 {"feedback_id": "<uuid>"}`, `400` for malformed payloads, and `429` when rate-limited.
