Skip to content

Add RFC for low-level timseries write API - #16

Merged
hachikuji merged 3 commits into
mainfrom
timeseries-write-rfc
Dec 19, 2025
Merged

Add RFC for low-level timseries write API#16
hachikuji merged 3 commits into
mainfrom
timeseries-write-rfc

Conversation

@hachikuji

@hachikuji hachikuji commented Dec 19, 2025

Copy link
Copy Markdown
Contributor

This RFC proposes a low-level TimeSeries API which is analogous to SlateDb's Db and OpenData's Log. The idea is to have a simple, permissive low-level API with all the complexity from systems like OTEL and Prometheus layered on top. I started with the write API because that is relatively simple compared to the read side.

I am hoping that each of our systems can expose similar low-level API with conventions and semantics which are roughly inline with SlateDb itself. Basically it should look and feel like SlateDb, but with a custom data model. We can then add APIs which cross-cut each system in higher-level traits. For example, we would probably introduce some trait to expose SlateDb's underlying checkpoint system.

@agavra agavra left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thanks @hachikuji! No serious comments or concerns. Only question around await_durable and whether that's necessary for timeseries ingestion.

Comment thread timeseries/rfcs/0002-write-api.md Outdated
pub struct WriteOptions {
/// Wait for data to be flushed to durable storage before returning.
/// Default: false (return immediately after buffering)
pub await_durable: bool,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious if we need this for timeseries data - right now it's not super straightforward to get a handler to await durable with the batching mechanism I implemented. It would complicate the code with some annoying async book-keeping.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see the harm exposing it at the lower level. I think our default would just be false.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps some users would want to write billing telemetry at this level and might like a strong guarantee.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fair - I think we can eventually support it. Maybe we'll wait to implement it until we have slatedb-wal factored out or a pluggable slate memtable so that we don't need to handle the synchronization between the buffer and slate's await_durable mechanism ourselves (it was a bit of a pain in slatedb to handle that and i really don't want to custom implement it if we can avoid it).

Comment thread timeseries/rfcs/0002-write-api.md
Comment thread timeseries/rfcs/0002-write-api.md Outdated

@apurvam apurvam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! I like the principles laid out, and the RFC exemplifies them well.

@hachikuji
hachikuji merged commit 84b67ab into main Dec 19, 2025
1 check passed
@hachikuji
hachikuji deleted the timeseries-write-rfc branch December 19, 2025 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants