12-05-2019, 09:28 PM
Hi JereMiami,
A table is just an internal container for a collection of records. Tables exist both on the device, "local", and on the cloud, "cloud". Records can be in a "local" table, a "cloud" table, or both. A table can be created through LCM or with cdb_createTable.
A lot of the APIs have a pTarget parameter that can either be "local" or "cloud", this specifies whether the API should be performed on a "local" table or a table on the "cloud". Let's use cdb_create(pDataA, pTable, pTarget, pInternalA) and cdb_update pDataA, pTable, pRecordID, pTarget, pInternalA as an example.
If we pass "local" to cdb_create, the record will be stored on the device itself. If we pass "cloud", the record will be sent to our servers where it'll be stored. If we create a record on the cloud, there is no "local" record. This means that if we want to update the record, we need to pass "cloud" to cdb_update as well so the record on the cloud can be updated.
cdb_sync can copy the record from the "cloud" table to the "local" table. This allows us to modify the record on the device, without the need to wait for a network transaction. This means we can modify the "local" record all we want, faster than modifying the "cloud" record since there is no wait, then copy it back to the cloud using cdb_sync again when we choose to.
Sorry for the long response. Hopefully I answered your questions. Let me know if you need further clarification.
A table is just an internal container for a collection of records. Tables exist both on the device, "local", and on the cloud, "cloud". Records can be in a "local" table, a "cloud" table, or both. A table can be created through LCM or with cdb_createTable.
A lot of the APIs have a pTarget parameter that can either be "local" or "cloud", this specifies whether the API should be performed on a "local" table or a table on the "cloud". Let's use cdb_create(pDataA, pTable, pTarget, pInternalA) and cdb_update pDataA, pTable, pRecordID, pTarget, pInternalA as an example.
If we pass "local" to cdb_create, the record will be stored on the device itself. If we pass "cloud", the record will be sent to our servers where it'll be stored. If we create a record on the cloud, there is no "local" record. This means that if we want to update the record, we need to pass "cloud" to cdb_update as well so the record on the cloud can be updated.
cdb_sync can copy the record from the "cloud" table to the "local" table. This allows us to modify the record on the device, without the need to wait for a network transaction. This means we can modify the "local" record all we want, faster than modifying the "cloud" record since there is no wait, then copy it back to the cloud using cdb_sync again when we choose to.
Sorry for the long response. Hopefully I answered your questions. Let me know if you need further clarification.