infotable vs datatable
I wonder the difference between the infotable and the datatable.
When should I use an infotable and a datatable?
I wonder the difference between the infotable and the datatable.
When should I use an infotable and a datatable?
I can't give you a 100% sure recipe for when to use Infotable or when to use a DataTable, but in a nutshell:
-both have columns (defined in a DataShape)
-Infotable is an in-memory ThingWorx primitive type: it always holds in RAM all its data. Reading that data does not result in a disk read.
-DataTable is an on-disk ThingWorx more complex structure: it always stores data on disk. Reading that data will always result in a disk read.
As a consequence:
-do not store large amounts of data in an Infotable. Since the data you put in an Infotable is always kept in RAM it could consume the server memory very fast. Especially when you start working in ThingWorx it's good to try to use as less Infotables as possible, just because you risk writing some code that will "explode" the row count.
Personally I use Infotables for mappings/associations needed for UI (for example: PropertyName->Display Friendly Property Name).
-do not store very frequently used data in DataTables. Imagine that for any read you need to go on the disk -> no go in some usecases.
So, Infotable is a flexible primitive type, like an Array, while the DataTable is the direct equivalent of a Table in an SQL server.
PS: Please don't forget to read the articles my colleague mentioned. My explanation is just a very small starter in this area.
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.