skytable / skytable

Skytable is a modern scalable NoSQL database with BlueQL, designed for performance, scalability and flexibility. Skytable gives you spaces, models, data types, complex collections and more to build powerful experiences

Home Page:https://skytable.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Range queries

stevefan1999-personal opened this issue · comments

Description

Support range queries like TiKV: https://tikv.org/docs/dev/develop/rawkv/scan/

client.put(ByteString.copyFromUtf8("k1"), ByteString.copyFromUtf8("v1"));
client.put(ByteString.copyFromUtf8("k2"), ByteString.copyFromUtf8("v2"));
client.put(ByteString.copyFromUtf8("k3"), ByteString.copyFromUtf8("v3"));
client.put(ByteString.copyFromUtf8("k4"), ByteString.copyFromUtf8("v4"));

// scan with limit
int limit = 1000;
List<Kvrpcpb.KvPair> list = client.scan(ByteString.copyFromUtf8("k1"), ByteString.copyFromUtf8("k5"), limit);
for(Kvrpcpb.KvPair pair : list) {
    System.out.println(pair);
}
commented

Range queries will require a huge change in the fundamental data structures that we use. The one you see in the tree has already been replaced but even the new one that I've written (in the octave branch which isn't public yet) doesn't support ordered access.

I'm currently working on stabilizing the engine's implementation for octave. I think once we have a stable API is when we should revisit this. The issue is with efficient indexes for ordered accesses which matches the design goals of Skytable.

One more thing to note: it is actually fundamental that we support range queries since it is far too useful to ignore. Hence, we'll need to come back to this soon.