Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
T

timefusion

> 编程语言
Open source

A timeseries database created for events, logs, traces and metrics. Speaks the postgres dialect, and stores data in s3 via delta lake protocol

182 stars0 likes0 views
WebsiteGitHub

About

A timeseries database created for events, logs, traces and metrics. Speaks the postgres dialect, and stores data in s3 via delta lake protocol

TimeFusion

TimeFusion stores observability data — logs, traces, metrics, and events — as Delta Lake tables on your own S3-compatible object storage, and lets you query it over the PostgreSQL wire protocol. It uses Apache DataFusion for query execution and a write-ahead log + in-memory buffer for sub-second write durability.

If you already have a Postgres client, you already have a TimeFusion client.

Status: Pre-1.0. TimeFusion runs in production at APIToolkit, but the schema, wire behavior, and configuration surface can still change between releases — pin a version before depending on it. (The version a client sees via SHOW server_version reflects the embedded PostgreSQL-protocol layer, not TimeFusion's own.)

Contents

  • Why TimeFusion
  • How it works
  • Quick start
  • Querying
  • Configuration
  • Performance
  • Development
  • License

Why TimeFusion

  • Your data stays in your bucket. Storage is plain Parquet under a Delta Lake transaction log in your own S3 / MinIO / R2 bucket. No proprietary format, no vendor storage to pay for, nothing to migrate out of.
  • Postgres wire protocol. Connect with psql, any Postgres driver, or existing BI/observability tooling. No new client to learn.
  • Columnar analytics. DataFusion executes vectorized SQL with predicate pushdown and partition pruning over Parquet.
  • Durable, low-latency writes. Inserts hit a write-ahead log and an in-memory buffer before being flushed to Delta in the background, so writes are acknowledged quickly without losing durability.
  • Multi-tenant by design. Data is partitioned and isolated by project_id, with shared tables for default projects and dedicated tables for projects that need isolation.

How it works

 Postgres client ──▶ pgwire ──▶ DataFusion query engine
 (psql, drivers)                      │
                                      ▼
              ┌───────────── write path ─────────────┐
              │  WAL (durable) ─▶ in-memory buffer    │
              │            │ flush every ~10 min       │
              │            ▼                            │
              │      Delta Lake (Parquet) on S3        │
              └────────────────────────────────────────┘
                                      ▲
                          Foyer cache (memory + disk)
  • Write: INSERT → WAL append (durable) → in-memory buffer (fast ack). Completed time buckets flush to Delta in the background.
  • Read: queries union the in-memory buffer with Delta on S3, so recently written rows are visible immediately.

Single-writer WAL. Exactly one TimeFusion process may run against a given WAL directory. Startup takes an exclusive flock on the WAL dir to enforce this; a second process waits (serving 57P03) until the first exits. Keep the readiness probe a plain TCP check on the pgwire port so rolling deploys hand off cleanly. See docs/WAL.md and RUNBOOK.md for deploy guidance.

Storage layout: events are written to a Delta table such as otel_logs_and_spans, partitioned by [project_id, date]. Table schemas live in schemas/ and are loaded at startup.

Queries must filter on project_id — it is the tenancy and partition key. Queries without it scan across tenants and are far slower.

Quick start

Try it locally (zero config)

The bundled Compose stack runs TimeFusion against a local MinIO — no AWS account or credentials needed. It builds the image, starts MinIO, creates the bucket, and launches TimeFusion on port 5432:

bash
git clone https://github.com/monoscope-tech/timefusion.git
cd timefusion
docker compose up

Then connect from another terminal — skip to Connect.

Run against your own S3

Images are published per commit to GitHub Container Registry, tagged with the git short SHA (see the packages page for available tags):

bash
docker run -d -p 5432:5432 \
  -e AWS_S3_BUCKET=your-bucket \
  -e AWS_ACCESS_KEY_ID=your-key \
  -e AWS_SECRET_ACCESS_KEY=your-secret \
  ghcr.io/monoscope-tech/timefusion:

Build from source

Requires a recent stable Rust toolchain (edition 2024 → Rust 1.85+).

bash
git clone https://github.com/monoscope-tech/timefusion.git
cd timefusion
cargo build --release
AWS_S3_BUCKET=your-bucket ./target/release/timefusion

Connect

bash
psql "postgresql://postgres:postgres@localhost:5432/postgres"

Insert and query

sql
INSERT INTO otel_logs_and_spans (name, id, project_id, timestamp, date, hashes)
VALUES ('api.request', '550e8400-e29b-41d4-a716-446655440000',
        'prod-api-001', '2025-01-17 14:25:00', '2025-01-17', ARRAY[]::text[]);

SELECT name, COUNT(*) AS count
FROM otel_logs_and_spans
WHERE project_id = 'prod-api-001' AND date = '2025-01-17'
GROUP BY name
ORDER BY count DESC;

Querying

TimeFusion speaks analytical SQL: aggregations, window functions, PERCENTILE_CONT, FILTER, CTEs, and a TimescaleDB-compatible time_bucket. Here's finding slow API endpoints from trace data:

sql
SELECT name AS endpoint,
       COUNT(*)                       AS request_count,
       AVG(duration / 1000000)::INT   AS avg_duration_ms,
       MAX(duration / 1000000)::INT   AS max_duration_ms
FROM otel_logs_and_spans
WHERE project_id = 'prod-api-001'
  AND timestamp >= '2025-01-17 14:00:00' AND timestamp  1000000000          -- 1 second, in nanoseconds
GROUP BY name
ORDER BY avg_duration_ms DESC;
         endpoint        | request_count | avg_duration_ms | max_duration_ms
-------------------------+---------------+-----------------+-----------------
 POST /api/v1/payments   |             1 |            3421 |            3421
 GET /api/v1/users/:id   |             1 |            2100 |            2100
 POST /api/v1/users      |             1 |            1523 |            1523

More query examples — error rates, trace lookup, time-bucketed aggregation, moving averages

…

bash git clone https://github.com/monoscope-tech/timefusion.git cd timefusion

Start MinIO only, then run TimeFusion from source against it

docker compose up -d minio createbucket export AWS_S3_BUCKET=timefusion
AWS_S3_ENDPOINT=http://localhost:9000
AWS_ALLOW_HTTP=true
AWS_ACCESS_KEY_ID=minioadmin
AWS_SECRET_ACCESS_KEY=minioadmin cargo run


**Tests:**

```bash
make test                           # the whole suite in one parallel run (~74s)
cargo nextest run        # one test or one .slt file, e.g. `dedup_compaction`
cargo nextest run --lib             # unit tests only
make test-e2e                       # end-to-end (Docker required; testcontainers MinIO)
RUST_LOG=debug cargo nextest run --no-capture   # with debug logging

Tests run under [cargo-nextest](https://nexte.st) (one process per test).
Install: `curl -LsSf https://get.nexte.st/latest/mac | tar zxf - -C ~/.cargo/bin`.

Faster local builds (macOS arm64): .cargo/config.toml links with ld64.lld instead of the system linker, and [profile.dev] uses debug = "line-tables-only" — together these roughly halve the warm recompile of the large database.rs crate (~22s → ~12s). This requires ld64.lld on disk:

bash
brew install llvm@15   # provides /opt/homebrew/opt/llvm@15/bin/ld64.lld

…

bash
make ci-signoff    # local checks, published results, then remaining remote checks
make ci-status     # what CI would run right now, without running it

Contributions are welcome — see CONTRIBUTING.md.

License

MIT — see LICENSE.

Built with

Apache DataFusion · Delta Lake · Apache Arrow · pgwire · Foyer

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Rust

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言