Using the latest FW v9.3.1, I was wondering what I can expect from the templated arrays.
I’m familiar with the fact that they are designed to store only known data types.
So, given how I have an Array of complex data Structures, I was thinking of flattening such AoS to an SoA type of a configuration, with known types composing the template arrays.
Are template arrays meant to be fixed length?
If so, is it possible to define an upper bound for it? Because I was thinking of having an upper bound on its storage, would still make its size deterministic, but preserve some bandwidth, since only a portion of an array is sent - or does Notecard send the full array? What if the "full”: true is define etc.
I got the sense, from template API, that their specification was meant to provide a fixed(bounded) Note size, so that they could be stored on Flash more effectively. Or I’d suppose that only known types are allowed because Notecard implements some kind of key-value type flash storage?
In any case, I just have an engineering spidey sense tingling, that using template arrays might incurr some hidden limitation Im not seeing right away.
At some point in device lifetime, we could have a variance of upto 200 integers let’s say in a given Note, but most likely ~30.
Just for the sake of argument, that would mean a templated Notefile (be it Outbound or DB), where I could send a note with an array of 5 integers and some other note of about 60, all residing in flash?
@RobLauer Just letting you know that I appreciate the engagment on Forum so far.
These are all good questions, and I assure you there are no hidden limitations when using templates. Arguably the only “downside” in terms of data usage is the first time you sync a Notefile that uses a template, you’re going to incur a very small data penalty to sync the template with Notehub (check out this doc on estimating data usage in a variety of scenarios).
After that, the difference between syncing [1,2,3] and syncing an array with 200+ integers is simply the raw bytes required for those values. Without a template, you’d be paying a much larger recurring cost because every sync would have to serialize and transmit all the surrounding JSON structure.