简体   繁体   English

Thrift,Protobuf,Avro等是否支持直接对编码数据进行查询?

[英]Do any of thrift, protobuf, avro, etc support quering on encoded data directly?

Do any of thrift, protobuf, avro, etc support quering on the resulting compact data? 节俭,protobuf,avro等是否支持对生成的压缩数据进行查询? Or would something like a thrift-server first have to de-encode the compact data before being able to query it? 还是像节俭服务器之类的东西首先必须对紧凑型数据进行解编码才能查询它?

background: since there might be an entirely different answer to my usecase I'm not seeing. 背景:由于我看不到用例的答案可能完全不同。

I've sketched out a custom datastructure on paper (akin to a trie ), which will contain tens/hundreds of millions of key-value pairs. 我已经在纸上绘制了一个自定义数据结构(类似于trie ),其中将包含数以亿计的键值对。 The whole stuff needs to be in RAM so it needs to be compact. 整个东西都需要放在RAM中,因此它必须紧凑。

For this reason I'm probably skipping the normal kv-stores, since there's just too much overhead in encoding. 出于这个原因,我可能会跳过常规的kv存储,因为编码的开销太大了。 They can't optimize for the specicialized case of the structure. 他们无法针对结构的特殊情况进行优化。 (Redis has the least overhead per key afaik but it isn't enough: 100+ bytes per key) (Redis的每个键afaik的开销最少,但这还不够:每个键100+个字节)

I've looked into Thrift , Protobuf , Avro , Messagepack , which will all allow me to encode the data to a nice compact structure all taking care of the specific opportunities of my datastructure (encoding keys as 1 or 2 bytes, bitpacking, values are fixed length, etc.) 我研究了ThriftProtobufAvroMessagepack ,这些都将使我能够将数据编码为一个不错的紧凑结构,同时照顾到我数据结构的特殊机会(将密钥编码为1或2个字节,位打包,值为固定长度等)

However, It's completely unclear to me if any of these protocols/techniques will allow me to query on the compacted datastructure as is, or if the data-structure has to be de-encode before quering? 但是,对于这些协议/技术中的任何一种是否可以让我按原样查询压缩的数据结构,或者在查询之前是否必须对数据结构进行解码,我完全不清楚。 If the latter, well than this whole exercise hasn't been of much use to me. 如果是后者,那对我来说没有比整个练习有用的多了。

As an alternative, I've thought of looking at other programming languages (c/c++ probably although I've never dabbled with it) that probably would allow me to have very tight memory control over structs (As opposed to Node/javascript which is extremely bad with that) 作为一种选择,我想过要考虑其他编程语言(虽然我从未涉足过c / c ++),但可能会允许我对结构进行非常严格的内存控制(而不是Node / javascript。对此非常糟糕)

Anyone? 任何人?

它们需要解码才能查询

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 c 或 c++ 中是否有任何头文件来实现图形、树等数据结构? - Is there any header file in c or c++ to implement data structures like graph,trees etc? Java 上是否有任何堆外无锁数据结构(列表、集合、映射等)? - Is there any off-heap lock-free data structure (list, set, map etc..) on Java? 可直接访问的数据结构Java - Directly accessible data structure Java 即使使用列表/数组实现数据结构,如图形,树等,如何获得其时间复杂性和行为? - How do data structures like graphs, trees etc. derive their time complexities and behaviour even though they are implemented using lists/arrays? 有没有办法强制在 NSArray、NSMutableArray 等上打字? - Is there any way to enforce typing on NSArray, NSMutableArray, etc.? 在这种情况下保存数据的结构(Hashmap/ArrayList 等)? - structure for holding data in this instance (Hashmap/ArrayList etc)? 在ruby中优雅地处理数据结构(哈希等) - handling data structures (hashes etc) gracefully in ruby 比较 2 个 CSV 文件(编码 =“utf8”)保持数据格式 - Compare 2 CSV files (encoded = "utf8") keeping data format 用于数据库复制支持的数据结构设计 - Data structure design for database replication support 支持记分牌最佳操作的数据结构 - Data structure to support optimal operations for a scoreboard
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM