Skip to content

Conversation

@tinkerer-shubh
Copy link

Add ScyllaDB Adapter Support

related issue : #9295

This PR adds initial support for ScyllaDB as a new database adapter in the Utopia Database library.

Features

The ScyllaDB adapter implements core database operations:

  • Database management (create, delete, list)
  • Collection operations (create, delete, list)
  • Document CRUD operations
  • Attribute management
  • Index support (key and unique)
  • Query operations with support for all standard query types
  • Schema validation

Implementation Details

  • Follows the same pattern as existing adapters
  • Leverages ScyllaDB's native CQL capabilities
  • Includes comprehensive test suite
  • Adds ScyllaDB services to docker-compose.yml for testing
  • Updates README with connection example and specifications

Testing

  • Full test suite in tests/e2e/Adapter/ScyllaDBTest.php
  • All tests passing
  • Can be tested using docker-compose up scylladb

Documentation

Added to README:

  • ScyllaDB in supported databases table
  • Connection example
  • Database specifications and limits

Specifications

  • ID max size: 255 bytes
  • Document: Unrestricted size
  • Collection: Unrestricted attributes
  • Indexes: Unrestricted
  • String max size: Unrestricted
  • Integer max size: 2^63 - 1

- Add ScyllaDB adapter class with full database operations support

- Add comprehensive test suite for ScyllaDB adapter

- Add ScyllaDB services to docker-compose.yml

- Update README with ScyllaDB connection example and specs
return true;
}

$sql = "CREATE KEYSPACE {$name} WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 3}";
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that we should set the replication factor to 1 since by default we will not have a cluster?

Or maybe set some kind of env variable to customise it and the strategy

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! The replication factor is set to 3 as a default for fault tolerance in case we scale to a cluster later. But you’re right if we’re not running a cluster yet, 1 makes more sense for now.

*/
public function getSupportForFulltextIndex(): bool
{
return false; // ScyllaDB doesn't support fulltext search natively
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use materialized view alternatively?

@ChiragAgg5k
Copy link
Member

amazing job @tinkerer-shubh! 🔥

@tinkerer-shubh
Copy link
Author

tinkerer-shubh commented Feb 12, 2025

amazing job @tinkerer-shubh! 🔥

Thank you! This is far from perfect though. The initial goal was to achieve an MVP of sorts and then iterate further based on the feedback. I see the checks are failing too, will take a look. :)

I was also thinking that maybe it's best to mark this as a draft for now while it's still in its iteration phase?

@tinkerer-shubh tinkerer-shubh marked this pull request as draft February 13, 2025 18:29
@ArnabChatterjee20k
Copy link
Contributor

nice one @tinkerer-shubh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants