1

I found there is a YugaByteCassandraCSharpDriver on NuGet package manager while in yugabyte official site docs showed using CassandraCSharpDriver.

which one should we use for C#?

what is the difference between YugaByteCassandraCSharpDriver and CassandraCSharpDriver?

Ali Zeinali
  • 551
  • 4
  • 16

1 Answers1

2

You should be using YugaByteCassandraCSharpDriver because YugabyteDB partitioning policy is different from Cassandra. As a result, even though the drivers are API compatible (for the common functionality), there'll be a performance advantage in using the YugabyteDB driver because requests can be routed to the correct/optimal node in the common case.

The YugabyteDB driver also support extra features that aren't present in Cassandra (such as the JSONB datatype).

The docpage is old and will be updated.

dh YB
  • 965
  • 3
  • 10
  • And Are [these](https://www.datastax.com/blog/2014/06/4-simple-rules-when-using-datastax-drivers-cassandra) 4 rules true for YugaByteCassandraCSharpDriver too? – Ali Zeinali Jan 21 '20 at 11:25
  • @AliZeinali yes. All operations are atomic and transactional. – dh YB Jan 21 '20 at 11:37
  • OK thanks. I have a lot of different question about this yugabyte :) . where can i ask them? – Ali Zeinali Jan 21 '20 at 11:46
  • I exactly was looking for JSONB feature in YB driver but i couldn't find it. Could you please give an example? – Ali Zeinali Jan 22 '20 at 17:46
  • @AliZeinali see usage in tests https://github.com/yugabyte/cassandra-csharp-driver/blob/master/src/Cassandra.YugaByte.Tests/JsonTest.cs – dh YB Jan 22 '20 at 19:58
  • Does YugaByteCassandraCSharpDriver support transactions? – Ali Zeinali Feb 19 '20 at 08:59
  • @AliZeinali all DML are transactional when creating a table with `transactions = { 'enabled' : true }` https://docs.yugabyte.com/latest/api/ycql/ddl_create_table/#table-properties-1 – dh YB Feb 19 '20 at 11:18
  • I mean can we BEGIN and END transactions with driver without writing CQL? – Ali Zeinali Feb 19 '20 at 12:03
  • I think you mean multi query transactions like in YSQL ? Currently all transactions can only span 1 query (like autocommit in YSQL/Postgresql) – dh YB Feb 19 '20 at 18:47
  • I'm not sure what is multi query transactions. I'm just looking for something like [this](https://learn.microsoft.com/en-us/dotnet/api/system.data.sqlclient.sqlconnection.begintransaction?view=netframework-4.8) – Ali Zeinali Feb 22 '20 at 08:38
  • 1
    That's not possible in YCQL (only in YSQL). You can't have client-controlled transactions. You have to put all your DML in 1 query string. – dh YB Feb 23 '20 at 12:41