I'm working on reducing the size of my database records. Each record is on average around 5Kb of which 97% is used by an single array property.
This array describe object on an image and their bounding box, described as a series of points:
[
{
"s": 0,
"e": 6,
"w": "Ihandle",
"b": [
{ "x": 0.08816705336426914, "y": 0.1531684174855981 },
{ "x": 0.2523201856148492, "y": 0.15249068112504235 },
{ "x": 0.2523201856148492, "y": 0.17926126736699424 },
{ "x": 0.08816705336426914, "y": 0.17993900372754998 }
]
},
{
"s": 8,
"e": 16,
"w": "financial",
"b": [
{ "x": 0.08584686774941995, "y": 0.1762114537444934 },
{ "x": 0.25696055684454755, "y": 0.1762114537444934 },
{ "x": 0.25696055684454755, "y": 0.2016265672653338 },
{ "x": 0.08584686774941995, "y": 0.2016265672653338 }
]
},
{
"s": 18,
"e": 29,
"w": "transactions",
"b": [
{ "x": 0.016241299303944315, "y": 0.20060996272450016 },
{ "x": 0.25928074245939675, "y": 0.19959335818366655 },
{ "x": 0.25928074245939675, "y": 0.22636394442561844 },
{ "x": 0.016821345707656612, "y": 0.22738054896645205 }
]
},
...
]
About these points:
- always exactly 4 points
- point not always parallel to each others
- doesn't require more than 1/1000 precision
I was wondering, is there a way I can reduce the size of that payload? (end goal is to index those record in full text search service like Algolia)