---
title: Multithreading and parallelism
description: Learn how to use multithreading and parallelism for special cases to read data from MotherDuck
---

DuckDB supports two concurrency models:

 - Single-process read/write where one process can both read and write to the database.
 - Multi-process read-only (access_mode = 'READ_ONLY') multiple processes can read from the database, but none can write.

This approach provides significant performance benefits for analytics databases. You can find more details on how to handle multiple process writes (or multiple read + write connections) in the [DuckDB documentation](https://duckdb.org/docs/stable/connect/concurrency.html).

## Multi-threading and parallelism in different languages

Depending on the needs of your data application, you can use multithreading for improved performance.
If your queries will benefit from concurrency, you can create connections in multiple threads.
This is the case when for example you have multiple users reading different sets of data, or if you are reading from
separate tables or data files at the same time. For multiple long-lived connections to one or more databases in one or more MotherDuck accounts,
you can use connection pooling. Implementation details can be seen in the cards linked below:

## Included pages

- [Multithreading and Parallelism with Python and MotherDuck](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/multithreading-and-parallelism/multithreading-and-parallelism-python): Performance tuning via multithreading with multiple connections to MotherDuck with Python
- [Multithreading and Parallelism with JDBC and MotherDuck](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/multithreading-and-parallelism/multithreading-and-parallelism-jdbc): Performance tuning via multithreading with multiple connections to MotherDuck with JDBC
- [Multithreading and Parallelism with Node.js and MotherDuck](https://motherduck.com/docs/key-tasks/authenticating-and-connecting-to-motherduck/multithreading-and-parallelism/multithreading-and-parallelism-nodejs): Performance tuning via multithreading with multiple connections to MotherDuck with Node.js


---

## 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.
