Ana subree3/8/2023 Whether n is a right or left child of the parent p,Ģ. In order to carry out the splay operation which requires a sequence of steps:ġ. Splaying Operation: When the node n is accessed, a splay operation is performed on n to move it to a root. The operations that can be performed on self-adjusting trees are as follows:Ī. There are also other patterns to use to model hierarchies, they will be described in the next blog posts.Splaying in self-adjusting data structures. In the article, there was described how the Closure Table pattern could be efficiently implemented on NoSQL storages such as Cassandra and MongoDB. And a new combination of nodes forms a tree in the scope of a new session. On the other hand in our IoT Use Case we assume no modification is required: once the tree is formed in the scope of a session - its structure is going to be immutable until the end of the session. Well, first of all, the existing hierarchy modification is absolutely possible, it just requires some logic to be implemented (out of the scope of this article, but you can google it). But what about the hierarchy modifications? The approach described above shows how the data model implemented on Cassandra and Mongo covers the main requirements for querying the trees. For MongoDB we would need to have another index:ĭb.edge_connection.createIndex() Modification of the Hierarchies.For Cassandra, we would need to introduce and properly maintain another table of Edge Connection (Reversed) table with the same list of attributes but the different configuration of a key (with swapped device_ancestor_id and device_descendant_id ).The described solutions well cover the exact IoT Use Case described above, but if we wanted to query not a subtree but the list of ancestors for a particular node we would need to extend the model by new objects: To implement the IoT use case described above the following Cassandra data model (Chebotko diagram) is proposed: Q2: Read telemetry data from the device as well as telemetry from all its subordinates Cassandra Solution Q1: Read the device subtree (list of its subordinate devices as well as relationships between them)
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |