-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Cosmos cassandra conversion instructions #451
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Cosmos cassandra conversion instructions #451
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds a comprehensive instruction file for converting Spring Boot applications from Apache Cassandra to Azure Cosmos DB using Spring Data Cosmos. The guide is based on real-world conversion experience and provides detailed step-by-step instructions covering dependency updates, configuration changes, entity conversion, repository updates, and troubleshooting.
Key Changes
- New instruction file:
convert-cassandra-to-spring-data-cosmos.instructions.md(1,114 lines) providing detailed conversion guidance - README update: Added entry in the instructions table for the new file with appropriate install badges
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
instructions/convert-cassandra-to-spring-data-cosmos.instructions.md |
Comprehensive 11-step guide covering Cassandra to Cosmos DB conversion, including dependency management, entity/repository conversion, authentication setup, and troubleshooting for 10+ common issues |
docs/README.instructions.md |
Added table entry for the new instruction file with VS Code and VS Code Insiders install links |
| **Problem**: Test files reference old Cassandra DAOs and use UUID constructors. | ||
| **Critical Files to Update**: | ||
| 1. Remove `MockReactiveResultSet.java` (Cassandra-specific) | ||
| 2. Update `*ReactiveSer vicesTest.java` - replace DAO references with Cosmos repositories |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a typo: "ReactiveSer vices" should be "ReactiveServices" (no space).
| 2. Update `*ReactiveSer vicesTest.java` - replace DAO references with Cosmos repositories | |
| 2. Update `*ReactiveServicesTest.java` - replace DAO references with Cosmos repositories |
| entity1.setField2("value2"); | ||
| ``` | ||
|
|
||
| **Common files to check**: DataSeeder, DatabaseInitializer, TestDataLoader, or any `@Component` implementing `CommandLineRunner`erEntity owner1 = new OwnerEntity(); |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line appears to have corrupted text. After "CommandLineRunner" there's extra text that doesn't belong: "erEntity owner1 = new OwnerEntity();". This seems to be accidentally merged from a code example. The line should end after "CommandLineRunner".
| **Common files to check**: DataSeeder, DatabaseInitializer, TestDataLoader, or any `@Component` implementing `CommandLineRunner`erEntity owner1 = new OwnerEntity(); | |
| **Common files to check**: DataSeeder, DatabaseInitializer, TestDataLoader, or any `@Component` implementing `CommandLineRunner` | |
| ```java | |
| OwnerEntity owner1 = new OwnerEntity(); |
| ### 8. Test Updates | ||
|
|
||
| #### Update Test Classes | ||
|
|
||
| **CRITICAL**: All test files must be updated to work with String IDs and Cosmos repositories | ||
|
|
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate section header and content. The heading "### 8. Test Updates" and "#### Update Test Classes" are repeated on lines 811-815 and then again on lines 818-820. The duplicate content should be removed to maintain clean documentation structure.
| ### 8. Test Updates | |
| #### Update Test Classes | |
| **CRITICAL**: All test files must be updated to work with String IDs and Cosmos repositories |
| **Root Cause**: Different data distribution strategies | ||
| **Solution**: Choose appropriate partition key based on query patterns, typically the most frequently queried field | ||
|
|
||
| #### Issue 9: UUID to String conversion issues |
Copilot
AI
Dec 3, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two different "Issue 9" entries in the troubleshooting section. Line 936 has "Issue 9: RBAC permission errors" and line 971 has "Issue 9: UUID to String conversion issues". The second one should be renumbered to "Issue 10" to maintain sequential numbering.
| #### Issue 9: UUID to String conversion issues | |
| #### Issue 10: UUID to String conversion issues |
aaronpowell
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot has noted some things that might be some typing mistakes or copy/paste errors @TheovanKraay - can you review them and apply (or close) as relevant.
Pull Request Checklist
npm startand verified thatREADME.mdis up to date.Description
Instructions file for converting Cassandra applications to using Azure Cosmos DB (with Spring Data Cosmos module).
Type of Contribution
Additional Notes
By submitting this pull request, I confirm that my contribution abides by the Code of Conduct and will be licensed under the MIT License.