Hello,
I learned that the column type autoincrement is not compatible with Elastic DB.
Does that mean we can never use it or only in specific cases?
Here are already 3 examples where the autoincrement type is used today.
- add rows via QAction:
string rowKey = protocol.AddRowReturnKey(tablePid); - add key on rows added via polling: e.g. WMI
- Service Overview Manager receiving alarm data via the "autoAdd" option:
If we can no longer use this, how can we achieve the same result for all the above cases?
To summarize the comments in the other answer:
-Autoincrement is not deprecated when used in a normal table (=not a logger table), this can still be used.
-The usage of an autoincrement in a logger table is deprecated. If an alternative for an autoincrement is still needed to have a unique PK column then the advice is to use a GUID.
The reasoning why it's considered deprecated in a logger table: It still works in MySQL and in Cassandra (single node) for now, but is not supported in Elastic. If Cassandra cluster is ever used in the background then it will also be difficult. For Cassandra single node a method has been created in the background that gets the maximum autoincrement value, this means that at startup of the element it needs to walk through all the database rows to determine this current autoincrement value, which has an impact on performance and is not advised to be used. There's also the problem that multiple elements could write to the same logger table, then it's difficult for DataMiner to determine who does the housekeeping of maintaining the PK value to be used when inserting a new row. All these reasons mentioned above lead to the decision to make it deprecated for logger tables. An elastic database logger table doesn't need an index column in DataMiner, hence there is also no need anymore to generate something unique through an autoincrement. Cassandra and MySQL logger tables still need a unique index column at this moment (a new software feature has been requested), use a GUID in that case for now.
To answer to the original 3 examples of the question: if you want to use these tables in an elastic database then autoincrement can’t be used. On the other hand, elastic doesn't need the index column, so there's no alternative needed and the column can be omitted. However, these tables are at this moment not part of elastic. The WMI table is a table that is being used for polling, not like a logger table, so it seems strange to use a WMI polling table directly as a logger table.