2

I'm using Orion to store context information and I'm interested to store binary data (Array of bytes) in the attributes. Is it possible in the current version (1.1.0)?

Thanks in advance.

ascatox
  • 51
  • 5

1 Answers1

0

The Short answer is no, it's not possible store binary data on version 1.1.0.

It's happens because Orion Context Broker uses a Restful API, all data are transported through text in XML format (very old versions) or JSON(latest version) and use MongoDB as storage enginer, MongoDB stores objects in a binary format called BSON. BinData is a BSON data type for a binary byte array. However, MongoDB objects are typically limited to 4MB in size. To deal with this, files are “chunked” into multiple objects that are less than 4MB each. This has the added advantage of letting us efficiently retrieve a specific range of the given file. But BSON data is not supported by Orion, and certainly will do not because Orion Context Broker was not designed to store store binary data.

You can use some alternatives:

  • Use a separate file server and reference it by URL or another server side technology, you can also use other Fiware GE's like CKAN or ObjectStorage for example
  • Convert binary data to hexadecimal, then it will be on a AlphaNumeric data, and on receive you can convert it back to binary data. There is some examples in Python, PHP, Java and C++ how to manipulate binary as hexadecimal.
Community
  • 1
  • 1
LeonanCarvalho
  • 1,819
  • 3
  • 20
  • 39