https://slatedb.io logo
I was prototyping something where I
# general
a
I was prototyping something where I needed API key distribution and I had a little thought experiment to think about how slate could be adapted to fit the use case. API key distribution works really well with the single-writer many readers and people are typically OK with a bit of time for API key propagation to happen. I also like that it's basically fully cached on the local disk so API key lookups don't need to make any remote calls. The obvious problem is that there's a really low write rate, which means that we'd need to flush to L0 aggressively and have tons of small files. That seems like a problem that comes up a lot with Slate (e.g. use cases that don't use the WAL don't auto-flush, I think that' was being discussed elsewhere). Curious if anyone had thoughts around that. (For the curious, I'll probably just go with postgres)
c
Yea, this is very similar to what came up here: https://discord.com/channels/1232385660460204122/1394912794494894080
IMO, this specific use case will be OK once we expose a compact()
The issue is not the small files, since write throughput is _very_low
It's just that the l0 gets plugged up, so you need to increase max l0 ssts
I already added
flush_with_options
to allow users to flush memtables directly at will
So if you could do
flush_with_options
to force a memtable flush when an API key is written, then
.compact()
to trigger a compaction to get it moved into L1, I think that's kinda the best you can do.
The other alternative would be to enable WAL. IIRC, DbReader refreshes from the WAL. So then you just write the key and flush.
Why does this use case require no WAL--just curious?
p
Is that a issue that manifests in cases where opening a Db is very short lived?
(I am trying to understand what is the problem at all)
a
Ah I didn't realize DbReader refreshes from the WAL, so that would work as well. I guess there's no reason why it wouldn't, I'm not sure why I thought it wouldn't
I was also worried about what Pierre mentioned, I wasn't totally sure how I would spin up the writer without flushing a new manifest for every write (not that my previous concern is related directly to that)