Merge branch 'master' into core-enterprise-api-ref

pull/5870/head
Jason Stirnaman 2025-03-06 11:57:41 -06:00 committed by GitHub
commit e6dbb1c8c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 30 additions and 2 deletions

View File

@ -377,8 +377,36 @@ For more information, see [diskless architecture](#diskless-architecture).
> [!Note] > [!Note]
> ##### Write requests return after WAL flush > ##### Write requests return after WAL flush
> >
> Because InfluxDB sends a write response after the WAL file has been flushed to the configured object store (default is every second), individual write requests might not complete quickly, but you can make many concurrent requests to achieve higher total throughput. > By default, InfluxDB acknowledges writes after flushing the WAL file to the Object store (occurring every second). For high throughput, you can send multiple concurrent write requests.
> Future enhancements will include an API parameter that lets requests return without waiting for the WAL flush. >
> To reduce the latency of writes, use the [`no_sync` write option](#no-sync-write-option), which acknowledges writes _before_ WAL persistence completes.
##### No sync write option
The `no_sync` write option reduces latency by acknowledging write requests before WAL persistence completes. When set to `true`, InfluxDB validates the data, writes the data to the WAL, and then immediately confirms the write, without waiting for persistence to the Object store.
Using `no_sync=true` is best when prioritizing high-throughput writes over absolute durability.
- Default behavior (`no_sync=false`): Waits for data to be written to the Object store before acknowledging the write. Reduces the risk of data loss, but increases the latency of the response.
- With `no_sync=true`: Reduces write latency, but increases the risk of data loss in case of a crash before WAL persistence.
###### Immediate write using the HTTP API
The `no_sync` parameter controls when writes are acknowledged--for example:
```sh
curl "http://localhost:8181/api/v3/write_lp?db=sensors&precision=auto&no_sync=true" \
--data-raw "home,room=Sunroom temp=96"
```
###### Immediate write using the influxdb3 CLI
The `no_sync` CLI option controls when writes are acknowledged--for example:
```sh
influxdb3 write --bucket=mydb --org=my_org --token=my-token --no-sync
```
### Create a database or table ### Create a database or table