Skip to content

Commit 59bf958

Browse files
[GEOMESA-3435] Added scyllaDB tests and documentation (#3437)
1 parent 70cdd4a commit 59bf958

File tree

10 files changed

+218
-1
lines changed

10 files changed

+218
-1
lines changed

docs/conf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ def ultimateReplace(app, docname, source):
3333
"{{accumulo_required_version}}": "2.0.1 or " + target.versions.accumulo_version,
3434
"{{cassandra_supported_versions}}": "version " + target.versions.cassandra_version,
3535
"{{cassandra_required_version}}": target.versions.cassandra_version,
36+
"{{scylladb_supported_versions}}": "version " + target.versions.scylladb_version,
37+
"{{scylladb_required_version}}": target.versions.scylladb_version,
3638
"{{geoserver_version}}": target.versions.geoserver_version,
3739
"{{hbase_supported_versions}}": "version " + target.versions.hbase_version,
3840
"{{hbase_required_version}}": target.versions.hbase_version,

docs/user/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ User Manual
2222
accumulo/index
2323
hbase/index
2424
cassandra/index
25+
scylladb/index
2526
postgis/index
2627
kafka/index
2728
redis/index

docs/user/install.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Installation instructions are available for each data store implementation:
88
* :doc:`/user/accumulo/install`
99
* :doc:`/user/hbase/install`
1010
* :doc:`/user/cassandra/install`
11+
* :doc:`/user/scylladb/install`
1112
* :doc:`/user/kafka/install`
1213
* :doc:`/user/redis/install`
1314
* :doc:`/user/filesystem/install`

docs/user/scylladb/index.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
ScyllaDB Data Store
2+
===================
3+
4+
.. note::
5+
6+
GeoMesa currently supports ScyllaDB {{scylladb_supported_versions}}.
7+
8+
The GeoMesa ScyllaDB Data Store is an implementation of the GeoTools
9+
``DataStore`` interface that is backed by `ScyllaDB`_.
10+
It is found in the ``geomesa-cassandra`` directory of the GeoMesa
11+
source distribution, as ScyllaDB is a high-performance, drop-in replacement
12+
for Apache Cassandra.
13+
14+
ScyllaDB offers superior performance and scalability compared to Cassandra,
15+
while maintaining full compatibility with the Cassandra Query Language (CQL)
16+
and wire protocol. This means GeoMesa can use ScyllaDB without any code changes,
17+
simply by connecting to a ScyllaDB cluster instead of Cassandra.
18+
19+
.. _ScyllaDB: https://www.scylladb.com/
20+
21+
.. toctree::
22+
:maxdepth: 1
23+
24+
install
25+
usage

docs/user/scylladb/install.rst

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
Installing GeoMesa ScyllaDB
2+
===========================
3+
4+
.. note::
5+
6+
GeoMesa currently supports ScyllaDB {{scylladb_supported_versions}}.
7+
8+
Connecting to ScyllaDB
9+
-----------------------
10+
11+
The first step to getting started with ScyllaDB and GeoMesa is to install
12+
ScyllaDB itself. You can find good directions for downloading and installing
13+
ScyllaDB online. For example, see Scylla's official `getting started`_ documentation.
14+
15+
.. _getting started: https://opensource.docs.scylladb.com/stable/getting-started/index.html
16+
17+
Quick Start with Docker
18+
~~~~~~~~~~~~~~~~~~~~~~~
19+
20+
The easiest way to get started with ScyllaDB is using Docker:
21+
22+
.. code-block:: bash
23+
24+
$ docker run --name scylla -d -p 9042:9042 scylladb/scylla:latest
25+
26+
This starts a ScyllaDB container listening on the default CQL port (9042).
27+
28+
Once ScyllaDB is running, create a keyspace for GeoMesa. Connect using ``cqlsh``:
29+
30+
.. code-block:: bash
31+
32+
$ docker exec -it scylla cqlsh
33+
34+
Then create a keyspace:
35+
36+
.. code-block:: bash
37+
38+
CREATE KEYSPACE IF NOT EXISTS geomesa_scylla WITH replication = {'class': 'SimpleStrategy', 'replication_factor': 1};
39+
40+
.. note::
41+
42+
For production deployments, use a higher replication factor and consider
43+
using ``NetworkTopologyStrategy`` instead of ``SimpleStrategy``.
44+
45+
Setting Up for GeoMesa
46+
~~~~~~~~~~~~~~~~~~~~~~~
47+
48+
After creating the keyspace, note your ScyllaDB contact point. For a local Docker installation,
49+
this will be ``127.0.0.1:9042``. You can verify the port in the ScyllaDB configuration.
50+
51+
Since ScyllaDB is wire-compatible with Cassandra, GeoMesa uses the same libraries and
52+
configuration. Set the ``CASSANDRA_HOME`` environment variable to point to a Cassandra
53+
installation, or let GeoMesa download the necessary JARs automatically (see below).
54+
55+
Installing GeoMesa Tools and Plugins
56+
------------------------------------
57+
58+
ScyllaDB uses the **same GeoMesa Cassandra distribution** for all components including:
59+
60+
* Binary distribution and command line tools
61+
* Building from source
62+
* GeoServer plugins
63+
64+
Please refer to the :ref:`Cassandra installation documentation <cassandra_install_source>` for complete
65+
instructions on:
66+
67+
* :ref:`Installing from the binary distribution <cassandra_install_source>`
68+
* :ref:`Building from source <cassandra_install_source>`
69+
* :ref:`Setting up command line tools <setting_up_cassandra_commandline>`
70+
* :ref:`Installing the GeoServer plugin <install_cassandra_geoserver>`
71+
72+
.. note::
73+
74+
All ``geomesa-cassandra`` command line tools work identically with ScyllaDB. Simply point them
75+
at your ScyllaDB cluster using the contact point parameter.
76+
77+
.. note::
78+
79+
The same Cassandra client JARs work with both Cassandra and ScyllaDB due to wire protocol compatibility.
80+
When using ``$CASSANDRA_HOME`` or installing dependencies, use the Cassandra client libraries as documented
81+
in the Cassandra installation guide.

docs/user/scylladb/usage.rst

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
Using ScyllaDB with GeoMesa
2+
============================
3+
4+
ScyllaDB is a high-performance, drop-in replacement for Apache Cassandra that is fully
5+
compatible with the Cassandra Query Language (CQL) and wire protocol.
6+
7+
Data Store Parameters and Usage
8+
--------------------------------
9+
10+
ScyllaDB uses the **exact same parameters and API** as the Cassandra Data Store.
11+
Please refer to the :ref:`cassandra_parameters` documentation for complete details on:
12+
13+
* Data store parameters
14+
* Programmatic access
15+
* Command line tools
16+
* Configuration options
17+
18+
The only difference is that you point the ``cassandra.contact.point`` parameter to your
19+
ScyllaDB cluster instead of a Cassandra cluster.
20+
21+
Quick Example
22+
~~~~~~~~~~~~~
23+
24+
.. code-block:: java
25+
26+
Map<String, Serializable> parameters = new HashMap<>();
27+
parameters.put("cassandra.contact.point", "127.0.0.1:9042"); // Your ScyllaDB cluster
28+
parameters.put("cassandra.keyspace", "geomesa_scylla");
29+
parameters.put("cassandra.catalog", "mycatalog");
30+
org.geotools.api.data.DataStore dataStore =
31+
org.geotools.api.data.DataStoreFinder.getDataStore(parameters);
32+
33+
ScyllaDB-Specific Notes
34+
-----------------------
35+
36+
Differences with Cassandra
37+
~~~~~~~~~~~~~~~~~~~~~~~~~~
38+
39+
ScyllaDB is designed as a performance-focused alternative to Cassandra. For detailed comparisons
40+
and benchmarks, see ScyllaDB's `comparison documentation <https://www.scylladb.com/compare/scylladb-vs-apache-cassandra/>`_
41+
42+
Compatibility
43+
~~~~~~~~~~~~~
44+
45+
* All Cassandra DataStore features work with ScyllaDB
46+
* Same client drivers and CQL syntax
47+
* ScyllaDB 2025.x or 6.x+ recommended
48+
* No code changes required - true drop-in replacement
49+
50+
Migration from Cassandra
51+
~~~~~~~~~~~~~~~~~~~~~~~~~
52+
53+
To migrate from Cassandra to ScyllaDB:
54+
55+
1. Export data: ``bin/geomesa-cassandra export``
56+
2. Set up ScyllaDB with same keyspace structure
57+
3. Import data: ``bin/geomesa-cassandra ingest``
58+
4. Update connection string to point to ScyllaDB
59+
60+
Alternatively, use ScyllaDB's native migration tools to preserve all tables and data.
61+
See the `ScyllaDB migration guide <https://opensource.docs.scylladb.com/stable/operating-scylla/procedures/cassandra-to-scylla-migration-process.html>`_.

docs/versions.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
accumulo_version = accumulo_version_full[:accumulo_version_full.rindex('.')]
1515
cassandra_version_full = '${cassandra.server.version.recommended}'
1616
cassandra_version = cassandra_version_full[:cassandra_version_full.rindex('.')]
17+
scylladb_version = '${scylladb.version.recommended}'
1718
geoserver_version = '${geoserver.version}'
1819
hadoop_min_version = '${hadoop.min.version}'
1920
hbase_version_full = '${hbase.version.recommended}'

geomesa-cassandra/geomesa-cassandra-datastore/src/test/scala/org/locationtech/geomesa/cassandra/data/CassandraDataStoreTest.scala

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,13 @@ class CassandraDataStoreTest extends Specification with BeforeAfterAll {
3939

4040
sequential
4141

42-
val container =
42+
protected def createContainer(): CassandraContainer = {
4343
new CassandraContainer(DockerImageName.parse("cassandra").withTag(sys.props.getOrElse("cassandra.docker.tag", "3.11.19")))
4444
.withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("cassandra")))
4545
.withFileSystemBind(MountableFile.forClasspathResource("init.cql").getResolvedPath, "/init.cql", BindMode.READ_ONLY)
46+
}
47+
48+
val container: CassandraContainer = createContainer()
4649

