https://slatedb.io logo
Any discussions or material around
# general
d
Any discussions or material around setting up partitioned/distributed readers? Mainly curious about how to achieve a set of serving compute that holds everything in memory and scales with both cpu load (ie more copies of the data getting high load) and memory (ie growing data set without manually increasing the node counts).
c
Hi! Yep, we've talked about this a few times in the discord. Lemme dig up some threads.
tl;dr SlateDB itself doesn't have the concept of partitions. It's just a single writer, multi-reader setup. The readers can be in the same process or separate processes on any machine (using
DbReader
). The separate process/machine readers re-sync the data periodically so they see eventually consistent data. To keep all data in memory, you could create N DbReaders spread across M nodes. Each DbReader could be assigned a range of they keyspace. When a read comes into your system, you determine which DbReader to fetch from. In doing so, that value is stored in cache. As long as the working set of each prefix range remains smaller than available memory on the node, you will end up with all your data in memory. (Things get more complicated if you want to do a scan() that spans prefix ranges.) If you want to pre-warm the in-memory cache on each DbReader, you would need to do that yourself by calling get or scan.