You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 9, 2026. It is now read-only.
Repository navigation
Commit 38cb057
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: modules/ROOT/pages/connect-clients-to-target.adoc
+90-35Lines changed: 90 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,7 +20,8 @@ Be sure that you have thoroughly xref:ROOT:migrate-and-validate-data.adoc[valida
20
20
21
21
== Connect a driver to a generic CQL cluster
22
22
23
-
If your origin and target clusters are both generic CQL clusters ({cass-short}, {dse-short}, or {hcd-short}), then the driver connection strings can be similar, requiring only minor changes to connect to the target cluster.
23
+
If your origin and target clusters are both generic CQL clusters, such as {cass-short}, {dse-short}, or {hcd-short}, then the driver connection strings can be extremely similar.
24
+
It's possible that your code requires only minor changes to connect to the target cluster.
24
25
25
26
. At minimum, update your driver configuration to use the appropriate contact points for your target cluster.
26
27
+
@@ -54,7 +55,7 @@ You must specify one of the following sets of credentials in your driver configu
54
55
*** Set `username` to the literal string `token`.
55
56
*** Set `password` to the actual application token value (`AstraCS:...`).
56
57
+
57
-
** Legacy authentication for earlier drivers:
58
+
** Legacy authentication (Earlier drivers only):
58
59
+
59
60
*** Set `username` to the `clientId` value generated with the token.
60
61
*** Set `password` to the `secret` value generated with the token.
@@ -112,64 +113,118 @@ a| Required.
112
113
* Client ID and secret authentication (Legacy): Set to the `secret` generated with your token.
113
114
|===
114
115
115
-
=== Verify driver compatibility and update connection strings
116
+
.Driver pseudocode comparison
117
+
[%collapsible]
118
+
====
119
+
The two pseudocode examples provide a simplified comparison of the way a {cass-short} driver interacts with {astra-db} and self-managed {cass-short} clusters.
120
+
This pseudocode is for illustration purposes only; the exact syntax depends on your driver language and version.
116
121
117
-
Verify that your driver version is compatible with {astra-db} and the features that you want to use in {astra-db}, such as the vector data type.
118
-
For more information, see xref:datastax-drivers:compatibility:driver-matrix.adoc[].
122
+
The first pseudocode example illustrates the connection to a self-managed {cass-short} cluster.
123
+
This should be somewhat familiar to you based on your current {cass-short} driver.
119
124
120
-
If your client application uses an earlier driver version without built-in {scb-short} support, {company} strongly recommends upgrading to a compatible driver to simplify configuration and get the latest features and bug fixes.
121
-
If you prefer to make this change after the migration, or you must support a legacy application that relies on an earlier driver, you can connect to {astra-db} with https://github.com/datastax/cql-proxy[CQL Proxy], or by extracting the {scb-short} archive and using the individual files to enable mTLS in your driver's configuration.
125
+
[source,pseudocode]
126
+
----
127
+
// Create an object to represent a Cassandra cluster
128
+
// This example listens for connections at 10.20.30.40 on the default port 9042
129
+
// Username and password are required only if authentication is enabled on the cluster
130
+
Cluster my_cluster = Cluster.build_new_cluster(
131
+
contact_points = "10.20.30.40",
132
+
username="cluster_username",
133
+
password="cluster_password"
134
+
)
135
+
136
+
// Connect the Cluster object to the Cassandra cluster, returning a Session
137
+
Session my_session = my_cluster.connect()
122
138
123
-
If your driver has built-in support for the {astra-db} {scb-short}, the changes to enable your application to connect to {astra-db} are minimal.
124
-
The following example demonstrates an {astra-db} connection through the Python driver using an {scb-short} and application token.
125
-
For more information and examples, see <<compare-connection-parameters>> and xref:datastax-drivers:connecting:connect-cloud.adoc[].
139
+
// Execute a query, returning a ResultSet
140
+
ResultSet my_result_set = my_session.execute("select release_version from system.local")
126
141
127
-
[source,python]
128
-
----
129
-
import os
130
-
from cassandra.cluster import Cluster
131
-
from cassandra.auth import PlainTextAuthProvider
132
-
import json
142
+
// Retrieve a specific column from the first row of the result set
=== Verify driver compatibility and update connection strings
194
+
195
+
Verify that your driver version is compatible with {astra-db} and the features that you want to use in {astra-db}, such as the vector data type.
196
+
For more information, see xref:datastax-drivers:compatibility:driver-matrix.adoc[].
197
+
198
+
If your driver version is fully compatible with {astra-db}, then it has built-in support for the {astra-db} {scb-short}.
199
+
The changes required to connect your application to {astra-db} are minimal.
200
+
201
+
If your client application uses an earlier driver version without built-in {scb-short} support, {company} strongly recommends upgrading to a compatible driver to simplify configuration and get the latest features and bug fixes.
202
+
If you prefer to make this change after the migration, or you must support a legacy application that relies on an earlier driver, you can connect to {astra-db} with https://github.com/datastax/cql-proxy[CQL Proxy], or you must extract the {scb-short} archive and provide the individual files to enable mTLS in your driver's configuration.
203
+
204
+
The following example demonstrates how the {cass-short} Python driver connects to {astra-db} using an application token and {scb-short}:
205
+
206
+
[source,python]
207
+
----
208
+
import os
209
+
from cassandra.cluster import Cluster
210
+
from cassandra.auth import PlainTextAuthProvider
211
+
import json
212
+
213
+
# Provide the path to the SCB
214
+
cloud_config= {
215
+
'secure_connect_bundle': '/path/to/scb.zip'
216
+
}
217
+
218
+
# The username is 'token' and the password is the application token value
For more information and examples of {astra-db} connections, see <<compare-connection-parameters>> and xref:datastax-drivers:connecting:connect-cloud.adoc[].
227
+
173
228
=== Other code changes for {astra-db}
174
229
175
230
In addition to updating connection strings, you might also need to make the following code changes:
0 commit comments