Community Tip - Visit the PTCooler (the community lounge) to get to know your fellow community members and check out some of Dale's Friday Humor posts! X
I wonder the difference between the infotable and the datatable.
When should I use an infotable and a datatable?
Solved! Go to Solution.
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.
Hi @JackEom.
Please review the following pages from the Help Center for details of each:
If you have further questions after reviewing this information, please let us know.
Regards.
--Sharon
Yeah Thank you. but I already check this.
I know their definition. I wonder when should I use the infotable? or data table.
In short, I wonder about each advantage.
Thank you.
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.
oh thank you for the detail answer.
Everyone's answers are a great help to me.