Hi! I just stumbled across datalevin when I was researching kv databases and was impressed! Trying to figure out some design principles and wondering -- just how many tables can be open at once using open-dbi? If, for example, I wanted each "event stream" to be modeled as its own table, and users could create their own arbitrary event stream, would I hit any unexpected limits?
Also, since there is no with-open-dbi I'd have to open them all and leave them open. Is that accurate?
Sorry for the newbie questions. 🙂
I'm also happy to have a single table and figure out some kind of compound key structure, but the feature seemed too good to be true so I figured I'd ask!
Thanks for the advice!
• how many tables: set when open-kv with option :max-dbs, default is 128. Keep in mind that dbis are search in a linear order, so you don't want to have too many of them.
correct, keep open-dbi open is fine.
also, no need to close them either
compound key is supported, you can use tuples, basically, [k1 k2 k3...] as long as the total length of these keys are not over the key size limit, which is 511 bytes.
the tuple keys could be of the same type (homogeneous tuple), or different type (heterogeneous tuple).
https://cljdoc.org/d/datalevin/datalevin/0.9.18/api/datalevin.core#put-buffer
no single tuple key can be longer than 255 bytes though