We need some advice on Cassandra keyspaces. Some 1600 elements were created (via SRM, PA and IDP) on a DMS and the following keyspaces with the prefix ‘sldmadb_elementdata_’ were observed (see screenshot further below).
The number of elements appears to be too much for the DMS (due to server resourcing) so a decision was made to delete all the elements to redistribute them.
However, upon deletion of all elements, it is observed that there are still about ~750+ keyspaces with ‘sldmadb_elementdata_’ prefix still in Cassandra.
- Can you please advice what these keyspaces are for?
- If they are associated 1:1 with each element, then should these keyspaces be deleted when the corresponding element is deleted?
- If the first two digits of the keyspace represents DMAID and EID, then I can confirm that many of these elements no longer exists on the DMA. Is it safe to manually delete them or is there a way for DMA to clean up the keyspaces automatically?
- Is there any harm in leaving these keyspaces undeleted?
These tables/keyspaces are created for elements that make use of logger tables. I would advise to use logger tables only when needed. Normally a DB table will be created for every table that uses this option, so you could have multiple tables per element. I'm not 100% sure what the expected behavior is on deleting the element, but it would seem logical that the DB is cleaned up after deleting the element, so I would raise it as a bug. It is indeed [DMAID]_[ELID]_[TableID], so if the element no longer exists, you can delete the table from the DB as it will no longer be used. There is no real harm in keeping tables that are no longer needed. However, there is an overhead (MEM/CPU) in Cassandra for every table that exists. The general rule is to keep the number of tables below 200 in every Cassandra cluster to avoid performance issues.