1

What types of code changes may need to be made? The documentation seems to be conflicting in this regard, and doesn't provide specifics that I can find. The documentation states:

  1. No code changes are necessary
  2. Trivial code changes may be necessary
  3. Many cases won't require code changes

If I have apps that update and read from Cassandra already working, what situation would cause the need for code changes once Cosmos is implemented? Will the queries in my apps work as is?

I've seen that you can add code to auto adjust the throughput if need be, but I'm not seeing any specifics in documentation describing queries or code changes to existing apps after migrating from Cassandra to Cosmos.

David Makogon
  • 69,407
  • 21
  • 141
  • 189
Artanis
  • 561
  • 1
  • 7
  • 26

1 Answers1

1

Apache Cassandra API in Azure Cosmos DB – offering you Cassandra as-a-service powered by Azure Cosmos DB. You can now experience the power of Azure Cosmos DB platform as a managed service with the familiarity of your favorite Cassandra SDKs and tools—without any app code changes.

Bring your Cassandra apps to Azure Cosmos DB in 3 simple steps:

  1. Create a new Azure Cosmos DB account in the Azure Portal and choose the new Cassandra API while creating an Azure Cosmos DB account.
  2. Connect your Cassandra application to Azure Cosmos DB copying a simple connection code snippet provided to you upon creation of your new account.
  3. Use your favorite Cassandra tools and drivers to manage and query your Cassandra data in Azure Cosmos DB

Azure Cosmos DB provides wire protocol level compatibility with the Cassandra API. This ensures you can continue using your existing application and OSS tools with no code changes and gives you the flexibility to run your Cassandra apps fully managed with no vendor lock-in. While Azure Cosmos DB exposes APIs for the popular open source databases, it does not rely on the implementations of those databases for realizing the semantics of the corresponding APIs.

Reference: https://azure.microsoft.com/en-us/blog/dear-cassandra-developers-welcome-to-azure-cosmosdb/

The official documentation also mentioned : Azure Cosmos DB Cassandra API can be used as the data store for apps written for Apache Cassandra. This means that by using existing Apache drivers compliant with CQLv4, your existing Cassandra application can now communicate with the Azure Cosmos DB Cassandra API. In many cases, you can switch from using Apache Cassandra to using Azure Cosmos DB 's Cassandra API, by just changing a connection string.

Azure Cosmos DB provides wire protocol level compatibility with existing Cassandra SDKs and tools. This compatibility ensures you can use your existing codebase with Azure Cosmos DB Cassandra API with trivial changes.

It's not absolutely "no code changes". After you migrate your app from Cassandra to Cosmos, you need to test if the app works well or the query statements execute successfully. You need to consider about the code compatibility. To see: Apache Cassandra features supported by Azure Cosmos DB Cassandra API.

If there is error or exception happens, you certainly need to modify the code.

Hope this can helps you.

Leon Yue
  • 15,693
  • 1
  • 11
  • 23
  • I've seen this but I've seen other documentation saying "no code changes or almost none" and I've heard someone say you need code for retry handling – Artanis Jan 31 '19 at 03:41
  • @Zeratul Please see my update, that's what I understand from the documentation. – Leon Yue Jan 31 '19 at 06:38
  • yea see they say no code changes, then they say trivial code changes, and they also say "in many cases" no code changes. Which is it? If I have queries that work perfectly fine with my cassandra setup, then shouldn't I be able to get a definitive answer of whether or not that means I need to add any code before I go ahead and try it? – Artanis Jan 31 '19 at 15:26
  • I have no way to know which code changes would even need to be made, since they don't show which code changes it would be anywhere in the documentation – Artanis Jan 31 '19 at 15:26
  • Whether need to modify the code depends on the actual situation, Azure did not give us the sample. It's hard to say and you must try it. Then maybe you can get the answer. Could you please accept my answer?Thanks and have a good day. – Leon Yue Feb 09 '19 at 13:46