https://slatedb.io logo
Thanks for the detailed response!
# general
w
Thanks for the detailed response! Ah, I didn't realise SSTable IDs are ULIDs with embedded timestamps - that's a really clever design choice. For convenience though, having the timestamp directly available on SsTableInfo would make it easier to work with versus extracting it from the ULID each time. For size, I meant bytes size - having that exposed on SsTableInfo would be perfect for tracking storage quotas and estimating costs. Got it on last_key being deduced from the next SSTable's first_key - that makes sense for non-overlapping SSTables. Having it directly available would save lookups, but the current approach works fine. The manifest-driven compaction scheduler is interesting. I was thinking more along the lines of event notifications (like "SSTable created at path X" or "SSTable deleted at path Y") for reactive workflows, but I can work with the manifest polling approach or look into implementing a custom scheduler if needed. RFC-13 is exactly what I was looking for on manual compaction - great timing! The progress tracking and state persistence stuff in there is really solid too. For context, I'm working on an embedded storage project with some specific constraints where SlateDB's architecture looks like a really good fit. I'm just trying to map out what's available versus what I'd need to extend. Happy to contribute implementations for features that make sense for the project.
r
Just adding some more color to what @almog 's already answered: > > multi-get. I don't think this is on the roadmap, but I like the idea! I don't see why we wouldn't support it There is a github issue for it, though I donโ€™t believe its currently being actively worked on: https://github.com/slatedb/slatedb/issues/301. But definitely something that would be useful to add! > The last_key is typically deduced from first_key of the next SST -- I think we use that in some places (I can try to dig up the code). UPDATE: can't find this code... maybe someone else can find it! This is the function that uses this to find what ssts in a sorted run cover a range: https://github.com/slatedb/slatedb/blob/9497944dfa4bd8bf94b272ab3453a9bca48343b4/slatedb/src/db_state.rs#L263 > Not sure about checksums/compression -- I need to double check that Currently there's just checksums at the block level. For compression you can configure the compression algorithm using the
compression_codec
field of the settings. You can't configure a specific zstd level though at the moment. Please file a gh issue if that's something you'd find useful. > For convenience though, having the timestamp directly available on SsTableInfo would make it easier to work with versus extracting it from the ULID each time Fair enough. I would add that it's quite easy to get to as the
Ulid
type in rust exposes it directly, via the
datetime
fn: https://docs.rs/ulid/latest/ulid/struct.Ulid.html#method.datetime > The manifest-driven compaction scheduler is interesting. I was thinking more along the lines of event notifications (like "SSTable created at path X" or "SSTable deleted at path Y") for reactive workflows, but I can work with the manifest polling approach FWIW this is intentional in the current design as the compactor is designed to be runnable from a separate process/node from the main db writer. So they only coordinate via the manifest.
Oh and for tracking the size of an SST, while it's not directly exposed in the metadata you can get a pretty close estimate by taking the index offset and adding the index len. That'll account for everything but the footer which is just a handful of bytes. There's an internal fn that does exactly this that the compactor uses to estimate the size of the sorted runs: https://github.com/slatedb/slatedb/blob/9497944dfa4bd8bf94b272ab3453a9bca48343b4/slatedb/src/db_state.rs#L160
c
Adding a link to a separate thread I started (didn't see this one): https://discord.com/channels/1232385660460204122/1445981885980344362
> having the timestamp directly available on SsTableInfo would make it easier to work with versus extracting it from the ULID each time Should be a good newbie PR. Wanna try? ๐Ÿ˜… > Oh and for tracking the size of an SST, while it's not directly exposed in the metadata you can get a pretty close estimate by taking the index offset and adding the index len We also have
SsTableHandle::esimated_size()
> Happy to contribute implementations for features that make sense for the project. ๐Ÿ”ฅ @William Would love contributions.