Troubles sendig large data do API using API Platform

I’m designing an API to receive sensorial data from a mobile device. Basically I’m building a JSON with the following structure:

{
"accelerometerSamples": [
  {
    "timestamp": 0,
    "xx": 0,
    "yy": 0,
    "zz": 0
  }
],
"gyroscopeSamples": [
  {
    "timestamp": 0,
    "xx": 0,
    "yy": 0,
    "zz": 0
  }
],
"magnetometerSamples": [
  {
    "timestamp": 0,
    "xx": 0,
    "yy": 0,
    "zz": 0
  }
]
}

However, as you can imagine it generates tons of data. I would said arround 200k of lines. Thus the requests are to slow what doesn’t let my application works.
I’m thinking about to changing the structure to something like:

{
"sensorialData":{
  "xx": [
     1,
     2,
     3,
     5
  ],
  "yy":[
     1,
     2,
     3,
     5
  ]
}
}

Do you think that this could increase the performance? Because I will reduce a lot of deserialization mechanisms.
Thanks in advance,

Source: Symfony Questions

Was this helpful?

0 / 0

Leave a Reply 0

Your email address will not be published. Required fields are marked *