4750
lazy val params: Map[String, String] = Map(
4851
Params.ContactPointParam.getName -> s"${container.getContactPoint.getHostString}:${container.getContactPoint.getPort}",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/***********************************************************************
2+
* Copyright (c) 2013-2025 General Atomics Integrated Intelligence, Inc.
3+
* All rights reserved. This program and the accompanying materials
4+
* are made available under the terms of the Apache License, Version 2.0
5+
* which accompanies this distribution and is available at
6+
* https://www.apache.org/licenses/LICENSE-2.0
7+
***********************************************************************/
8+
9+
package org.locationtech.geomesa.cassandra.data
10+
11+
import org.junit.runner.RunWith
12+
import org.slf4j.LoggerFactory
13+
import org.specs2.runner.JUnitRunner
14+
import org.testcontainers.cassandra.CassandraContainer
15+
import org.testcontainers.containers.BindMode
16+
import org.testcontainers.containers.output.Slf4jLogConsumer
17+
import org.testcontainers.utility.{DockerImageName, MountableFile}
18+
19+
/**
20+
* Test suite for GeoMesa Cassandra DataStore using ScyllaDB as a drop-in replacement.
21+
* This test extends CassandraDataStoreTest and overrides the container definition
22+
* to use ScyllaDB instead of Apache Cassandra.
23+
*
24+
* Note: Uses --reactor-backend=epoll for compatibility with Docker Desktop on Mac/Windows.
25+
* Requires ScyllaDB 2025.1.4+ for best Docker compatibility.
26+
*/
27+
@RunWith(classOf[JUnitRunner])
28+
class ScyllaDBDataStoreTest extends CassandraDataStoreTest {
29+
30+
override protected def createContainer(): CassandraContainer = {
31+
new CassandraContainer(
32+
DockerImageName.parse("scylladb/scylla")
33+
.withTag(sys.props.getOrElse("scylladb.docker.tag", "2025.1.4"))
34+
.asCompatibleSubstituteFor("cassandra")
35+
)
36+
.withCommand("--reactor-backend", "epoll", "--smp", "1")
37+
.withLogConsumer(new Slf4jLogConsumer(LoggerFactory.getLogger("scylladb")))
38+
.withFileSystemBind(MountableFile.forClasspathResource("init.cql").getResolvedPath, "/init.cql", BindMode.READ_ONLY)
39+
}
40+
}

pom.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@
142142
<protobuf.version>3.25.6</protobuf.version> <!-- see also confluent.protobuf.version, hbase.protobuf.version -->
143143
<cassandra.driver.version>3.11.5</cassandra.driver.version>
144144
<cassandra.version>3.11.19</cassandra.version>
145+
<scylladb.version>2025.1.4</scylladb.version>
145146
<kafka.version>3.9.1</kafka.version> <!-- needs to align with confluent version -->
146147
<confluent.version>7.8.0</confluent.version> <!-- confluent 7.8.x corresponds to kafka 3.8.x -->
147148
<confluent.protobuf.version>3.25.6</confluent.protobuf.version>
@@ -232,6 +233,7 @@
232233
<accumulo.version.recommended>${accumulo.version}</accumulo.version.recommended>
233234
<cassandra.driver.version.recommended>${cassandra.driver.version}</cassandra.driver.version.recommended>
234235
<cassandra.server.version.recommended>${cassandra.version}</cassandra.server.version.recommended>
236+
<scylladb.version.recommended>${scylladb.version}</scylladb.version.recommended>
235237
<confluent.version.recommended>7.8.0</confluent.version.recommended>
236238
<hadoop.version.recommended>${hadoop.version}</hadoop.version.recommended>
237239
<hbase.version.recommended>${hbase.version}</hbase.version.recommended>

0 commit comments

Comments
 (0)