Question-: LeveledCompactionStrategy (LCS) tends to cause data fragmentation with the read-intensive workloads? A. True B. False
Answer: B Exp: We need to always think that how the write operation affects the read operations in the cluster. As compaction process occurred regularly and significantly can affect the read performance. Suppose we are using SizeTieredCompactionStrategy which leads to data fragmentation where rows are frequently updated. We can use LeveledCopactionStrategy (LCS) to prevent fragmentation when data frequently updated and good for read-intensive load.
Admin and Dev both
Question-: As per the CAP theorem, Cassandra can be setup? A. Highly consistent with Partition tolerance (CP) B. Highly available and Partition Tolerance (AP) C. Highly consistent and highly available (CA)
Answer: A,B Exp: in Cassandra database consistency refers how up to date our data is in the database weather all the replicas are replicated or not. there is an ongoing repair operation which ensures that all the replicas are replicated eventually. in Cassandra consistency is tunable, so you need to follow the cap theorem. Hence, Cassandra provides flexibility for configuring database like either consistent + partition tolerant (CP) or highly available + partition tolerant (AP).
Consistency level can we tune for individual read and write operation based on that we can have more or less consistent data there is a trade-off between operation latency and consistency higher consistency in course higher latency and lower consistency performance however in a distributed system it is not possible tune into a complete consistent and highly available system. the consistency level determines the number of replicas that must acknowledge the read or write operation to the client application. For read operation specifies how many replicas must respond to read request before returning data to the client application operation reveals inconsistency among replicas database initiate the repair operation to update the inconsistent data.
Dev and Admin both
Question-: You have been given below information
- R = Consistency level for read operation - W= Consistency level for the write operation - N is the number of replicas Which of the following would help in having highly or strong consistency level? A. R + W >N B. R + W = N C. R + W < N D. R + W >= N
Answer: A
Explanation: Suppose we have setup replication factor as 3, then to have highly consistent data we should have R + w > 3, means at least 4. So what we can do that for read we can set 2 as well as for write 2. Which would be (R + W) 4 which is more than 3. It means while reading/writing at least two replica to respond to verify the value.
If we need fast write operation with the high consistency, we can do as R=3 and W=1. In this case we would still have highly consistent data. But with faster write and slower read. Because now read has to verify all 3 replicas are having the same data or not.