nqminds / nqm-iot-database-py

nqm-iot-database-py
https://nqminds.github.io/nqm-iot-database-py/
0 stars 0 forks source link

Add Compressed B64 NDArray #15

Closed aloisklink closed 5 years ago

aloisklink commented 5 years ago

Adds two new dataformats to NDArray.

Data version Data Pointer
"B" Base64 String
"G" Base64 of Gzipped Array

Example:

ndarray = {
  v = "B",
  // yes this is a valid b64 string, makes:
  // array([43885, 60190, 44175, 47286, 33703, 25067, 57194, 45986, 42982,
  //        43769, 27627, 30253], dtype=uint16)
  p = "base64+string+that+is+an+array12", 
  s = [12],
  c = true, //c-order
  t = "u2", //unsigned 2-byte int
}

This allows arrays to be stored in the database even without an underlying filesystem in the background. This will most likely be faster for small arrays (and will allow us to send arrays over pure JSON, ie for HTTP RESTful requests).