akumuli-datasource icon indicating copy to clipboard operation
akumuli-datasource copied to clipboard

Writing data: Dictionary update?

Open smurfix opened this issue 4 years ago • 2 comments

When writing data, "The dictionary can only be sent in the beginning of the TCP session."

My problem: I don't know in advance which items I'm about to send to Akumuli, and I don't want to re-open the connections (it's a high-bandwidth / high-latency link to a backup data center). Thus, could that restriction be relaxed?

smurfix avatar Sep 24 '19 12:09 smurfix

It's not possible to do without breaking the bulk-load protocol. You don't really have to reconnect every time you need to send something new. If you have a new metric you can just send it as usual. You can interleave normal messages (+series-name\n+timestamp\n+value\n..) with dictionary based messages (:dictionaryid\n+timestamp\n+value\n...) and bulk-messages (+compound-series-name\n*N-items\n+value1\n+value2\n...\n+valueN\n...) in one stream.

But it's possible to do this: start with small dictionary, every time you have to send a new series you can just send it using normal messages and when number of non-dictionary messages in the stream exceeds some threshold you can re-establish connection using larger dictionary. You can continue using your old connection until new connection established and new dictionary is sent.

Lazin avatar Sep 24 '19 14:09 Lazin

Right, something along these lines was my plan too. But a protocol that allows incremental dictionary updates would be even better.

smurfix avatar Sep 24 '19 15:09 smurfix