Search code examples
asp.net-corecassandrahealth-check

Cassandra HealthCheck in Asp.net Core


I'm using asp.net core health-check but I couldn't find any provider for the Cassandra database.

Is there any specific reason that they didn't implement it? or Can I easily use a simple query to check the connection like below?

SELECT now() FROM system.local;

In Addition, should I check the status of each node in the cluster?


Solution

  • Can I easily use a simple query to check the connection like below?

    Yes. SELECTing anything from system.local should be a good indication that the cluster is up and accepting connections.

    In Addition, should I check the status of each node in the cluster?

    No, because the driver uses individual node IPs only as a way to find the cluster. The node which coordinates the request isn't something that can be programmatically determined.