Skip to content

Json Compression #162

@neilh10

Description

@neilh10

This is a place holder for an idea for JSON compression - reducing the redundant data tracked in each message

Proposal
On startup a devices first POST has a full JSON string, and is validated as accepted by server.
Subsequent POST maintain security with TOKEN and "sampling_feature, and only serialize the data.

POST /api/data-stream/ HTTP/1.1
Host: data.enviroDIY.org
TOKEN: 5083cf3d-69cd-46fa-8d3a-0e3ba0b9e8fd
Content-Length: 416
Content-Type: application/json

{"sampling_feature":"939d54e3-b92f-4e8d-bae5-1a5b4ae29193"
,"timestamp":"2023-11-28T13:43:50-08:00"
,"6e5516fc-cdcf-46a6-9c30-d96f3a016b0d":1
,"fe4b74dd-598a-440d-b7d2-db0119584d5d"
:4.124,"5cbc0f3a-1b41-43cc-822f-374513de1899":-9999.00
,"41330794-27cf-4130-b2b0-a1cffefe8ba2":-9999.0000
,"941ba4ed-f7d5-4c71-8356-591899ec6e1a":41.22
,"d5f4c4dc-421d-436b-9989-99cb94ebc50a":20.53
,"ffdc5b73-b800-4957-ab19-b25feba69dde":-81
}

POST /api/data-stream/ HTTP/1.1
Host: data.enviroDIY.org
TOKEN: 5083cf3d-69cd-46fa-8d3a-0e3ba0b9e8fd
Content-Length: 128
Content-Type: application/json

{"sampling_feature":"939d54e3-b92f-4e8d-bae5-1a5b4ae29193",
"1": [
"2023-11-28T13:49:40-08:00",
1,
4.094,
-9999,
-9999,
43.96,
19.88,
-1
]
}

OR

POST /api/data-stream/ HTTP/1.1
Host: data.enviroDIY.org
TOKEN: 5083cf3d-69cd-46fa-8d3a-0e3ba0b9e8fd
Content-Length: 272
Content-Type: application/json

{"sampling_feature":"939d54e3-b92f-4e8d-bae5-1a5b4ae29193",
"1": [
"2023-11-28T13:49:40-08:00",
1,
4.094,
-9999,
-9999,
43.96,
19.88,
-1
],
"2": [
"2023-11-28T13:54:40-08:00",
1,
4.094,
-9999,
-9999,
43.96,
19.88,
-1
]
}

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions