Files
scylladb/docs/using-scylla/cassandra-compatibility.rst
Szymon Wasik 80a2e4a0ab cql: add Cassandra SAI (StorageAttachedIndex) compatibility
Libraries such as CassIO, LangChain, and LlamaIndex create vector
indexes using Cassandra's StorageAttachedIndex (SAI) class name.
This commit lets ScyllaDB accept these statements without modification.

When a CREATE CUSTOM INDEX statement specifies an SAI class name on a
vector column, ScyllaDB automatically rewrites it to the native
vector_index implementation. Accepted class names (case-insensitive):
  - org.apache.cassandra.index.sai.StorageAttachedIndex
  - StorageAttachedIndex
  - sai

SAI on non-vector columns is rejected with a clear error directing
users to a secondary index instead.

The SAI detection and rewriting logic is extracted into a dedicated
static function (maybe_rewrite_sai_to_vector_index) to keep the
already-long validate_while_executing method manageable.

Multi-column (local index) targets and nonexistent columns are
skipped with continue — the former are treated as filtering columns
by vector_index::check_target(), and the latter are caught later by
vector_index::validate().

Tests that exercise features common to both backends (basic creation,
similarity_function, IF NOT EXISTS, bad options, etc.) now use the
SAI class name with the skip_on_scylla_vnodes fixture so they run
against both ScyllaDB and Cassandra. ScyllaDB-specific tests continue
to use USING 'vector_index' with scylla_only.
2026-04-09 17:20:03 +02:00

510 lines
29 KiB
ReStructuredText

ScyllaDB and Apache Cassandra Compatibility
=============================================
ScyllaDB is a drop-in replacement for Apache Cassandra 3.11, with additional features from Apache Cassandra 4.0.
This page contains information about ScyllaDB compatibility with Apache Cassandra.
The tables on this page include information about ScyllaDB support for Apache Cassandra features.
They do not include the ScyllaDB-specific features with no match in
Apache Cassandra. See :doc:`ScyllaDB Features </features/index>` for more information about ScyllaDB features.
How to Read the Tables on This Page
-------------------------------------
* |v| - Available in ScyllaDB and compatible with Apache Cassandra.
* |x| - Not available in ScyllaDB.
* **NC** - Available in ScyllaDB, but not compatible with Apache Cassandra.
Interfaces
----------
.. list-table::
:widths: 23 42 35
:header-rows: 1
* - Apache Cassandra Interface
- Version Supported by ScyllaDB
- Comments
* - CQL
- | Fully compatible with version 3.3.1, with additional features from later CQL versions (for example, :ref:`Duration type <durations>`).
| Fully compatible with protocol v4, with additional features from v5.
- More below
* - Thrift
- Not supported anymore in ScyllaDB 6.0
- | deprecated in Apache Cassandra and got dropped in 4.0
| deprecated in ScyllaDB 5.2 and got dropped in 6.0
* - SSTable format (all versions)
- 3.11(mc / md / me), 2.2(la), 2.1.8 (ka)
- | ``me`` - supported in ScyllaDB 2022.2.0 and later
| ``md`` - supported in ScyllaDB 2021.1.0 and later
* - JMX
- 3.11
- More below
* - Configuration (cassandra.yaml)
- 3.11
-
* - Log
- NC
-
* - Gossip and internal streaming
- NC
-
* - SSL
- NC
-
.. _3.3.1: https://github.com/apache/cassandra/blob/cassandra-2.2/doc/cql3/CQL.textile#changes
Supported Tools
---------------
The tools are based on Apache Cassandra 3.11.
.. include:: /operating-scylla/_common/tools_index.rst
Features
--------
.. _consistency-level-read-and-write:
Consistency Level (read and write)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-------------------------------------+--------------+
| Options | Support |
+=====================================+==============+
| Any (Write Only) | |v| |
+-------------------------------------+--------------+
| One | |v| |
+-------------------------------------+--------------+
| Two | |v| |
+-------------------------------------+--------------+
| Three | |v| |
+-------------------------------------+--------------+
| Quorum | |v| |
+-------------------------------------+--------------+
| All | |v| |
+-------------------------------------+--------------+
| Local One | |v| |
+-------------------------------------+--------------+
| Local Quorum | |v| |
+-------------------------------------+--------------+
| Each Quorum (Write Only) | |v| |
+-------------------------------------+--------------+
| SERIAL | |v| :sup:`*` |
+-------------------------------------+--------------+
| LOCAL_SERIAL | |v|:sup:`*` |
+-------------------------------------+--------------+
:sup:`*` See :doc:`ScyllaDB LWT </features/lwt>`.
Snitches
^^^^^^^^
+---------------------------------------------------------------------------+----------------+
| Options | Support |
+===========================================================================+================+
|:ref:`SimpleSnitch <snitch-simple-snitch>` | |v| |
+---------------------------------------------------------------------------+----------------+
| :ref:`RackInferringSnitch <snitch-rack-inferring-snitch>` | |v| |
+---------------------------------------------------------------------------+----------------+
| PropertyFileSnitch | |x| |
+---------------------------------------------------------------------------+----------------+
| :ref:`GossipingPropertyFileSnitch <snitch-gossiping-property-file-snitch>`| |v| |
+---------------------------------------------------------------------------+----------------+
| Dynamic snitching | |x| |
+---------------------------------------------------------------------------+----------------+
| :ref:`EC2Snitch <snitch-ec2-snitch>` | |v| |
+---------------------------------------------------------------------------+----------------+
| :ref:`EC2MultiRegionSnitch <snitch-ec2-multi-region-snitch>` | |v| |
+---------------------------------------------------------------------------+----------------+
| :ref:`GoogleCloudSnitch <GoogleCloudSnitch>` | |v| |
+---------------------------------------------------------------------------+----------------+
| CloudstackSnitch | |x| |
+---------------------------------------------------------------------------+----------------+
| :ref:`AzureSnitch <azuresnitch>` | |v| |
+---------------------------------------------------------------------------+----------------+
Partitioners
^^^^^^^^^^^^
+-------------------------------------+--------------+
| Options | Support |
+=====================================+==============+
| Murmur3Partitioner (default) | |v| |
+-------------------------------------+--------------+
| RandomPartitioner | |x| |
+-------------------------------------+--------------+
| OrderPreservingPartitioner | |x| |
+-------------------------------------+--------------+
| ByteOrderedPartitioner | |x| |
+-------------------------------------+--------------+
| CollatingOrderPreservingPartitioner | |x| |
+-------------------------------------+--------------+
Protocol Options
^^^^^^^^^^^^^^^^
+--------------------------------------------------------------------------+--------------+
| Options | Support |
+==========================================================================+==============+
| :doc:`Encryption </operating-scylla/security/client-node-encryption>` | |v| |
+--------------------------------------------------------------------------+--------------+
| :doc:`Authentication </operating-scylla/security/authentication>` | |v| |
+--------------------------------------------------------------------------+--------------+
| :ref:`Compression <admin-compression>` (see below) | |v| |
+--------------------------------------------------------------------------+--------------+
Compression
^^^^^^^^^^^
+-------------------------------------------------------------------+--------------+
| Options | Support |
+===================================================================+==============+
|CQL Compression | |v| |
+-------------------------------------------------------------------+--------------+
| LZ4 | |v| |
+-------------------------------------------------------------------+--------------+
| Snappy | |v| |
+-------------------------------------------------------------------+--------------+
| :ref:`Node to Node Compression <internode-compression>` | |v| |
+-------------------------------------------------------------------+--------------+
| :ref:`Client to Node Compression <admin-client-node-compression>` | |v| |
+-------------------------------------------------------------------+--------------+
Backup and Restore
^^^^^^^^^^^^^^^^^^
+-----------------------------------------------------------------------+--------------+
| Options | Support |
+=======================================================================+==============+
| :ref:`Snapshot <backup-full-backup-snapshots>` | |v| |
+-----------------------------------------------------------------------+--------------+
| :ref:`Incremental backup <backup-incremental-backup>` | |v| |
+-----------------------------------------------------------------------+--------------+
| :doc:`Restore </operating-scylla/procedures/backup-restore/restore>` | |v| |
+-----------------------------------------------------------------------+--------------+
Repair and Consistency
^^^^^^^^^^^^^^^^^^^^^^
+----------------------------------------------------------------------+--------------+
| Options | Support |
+======================================================================+==============+
| :doc:`Nodetool Repair </operating-scylla/nodetool-commands/repair>` | |v| |
+----------------------------------------------------------------------+--------------+
| Incremental Repair | |x| |
+----------------------------------------------------------------------+--------------+
|:doc:`Hinted Handoff </architecture/anti-entropy/hinted-handoff>` | |v| |
+----------------------------------------------------------------------+--------------+
|:doc:`Lightweight Transactions </features/lwt>` | |v| |
+----------------------------------------------------------------------+--------------+
Replica Replacement Strategy
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-------------------------------------+--------------+
| Options | Support |
+=====================================+==============+
| SimpleStrategy | |v| |
+-------------------------------------+--------------+
| NetworkTopologyStrategy | |v| |
+-------------------------------------+--------------+
Security
^^^^^^^^
+-------------------------------------+--------------+
| Options | Support |
+=====================================+==============+
| Role Based Access Control (RBAC) | |v| |
+-------------------------------------+--------------+
Indexing and Caching
^^^^^^^^^^^^^^^^^^^^^
+----------------------------------------------------------------+--------------------------------------------------------------------------------------+
| Options | Support |
+================================================================+======================================================================================+
|:doc:`Secondary Index </features/secondary-indexes>` | |v| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------+
|StorageAttachedIndex (SAI) | |x| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------+
|:ref:`SAI for vector search <cassandra-sai-compatibility>` | |v| :sup:`*` |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------+
|:doc:`Materialized Views </features/materialized-views>` | |v| |
+----------------------------------------------------------------+--------------------------------------------------------------------------------------+
:sup:`*` SAI class name on vector columns is rewritten to native ``vector_index``
Additional Features
^^^^^^^^^^^^^^^^^^^
+-----------------------------------+-------------------------------------+
| Feature | Support |
+===================================+=====================================+
|Counters | |v| |
+-----------------------------------+-------------------------------------+
|User Defined Types | |v| |
+-----------------------------------+-------------------------------------+
|User Defined Functions | |x| :sup:`*` |
+-----------------------------------+-------------------------------------+
|Time to live (TTL) | |v| |
+-----------------------------------+-------------------------------------+
|Super Column | |x| |
+-----------------------------------+-------------------------------------+
|vNode Enable | |v| Default |
+-----------------------------------+-------------------------------------+
|vNode Disable | |x| |
+-----------------------------------+-------------------------------------+
|Triggers | |x| |
+-----------------------------------+-------------------------------------+
|Batch Requests | |v| Includes conditional updates |
+-----------------------------------+-------------------------------------+
:sup:`*` Experimental
CQL Command Compatibility
-------------------------
Create Keyspace
^^^^^^^^^^^^^^^
+-----------------------------------+-------------------------------------+
| Feature | Support |
+===================================+=====================================+
|DURABLE_WRITES | |v| |
+-----------------------------------+-------------------------------------+
|IF NOT EXISTS | |v| |
+-----------------------------------+-------------------------------------+
|WITH REPLICATION | |v| (see below) |
+-----------------------------------+-------------------------------------+
Create Keyspace with Replication
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+-----------------------------------+-------------------------------------+
| Feature | Support |
+===================================+=====================================+
|SimpleStrategy | |v| |
+-----------------------------------+-------------------------------------+
|NetworkTopologyStrategy | |v| |
+-----------------------------------+-------------------------------------+
|OldNetworkTopologyStrategy | |x| |
+-----------------------------------+-------------------------------------+
Create Table
^^^^^^^^^^^^
+-----------------------------------+-------------------------------------+
| Feature | Support |
+===================================+=====================================+
| Primary key column | |v| |
+-----------------------------------+-------------------------------------+
| Compound primary key | |v| |
+-----------------------------------+-------------------------------------+
| Composite partition key | |v| |
+-----------------------------------+-------------------------------------+
| Clustering order | |v| |
+-----------------------------------+-------------------------------------+
| Static column | |v| |
+-----------------------------------+-------------------------------------+
Create Table Att
................
+-----------------------------------+-------------------------------------+
| Feature | Support |
+===================================+=====================================+
|bloom_filter_fp_chance | |v| |
+-----------------------------------+-------------------------------------+
|caching | |x| (ignored) |
+-----------------------------------+-------------------------------------+
|comment | |v| |
+-----------------------------------+-------------------------------------+
|compaction | |v| |
+-----------------------------------+-------------------------------------+
|compression | |v| |
+-----------------------------------+-------------------------------------+
|default_time_to_live ||v| |
+-----------------------------------+-------------------------------------+
| gc_grace_seconds ||v| |
+-----------------------------------+-------------------------------------+
| index_interval | |x| |
+-----------------------------------+-------------------------------------+
| max_index_interval ||v| |
+-----------------------------------+-------------------------------------+
| memtable_flush_period_in_ms | |x| (ignored) |
+-----------------------------------+-------------------------------------+
| min_index_interval ||v| |
+-----------------------------------+-------------------------------------+
|populate_io_cache_on_flush | |x| |
+-----------------------------------+-------------------------------------+
|replicate_on_write | |x| |
+-----------------------------------+-------------------------------------+
|speculative_retry | ``ALWAYS``, ``NONE`` |
+-----------------------------------+-------------------------------------+
Create Table Compaction
.......................
+----------------------------------------------------+-------------------------------------+
| Feature | Support |
+====================================================+=====================================+
| :ref:`SizeTieredCompactionStrategy <STCS>` (STCS) | |v| |
+----------------------------------------------------+-------------------------------------+
|:ref:`LeveledCompactionStrategy <LCS>` (LCS) | |v| |
+----------------------------------------------------+-------------------------------------+
|DateTieredCompactionStrategy (DTCS) | |x| :sup:`*` |
+----------------------------------------------------+-------------------------------------+
|:ref:`TimeWindowCompactionStrategy <TWCS>` (TWCS) | |v| |
+----------------------------------------------------+-------------------------------------+
:sup:`*` No longer supported. Use TimeWindowCompactionStrategy (TWCS) instead.
Create Table Compression
........................
+----------------------------------------+-------------------------------------+
| Feature | Support |
+========================================+=====================================+
|sstable_compression LZ4Compressor | |v| |
+----------------------------------------+-------------------------------------+
|sstable_compression SnappyCompressor | |v| |
+----------------------------------------+-------------------------------------+
|sstable_compression DeflateCompressor | |v| |
+----------------------------------------+-------------------------------------+
|chunk_length_kb | |v| |
+----------------------------------------+-------------------------------------+
|crc_check_chance | |x| |
+----------------------------------------+-------------------------------------+
Alter Commands
..............
+----------------------------------------+-------------------------------------+
| Feature | Support |
+========================================+=====================================+
|ALTER KEYSPACE | |v| |
+----------------------------------------+-------------------------------------+
|ALTER TABLE | |v| |
+----------------------------------------+-------------------------------------+
|ALTER TYPE | |v| |
+----------------------------------------+-------------------------------------+
|ALTER USER | |v| |
+----------------------------------------+-------------------------------------+
|ALTER ROLE | |v| |
+----------------------------------------+-------------------------------------+
Data Manipulation
.................
+----------------------------------------+-------------------------------------+
| Feature | Support |
+========================================+=====================================+
|BATCH | |v| |
+----------------------------------------+-------------------------------------+
|INSERT | |v| |
+----------------------------------------+-------------------------------------+
|Prepared Statements | |v| |
+----------------------------------------+-------------------------------------+
|SELECT | |v| |
+----------------------------------------+-------------------------------------+
|TRUNCATE | |v| |
+----------------------------------------+-------------------------------------+
|UPDATE | |v| |
+----------------------------------------+-------------------------------------+
|USE | |v| |
+----------------------------------------+-------------------------------------+
Create Commands
...............
+----------------------------------------+-------------------------------------+
| Feature | Support |
+========================================+=====================================+
|CREATE TRIGGER ||x| |
+----------------------------------------+-------------------------------------+
|CREATE USER | |v| |
+----------------------------------------+-------------------------------------+
|CREATE ROLE | |v| |
+----------------------------------------+-------------------------------------+
Drop Commands
.............
+----------------------------------------+-------------------------------------+
| Feature | Support |
+========================================+=====================================+
|DROP KEYSPACE | |v| |
+----------------------------------------+-------------------------------------+
|DROP TABLE | |v| |
+----------------------------------------+-------------------------------------+
|DROP TRIGGER | |x| |
+----------------------------------------+-------------------------------------+
|DROP TYPE | |v| |
+----------------------------------------+-------------------------------------+
|DROP USER | |v| |
+----------------------------------------+-------------------------------------+
|DROP ROLE | |v| |
+----------------------------------------+-------------------------------------+
Roles and Permissions
.....................
+----------------------------------------+-------------------------------------+
| Feature | Support |
+========================================+=====================================+
|GRANT PERMISSIONS | |v| |
+----------------------------------------+-------------------------------------+
|GRANT ROLE | |v| |
+----------------------------------------+-------------------------------------+
|LIST PERMISSIONS | |v| |
+----------------------------------------+-------------------------------------+
|LIST USERS | |v| |
+----------------------------------------+-------------------------------------+
|LIST ROLES | |v| |
+----------------------------------------+-------------------------------------+
|REVOKE PERMISSIONS | |v| |
+----------------------------------------+-------------------------------------+
|REVOKE ROLE | |v| |
+----------------------------------------+-------------------------------------+
Materialized Views
..................
+----------------------------------------+-------------------------------------+
| Feature | Support |
+========================================+=====================================+
| MATERIALIZED VIEW | |v| |
+----------------------------------------+-------------------------------------+
| ALTER MATERIALIZED VIEW | |v| |
+----------------------------------------+-------------------------------------+
|CREATE MATERIALIZED VIEW | |v| |
+----------------------------------------+-------------------------------------+
|DROP MATERIALIZED VIEW | |v| |
+----------------------------------------+-------------------------------------+
Index commands
..............
+----------------------------------------+-------------------------------------+
| Feature | Support |
+========================================+=====================================+
|INDEX | |v| |
+----------------------------------------+-------------------------------------+
|CREATE INDEX | |v| |
+----------------------------------------+-------------------------------------+
|DROP INDEX | |v| |
+----------------------------------------+-------------------------------------+
.. include:: /rst_include/apache-copyrights-index.rst
.. include:: /rst_include/apache-copyrights-index-all-attributes.rst