0

I am using Cassandra for one of my application. I would like to use Prepared statement that Cassandra provides through cql. If I prepared a query,Is this is prepared in all nodes?.

Any help is appreciated.

Jobs
  • 1,257
  • 2
  • 14
  • 27
  • This is a little brief. Please show some more efforts, such as examplle code – Caffeinated May 30 '15 at 16:43
  • 1
    K.. I am thinking about node failure scenario that can come while running. I don't know exactly how prepared statement works in this distributed nature. I have two thoughts. one is , prepared statement is get prepared in single node and all rest of the queries are forwarded to the same node. Second one is , prepared statement is prepared in all nodes and client request does not have any restriction in selecting coordinator node. If second case is right , Cassandra prepares statement can tolerate node failure . – Jobs May 30 '15 at 16:51
  • Please help me on the below issue https://stackoverflow.com/questions/52134514/cassandra-querying-reducing-performance/52139204?noredirect=1#comment91235494_52139204 – shantha ramadurga Sep 03 '18 at 16:44

1 Answers1

0

No, I don't think it is BUT assuming you're using the Datastax Java driver, the driver will have you covered because it will attempt to re-prepare the statement when needed. See the handling of case UNPREPARED in RequestHandler.SpeculativeExecution#onSet and the use of the prepareAndRetry callback.

Aeham
  • 438
  • 4
  • 11