Reputation: 13111
Currently evaluating InfluxDB and want to find out if serialized objects (e.g. using Java) can be stored / retrieved from InfluxDB and what is the process for it?
Upvotes: 0
Views: 817
Reputation: 140525
According to wikipedia, this database supports the following types of values:
Values can be 64-bit integers, 64-bit floating points, strings, and booleans.
You can serialize Java objects into byte streams; and byte streams can be represented as hex strings.
So, theoretically the answer is yes - it should be possible to store serialized Java objects in this database. To read back, you just reverse that process.
If that is a good idea is a completely different question. It sounds rather inefficient; and storing serialized objects is by itself not a great idea. First of all, it is a big detour - turn an object into a byte stream into a hex string (and reverse that). Then: java object serialization has is a beast of its own - you have to be carefully for example to not introduce version incompatibilities. It is really annoying when you release a new version of your Java code and that code throws an exception when you try to deserialize previously stored objects.
Therefore more modern approaches prefer to serialize into different formats (JSON for example), or use tools to translate fields directly to different table columns.
Upvotes: 1