We're using some custom Python code to build a Marisa Trie as our index. I was wondering if there were alternatives to this set up?
We're using some custom Python code to build a Marisa Trie as our index. I was wondering if there were alternatives to this set up?
What do you mean by search ? Full-text-search ? Do you need to run custom code on the original data ?
> A solution we came up with was a small , hot, in memory index, that points to the location of the data in a file on S3.
Yes, it's like keeping the block-index of a sstable (in rocksdb) in-memory. The next step is to have a local cache on the ec2 node. And the next step one is to have a "distributed" cache on your ec2 nodes, so you don't query S3 for a chunk if it's present in any of your other nodes.
Come to think of it, I searched and didn't find a "distributed disk cache with optional replication" that can be used in front of S3 or whatever dataset. You can use nginx/varnish as a reverse-proxy but it doesn't have "distributed". There is Alluxio, but it's single-master.
Search maybe is too strong a word - "lookup" is probably more correct. I have a couple of identifiers for each document, from which I want to retrieve the full doc.
I'm not sure what you mean by running custom code on the data. I usually do some kind of transformation afterwards.
I didn't find anything either, which is why I was wondering if I was searching for the wrong thing.
If you think more about this, it will be like distributed key value store with support both disk and memory access. You can write one using some opensource Raft libraries, or a possible candidate is Tikv from PingCap
My whole point was not building it ;)
There's also https://github.com/NVIDIA/aistore
I first thought of building a custom index structure, but found that I did not need everything in memory all the time. Using an embedded leveldb works just fine.
Because the crux of S3 is the latency you can also decide to encode the docs in blocks, and retrieve more data than is actually needed.
For this demo, the index from DocID to offset in S3 takes 1.2 bytes per doc. For a log corpus, we end up with 0.2 bytes per doc.
For your usecase it'll be very cheap if you don't access it constantly (you can probably get away with the extra small instances, which you are billed per minute).
Not affiliated in anyway, just a suggestion.
[1] https://guides.rubyonrails.org/active_storage_overview.html