Go to file
Michael Gattozzi b555ddf18b
feat: Add different output support to queries (#24616)
This commit adds the ability to choose the output format of a query via
the v3 api so that a user can choose, whether by Accept headers or the
format url param, how the data will be returned to them.

Prior to this commit the default was a pretty printed text format, but
that instead has been changed to json as the default.

There are multiple formats one can choose:

1. json
2. csv
3. pretty printed text
4. parquet

I've tested each of these out and it works well. In particular the
parquet output is exciting as users will be able to perform a query and
receive back parquet data that they can then load into say a Python
script or something else to work on and operate it. As we extend what
data can be queried, as well as persisting it, what people will be able
to do with Edge will be really cool and I'm interested to see how users
will end up using this functionality in the future.
2024-02-12 12:04:05 -05:00
.cargo chore: don't doc behind tokio_unstable flags 2023-07-03 15:42:35 +02:00
.circleci fix: Remove nightly CI build from Circle CI runs (#24637) 2024-02-12 10:21:15 -05:00
.config fix: garbage_collector no longer uses chrono-english so it can use the workspace hack crate 2023-05-01 11:31:42 -04:00
.github docs: rename influxdb_iox to influxdata (#24577) 2024-01-16 13:34:23 -05:00
arrow_util chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
authz chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
backoff chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
cache_system chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
catalog_cache chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
clap_blocks chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
client_util chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
data_types chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
datafusion_util chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
dml chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
docker feat: remove everything to make way for 3.0, the last database rewrite you'll ever need. 2023-09-21 09:03:38 -04:00
docs chore(doc): fix typo (#8398) 2023-08-02 20:33:32 +00:00
executor chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
flightsql chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
garbage_collector chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
generated_types chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
grpc-binary-logger chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
grpc-binary-logger-proto chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
grpc-binary-logger-test-proto chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
import_export chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
influxdb2_client chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
influxdb3 feat: add basic wal implementation for Edge (#24570) 2024-01-12 11:52:28 -05:00
influxdb3_server feat: Add different output support to queries (#24616) 2024-02-12 12:04:05 -05:00
influxdb3_write chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
influxdb_influxql_parser chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
influxdb_iox_client chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
influxdb_line_protocol chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
influxdb_storage_client chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
influxdb_tsm feat: Upgrade to Rust 1.72.0 (#8589) 2023-08-29 05:57:38 +00:00
influxrpc_parser chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
ingester_query_grpc chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
iox_catalog chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
iox_data_generator chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
iox_query chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
iox_query_influxql chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
iox_query_influxrpc chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
iox_query_params chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
iox_tests chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
iox_time chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
ioxd_common chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
ioxd_test chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
kube_test chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
logfmt chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
metric chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
metric_exporters chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
mutable_batch chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
mutable_batch_lp chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
mutable_batch_pb chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
mutable_batch_tests chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
object_store_metrics chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
observability_deps chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
panic_logging chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
parquet_cache chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
parquet_file chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
parquet_to_line_protocol chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
partition chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
predicate chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
query_functions chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
schema chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
scripts feat: remove everything to make way for 3.0, the last database rewrite you'll ever need. 2023-09-21 09:03:38 -04:00
service_common chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
service_grpc_flight chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
service_grpc_testing chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
sharder chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
sqlx-hotswap-pool chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
test_fixtures chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
test_helpers chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
test_helpers_end_to_end chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
tokio_metrics_bridge chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
tokio_watchdog chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
tools feat: remove everything to make way for 3.0, the last database rewrite you'll ever need. 2023-09-21 09:03:38 -04:00
tower_trailer chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
trace chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
trace_exporters chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
trace_http chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
tracker chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
trogging chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
wal chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
wal_inspect chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
workspace-hack chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
.editorconfig chore: editor config spacing for shell scripts 2022-12-13 11:12:11 +01:00
.gitattributes feat: implement jaeger-agent protocol directly (#2607) 2021-09-22 17:30:37 +00:00
.gitignore chore: gitignore pending insta snapshots (#6923) 2023-02-09 10:47:29 +00:00
.kodiak.toml chore: Set default to squash 2022-01-25 15:57:10 +01:00
.yamllint.yml ci: run yamllint 2021-11-29 15:11:15 +01:00
CONTRIBUTING.md docs: rename influxdb_iox to influxdata (#24577) 2024-01-16 13:34:23 -05:00
Cargo.lock feat: Add different output support to queries (#24616) 2024-02-12 12:04:05 -05:00
Cargo.toml chore(deps): Update arrow and datafusion to 49.0.0 (#24605) 2024-01-31 19:18:51 -05:00
Dockerfile fix: set Dockerfile to build influxdb3 not IOx (#24563) 2024-01-09 15:19:21 -05:00
Dockerfile.dockerignore fix: do not exclude cargo configs in docker build (#8054) 2023-06-22 14:31:02 +00:00
LICENSE-APACHE fix: Add LICENSE (#430) 2020-11-10 12:10:07 -05:00
LICENSE-MIT fix: Add LICENSE (#430) 2020-11-10 12:10:07 -05:00
README.md chore: Update README.md (#24379) 2023-09-26 09:59:23 -04:00
buf.yaml chore: apply proto lints to ingester->query gRPC 2023-09-01 13:03:11 +02:00
deny.toml chore: upgrade to sqlx 0.7.1 (#8266) 2023-07-19 12:18:57 +00:00
integration-docker-compose.yml fix: Remove uses of KAFKA_CONNECT, redpanda, and some talk of Kafka 2023-04-12 11:53:23 -04:00
rust-toolchain.toml fix: add rust-analyzer to toolchain file (#24636) 2024-02-06 16:04:03 -05:00
rustfmt.toml chore: use Rust edition 2021 2021-10-25 10:58:20 +02:00

README.md

InfluxDB Edge

[!NOTE] On 2023-09-21 this repo changed the default branch from master to main. At the same time, we moved all InfluxDB 2.x development into the main-2.x branch. If you relied on the 2.x codebase in the former master branch, update your tooling to point to main-2.x, which is the new home for any future InfluxDB 2.x development. This branch (main) is now the default branch for this repo and is for development of InfluxDB 3.x.

For now, this means that InfluxDB 3.0 and its upstream dependencies are the focus of our open source efforts. We continue to support both the 1.x and 2.x versions of InfluxDB for our customers, but our new development efforts are now focused on 3.x. The remainder of this readme has more details on 3.0 and what you can expect.

InfluxDB is an open source time series database written in Rust, using Apache Arrow, Apache Parquet, and Apache DataFusion as its foundational building blocks. This latest version (3.x) of InfluxDB focuses on providing a real-time buffer for observational data of all kinds (metrics, events, logs, traces, etc.) that is queryable via SQL or InfluxQL, and persisted in bulk to object storage as Parquet files, which other third-party systems can then use. It is able to run either with a write ahead log or completely off object storage if the write ahead log is disabled (in this mode of operation there is a potential window of data loss for any data buffered that has not yet been persisted to object store).

The open source project runs as a standalone system in a single process. If you're looking for a clustered, distributed time series database with a bunch of enterprise security features, we have a commercial offering available as a managed hosted service or as on-premise software designed to run inside Kubernetes. The distributed version also includes functionality to reorganize the files in object storage for optimal query performance. In the future, we intend to have a commercial version of the single server software that adds fine-grained security, federated query capabilities, file reorganization for query optimization and deletes, and integration with other systems.

Project Status

Currently this project is under active prototype development without documentation or official builds. This README will be updated with getting started details and links to docs when the time comes.

Roadmap

The scope of this open source InfluxDB 3.0 is different from either InfluxDB 1.x or 2.x. This may change over time, but for now here are the basics of what we have planned:

  • InfluxDB 1.x and 2.x HTTP write API (supporting Line Protocol)
  • InfluxDB 1.x HTTP query API (InfluxQL)
  • Flight SQL (query API using SQL)
  • InfluxQL over Flight
  • Data migration tooling for InfluxDB 1.x & 2.x to 3.0
  • InfluxDB 3.0 HTTP write API (a new way to write data with a more expressive data model than 1.x or 2.x)
  • InfluxDB 3.0 HTTP query API (send InfluxQL or SQL queries as an HTTP GET and get back JSON lines, CSV, or pretty print response)
  • Persist event stream (subscribe to the Parquet file persist events, useful for downstream clients to pick up files from object store)
  • Embedded VM (either Python, Javascript, WASM, or some combination thereof)
    • Individual queries
    • Triggers on write
    • On persist (run whatever is being persisted through script)
    • On schedule
  • Bearer token authentication (all or nothing, token is set at startup through env variable, more fine-grained security is outside the scope of the open source effort)

What this means is that InfluxDB 3.0 can be pointed to as though it is an InfluxDB 1.x server with most of the functionality present. For InfluxDB 2.x users that primarily interact with the database through the InfluxQL query capability, they will also be able to use this database in a similar way. Version 3.0 will not be implementing the rest of the 2.x API natively, although there could be separate processes that could be added on at some later date that would provide that functionality.

Flux

Flux is the custom scripting and query language we developed as part of our effort on InfluxDB 2.0. While we will continue to support Flux for our customers, it is noticeably absent from the description of InfluxDB 3.0. Written in Go, we built Flux hoping it would get broad adoption and empower users to do things with the database that were previously impossible. While we delivered a powerful new way to work with time series data, many users found Flux to be an adoption blocker for the database.

We spent years of developer effort on Flux starting in 2018 with a small team of developers. However, the size of the effort, including creating a new language, VM, query planner, parser, optimizer and execution engine, was significant. We ultimately werent able to devote the kind of attention we would have liked to more language features, tooling, and overall usability and developer experience. We worked constantly on performance, but because we were building everything from scratch, all the effort was solely on the shoulders of our small team. We think this ultimately kept us from working on the kinds of usability improvements that would have helped Flux get broader adoption.

For InfluxDB 3.0 we adopted Apache Arrow DataFusion, an existing query parser, planner, and executor as our core engine. That was in mid-2020, and over the course of the last three years, there have been significant contributions from an active and growing community. While we remain major contributors to the project, it is continuously getting feature enhancements and performance improvements from a worldwide pool of developers. Our efforts on the Flux implementation would simply not be able to keep pace with the much larger group of DataFusion developers.

With InfluxDB 3.0 being a ground-up rewrite of the database in a new language (from Go to Rust), we werent able to bring the Flux implementation along. For InfluxQL we were able to support it natively by writing a language parser in Rust and then converting InfluxQL queries into logical plans that our new native query engine, Apache Arrow DataFusion, can understand and process. We also had to add new capabilities to the query engine to support some of the time series queries that InfluxQL enables. This is an effort that took a little over a year and is still ongoing. This approach means that the contributions to DataFusion become improvements to InfluxQL as well given it is the underlying engine.

Initially, our plan to support Flux in 3.0 was to do so through a lower level API that the database would provide. In our Cloud2 product, Flux processes connect to the InfluxDB 1 & 2 TSM storage engine through a gRPC API. We built support for this in InfluxDB 3.0 and started testing with mirrored production workloads. We quickly found that this interface performed poorly and had unforeseen bugs, eliminating it as a viable option for Flux users to bring their scripts over to 3.0. This is due to the API being designed around the TSM storage engines very specific format, which the 3.0 engine is unable to serve up as quickly.

Well continue to support Flux for our users and customers. But given Flux is a scripting language in addition to being a query language, planner, optimizer, and execution engine, a Rust-native version of it is likely out of reach. And because the surface area of the language is so large, such an effort would be unlikely to yield a version that is compatible enough to run existing Flux queries without modification or rewrites, which would eliminate the point of the effort to begin with.

For Flux to have a path forward, we believe the best plan is to update the core engine so that it can use Flight SQL to talk to InfluxDB 3.0. This would make an architecture where independent processes that serve the InfluxDB 2.x query API (i.e. Flux) would be able to convert whatever portion of a Flux script that is a query into a SQL query that gets sent to the InfluxDB 3.0 process with the result being post-processed by the Flux engine.

This is likely not a small effort as the Flux engine is built around InfluxDB 2.0's TSM storage engine and the representation of all data as individual time series. InfluxDB 3.0 doesn't keep a concept of series so the SQL query would either have to do a bunch of work to return individual series, or the Flux engine would do work with the resulting query response to construct the series. For the moment, were focused on improvements to the core SQL and (and by extension InfluxQL) query engine and experience both in InfluxDB 3.0 and DataFusion.

We may come back to this effort in the future, but we dont want to stop the community from self-organizing an effort to bring Flux forward. The Flux runtime and language exists as permissively licensed open source here. We've also created a community fork of Flux where the community can self-organize and move development forward without requiring our code review process. There are already a few community members working on this potential path forward. If you're interested in helping with this effort, please speak up on this tracked issue.

We realize that Flux still has an enthusiastic, if small, user base and wed like to figure out the best path forward for these users. For now, with our limited resources, we think focusing our efforts on improvements to Apache Arrow DataFusion and InfluxDB 3.0s usage of it is the best way to serve our users that are willing to convert to either InfluxQL or SQL. In the meantime, well continue to maintain Flux with security and critical fixes for our users and customers.