You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: content/shared/v3-core-get-started/_index.md
+4-4
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,7 @@ This guide covers InfluxDB 3 Core (the open source release), including the follo
47
47
48
48
*[Install and startup](#install-and-startup)
49
49
*[Data Model](#data-model)
50
-
*[Write data to the database](#write-data)
50
+
*[Write data](#write-data)
51
51
*[Query the database](#query-the-database)
52
52
*[Last values cache](#last-values-cache)
53
53
*[Distinct values cache](#distinct-values-cache)
@@ -251,7 +251,7 @@ Subsequent requests can add new fields on-the-fly, but can't add new tags.
251
251
252
252
{{% product-name %}} is optimized for recent data, but accepts writes from any time period. It persists that data in Parquet files for access by third-party systems for longer term historical analysis and queries. If you require longer historical queries with a compactor that optimizes data organization, consider using [InfluxDB 3 Enterprise](/influxdb3/enterprise/get-started/).
253
253
254
-
The database provides three write API endpoints that respond to HTTP `POST` requests:
254
+
{{% product-name %}} provides three write API endpoints that respond to HTTP `POST` requests:
255
255
256
256
#### /api/v3/write_lp endpoint
257
257
@@ -422,7 +422,7 @@ To learn more about a subcommand, use the `-h, --help` flag:
422
422
influxdb3 create -h
423
423
```
424
424
425
-
### Query a database
425
+
### Query the database
426
426
427
427
InfluxDB 3 now supports native SQL for querying, in addition to InfluxQL, an
428
428
SQL-like language customized for time series queries.
@@ -764,7 +764,7 @@ To test a plugin, do the following:
764
764
765
765
1. Create a _plugin directory_--for example, `/path/to/.influxdb/plugins`
766
766
2. [Start the InfluxDB server](#start-influxdb) and include the `--plugin-dir <PATH>` option.
767
-
3. Save the [preceding example code](#example-python-plugin) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
767
+
3. Save the [preceding example code](#example-python-plugin-for-wal-flush) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
768
768
4. To run the test, enter the following command with the following options:
@@ -155,10 +161,17 @@ To run the [Docker image](/influxdb3/enterprise/install/#docker-image) and persi
155
161
-`-v /path/on/host:/path/in/container`: Mounts a directory from your filesystem to the container
156
162
-`--object-store file --data-dir /path/in/container`: Uses the mount for server storage
157
163
164
+
> [!Note]
165
+
>
166
+
> The {{% product-name %}} Docker image exposes port `8181`, the `influxdb3` server default for HTTP connections.
167
+
> To map the exposed port to a different port when running a container, see the Docker guide for [Publishing and exposing ports](https://docs.docker.com/get-started/docker-concepts/running-containers/publishing-ports/).
_For more information about server options, run `influxdb3 serve --help`._
@@ -188,10 +215,12 @@ _For more information about server options, run `influxdb3 serve --help`._
188
215
> Use the `docker kill` command to stop the container:
189
216
>
190
217
> 1. Enter the following command to find the container ID:
218
+
> <!--pytest.mark.skip-->
191
219
> ```bash
192
220
> docker ps -a
193
221
>```
194
222
> 2. Enter the command to stop the container:
223
+
><!--pytest.mark.skip-->
195
224
>```bash
196
225
> docker kill<CONTAINER_ID>
197
226
>```
@@ -203,7 +232,7 @@ Upon verification, the license creation, retrieval, and application are automate
203
232
204
233
_During the alpha period, licenses are valid until May 7, 2025._
205
234
206
-
### Data Model
235
+
### Data model
207
236
208
237
The database server contains logical databases, which have tables, which have columns. Compared to previous versions of InfluxDB you can think of a database as a `bucket`in v2 or as a `db/retention_policy`in v1. A `table` is equivalent to a `measurement`, which has columns that can be of type`tag` (a string dictionary), `int64`, `float64`, `uint64`, `bool`, or `string` and finally every table has a `time` column that is a nanosecond precision timestamp.
209
238
@@ -218,22 +247,43 @@ InfluxDB is a schema-on-write database. You can start writing data and InfluxDB
218
247
After a schema is created, InfluxDB validates future write requests against it before accepting the data.
219
248
Subsequent requests can add new fields on-the-fly, but can't add new tags.
220
249
221
-
The database has three write API endpoints that respond to HTTP `POST` requests:
250
+
{{% product-name %}} provides three write API endpoints that respond to HTTP `POST` requests:
251
+
252
+
#### /api/v3/write_lp endpoint
253
+
254
+
{{% product-name %}} adds the `/api/v3/write_lp` endpoint.
{{% product-name %}} provides the `/write` and `/api/v2/write` endpoints for backward compatibility with clients that can write data to previous versions of InfluxDB.
228
-
However, these APIs differ from the APIs in the previous versions in the following ways:
267
+
#### /write InfluxDB v1 compatibility endpoint
268
+
269
+
Provides backwards compatibility for clients that can write data to InfluxDB v1.x
Keep in mind that these compatibility APIs differ from the v1 and v2 APIs in previous versions in the following ways:
229
273
230
274
- Tags in a table (measurement) are _immutable_
231
275
- A tag and a field can't have the same name within a table.
232
276
233
-
{{% product-name %}} adds the `/api/v3/write_lp` endpoint, which accepts the same line protocol syntax as previous versions, and supports an `?accept_partial=<BOOLEAN>` parameter, which
234
-
lets you accept or reject partial writes (default is `true`).
277
+
#### Write line protocol
235
278
236
-
The following code block is an example of [line protocol](/influxdb3/core/reference/syntax/line-protocol/), which shows the table name followed by tags, which are an ordered, comma-separated list of key/value pairs where the values are strings, followed by a comma-separated list of key/value pairs that are the fields, and ending with an optional timestamp. The timestamp by default is a nanosecond epoch, but you can specify a different precision through the `precision` query parameter.
279
+
The following code block is an example of time series data in [line protocol](/influxdb3/core/reference/syntax/line-protocol/) syntax:
280
+
281
+
- `cpu`: the table name.
282
+
- `host`, `region`, `applications`: the tags. A tag set is an ordered, comma-separated list of key/value pairs where the values are strings.
283
+
- `val`, `usage_percent`, `status`: the fields. A field set is a comma-separated list of key/value pairs.
284
+
- timestamp: If you don't specify a timestamp, InfluxData uses the time when data is written.
285
+
The default precision is a nanosecond epoch.
286
+
To specify a different precision, pass the `precision` query parameter.
##### Example: write data using the /api/v3 HTTP API
306
+
253
307
The following examples show how to write data using `curl` and the `/api/3/write_lp` HTTP endpoint.
254
308
To show the difference between accepting and rejecting partial writes, line `2` in the example contains a `string` value for a `float` field (`temp=hi`).
255
309
256
-
##### Partial write of line protocol occurred
310
+
###### Partial write of line protocol occurred
257
311
258
312
With `accept_partial=true`:
259
313
@@ -279,7 +333,7 @@ With `accept_partial=true`:
279
333
Line `1` is written and queryable.
280
334
The response is an HTTP error (`400`) status, and the response body contains the error message `partial write of line protocol occurred` with details about the problem line.
281
335
282
-
##### Parsing failed for write_lp endpoint
336
+
###### Parsing failed for write_lp endpoint
283
337
284
338
With `accept_partial=false`:
285
339
@@ -310,7 +364,7 @@ The response is the following:
310
364
InfluxDB rejects all points in the batch.
311
365
The response is an HTTP error (`400`) status, and the response body contains `parsing failed for write_lp endpoint` and details about the problem line.
312
366
313
-
##### Data durability
367
+
#### Data durability
314
368
315
369
When you write data to InfluxDB, InfluxDB ingests the data and writes it to WAL files, created once per second, and to an in-memory queryable buffer.
316
370
Later, InfluxDB snapshots the WAL and persists the data into object storage as Parquet files.
@@ -319,10 +373,38 @@ For more information, see [diskless architecture](#diskless-architecture).
319
373
> [!Note]
320
374
> ##### Write requests return after WAL flush
321
375
>
322
-
> 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.
323
-
> Future enhancements will include an API parameter that lets requests return without waiting for the WAL flush.
376
+
> 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.
377
+
>
378
+
> To reduce the latency of writes, use the [`no_sync` write option](#no-sync-write-option), which acknowledges writes _before_ WAL persistence completes.
379
+
380
+
##### No sync write option
381
+
382
+
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.
383
+
384
+
Using `no_sync=true` is best when prioritizing high-throughput writes over absolute durability.
385
+
386
+
- 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.
387
+
- With `no_sync=true`: Reduces write latency, but increases the risk of data loss in case of a crash before WAL persistence.
388
+
389
+
###### Immediate write using the HTTP API
390
+
391
+
The `no_sync` parameter controls when writes are acknowledged--for example:
To create a database without writing data, use the `create` subcommand--for example:
328
410
@@ -672,7 +754,7 @@ To test a plugin, do the following:
672
754
673
755
1. Create a _plugin directory_--for example, `/path/to/.influxdb/plugins`
674
756
2. [Start the InfluxDB server](#start-influxdb) and include the `--plugin-dir <PATH>` option.
675
-
3. Save the [preceding example code](#example-python-plugin) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
757
+
3. Save the [preceding example code](#example-python-plugin-for-wal-flush) to a plugin file inside of the plugin directory. If you haven't yet written data to the table in the example, comment out the lines where it queries.
676
758
4. To run the test, enter the following command with the following options:
0 commit comments