10

Has anybody worked on testing Cassandra DB which is a NOSQL distributed DB? What are the important things to be taken into account while doing this?

2 Answers 2

9

What you really need to interested in is testing each component in isolation.

Integration level and above becomes more challenging to test. If you are using automated tests then these cannot rely on putting data into a database and expected it to be there straight away. There is a replication time that you would need to wait which could significantly slow down the tests. While unlikely, there are reason that this could be in excess of 30 seconds or so if the connection between databases is broken so how.

An approach that I would go down would be to focus significantly on unit testing each of the components with the data layer mocked. This will allow you to ensure that the rest of the application is functioning correctly.

This leaves you to determine if the data access layer is functioning correctly. For this a once through the application driving it from the UI will help you determine if the application is writing and reading data from the NOSQL database. You may also want to write a small set of integration test to check this automatically for you.

Essentially the main problem you will encounter is the replication of data between database. You will also need to remember that there are scenarios where someone could delete a record on one node, and someone else could edit it on another node while the deletion event has not replicated. Does you application handle this?

4


Just begun to play with one of implementations of no-sql, so only that I can advice to you is my guess + actually I'm not QA engineer, so advice is not formal. However, hope it will help.

So, what to take into account:

  • eventual consistency(is time required for getting data consistent on write acceptable);
  • fail-safety(will data stay alive if one of, let's say 5, nodes falls);
  • schemes with transitive circular references(for instance, how db works with something like A->B, B->C and C->A. Db that played with sometimes fails when I try to retrieve such data);

Maybe later I'll remember more stuff to check ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.