Skip to content
This repository was archived by the owner on Jun 9, 2026. It is now read-only.

Commit 38cb057

Browse files
authored
DOC-5261 DOC-5262 DOC-5263 DOC-5265 Revise remaining Phase 1 topics (#228)
* remove resolved comment * fix connect to proxy page * deploy proxy instances page * monitoring page * merge tls page into deploy config page * peer review
1 parent 191c0d2 commit 38cb057

13 files changed

Lines changed: 857 additions & 648 deletions
-725 KB
Binary file not shown.

‎modules/ROOT/nav.adoc‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
** xref:ROOT:phase1.adoc[]
1818
** xref:ROOT:setup-ansible-playbooks.adoc[]
1919
** xref:ROOT:deploy-proxy-monitoring.adoc[]
20-
** xref:ROOT:tls.adoc[]
21-
** xref:ROOT:connect-clients-to-proxy.adoc[]
2220
** xref:ROOT:metrics.adoc[]
21+
** xref:ROOT:connect-clients-to-proxy.adoc[]
2322
** xref:ROOT:manage-proxy-instances.adoc[]
2423
* xref:ROOT:migrate-and-validate-data.adoc[]
2524
* xref:ROOT:enable-async-dual-reads.adoc[]

‎modules/ROOT/pages/connect-clients-to-proxy.adoc‎

Lines changed: 122 additions & 122 deletions
Large diffs are not rendered by default.

‎modules/ROOT/pages/connect-clients-to-target.adoc‎

Lines changed: 90 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ Be sure that you have thoroughly xref:ROOT:migrate-and-validate-data.adoc[valida
2020

2121
== Connect a driver to a generic CQL cluster
2222

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.
2425

2526
. At minimum, update your driver configuration to use the appropriate contact points for your target cluster.
2627
+
@@ -54,7 +55,7 @@ You must specify one of the following sets of credentials in your driver configu
5455
*** Set `username` to the literal string `token`.
5556
*** Set `password` to the actual application token value (`AstraCS:...`).
5657
+
57-
** Legacy authentication for earlier drivers:
58+
** Legacy authentication (Earlier drivers only):
5859
+
5960
*** Set `username` to the `clientId` value generated with the token.
6061
*** Set `password` to the `secret` value generated with the token.
@@ -112,64 +113,118 @@ a| Required.
112113
* Client ID and secret authentication (Legacy): Set to the `secret` generated with your token.
113114
|===
114115

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.
116121
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.
119124
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()
122138
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")
126141
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
143+
String release_version = my_result_set.first_row().get_column("release_version")
133144
134-
cloud_config= {
135-
'secure_connect_bundle': '/path/to/scb.zip'
136-
}
137-
auth_provider = PlainTextAuthProvider("token", os.environ["APPLICATION_TOKEN"])
138-
cluster = Cluster(cloud=cloud_config, auth_provider=auth_provider)
139-
session = cluster.connect()
145+
// Close the Session and Cluster
146+
my_session.close()
147+
my_cluster.close()
148+
149+
// Print the data retrieved from the result set
150+
print(release_version)
140151
----
141152
142-
.Driver pseudocode to connect to {astra-db}
143-
[%collapsible]
144-
====
145-
The following pseudocode provides guidance on how you might change your driver's code to connect directly to {astra-db}.
146-
This is for illustration purposes only; the exact syntax depends on your driver and programming language.
153+
The second example modifies the same pseudocode to connect to {astra-db}.
154+
The primary difference lies in the initial connection string.
155+
After that point, the interaction through the root object (`Cluster`/`Session`) is typical.
147156
148157
[source,text]
149158
----
150-
// Create an object to represent a Cassandra cluster
151-
// Note: there is no need to specify contact points when connecting to Astra DB.
159+
// Create an object to represent a Cassandra cluster (an Astra database)
160+
// Don't specify contact points when connecting to Astra DB
152161
// All connection information is implicitly passed in the SCB
153-
Cluster my_cluster = Cluster.build_new_cluster(username="my_AstraDB_client_ID", password="my_AstraDB_client_secret", secure_connect_bundle="/path/to/scb.zip")
154-
155-
// Connect our Cluster object to our Cassandra cluster, returning a Session
162+
Cluster my_cluster = Cluster.build_new_cluster(
163+
username="token",
164+
password="AstraCS:...",
165+
secure_connect_bundle="/path/to/scb.zip"
166+
)
167+
168+
// For legacy applications that must use client ID and secret authentication:
169+
// Cluster my_cluster = Cluster.build_new_cluster(
170+
// username="my_AstraDB_client_ID",
171+
// password="my_AstraDB_client_secret",
172+
// secure_connect_bundle="/path/to/scb.zip"]
173+
// )
174+
175+
// Connect the Cluster object to the database, returning a Session
156176
Session my_session = my_cluster.connect()
157177
158178
// Execute a query, returning a ResultSet
159179
ResultSet my_result_set = my_session.execute("select release_version from system.local")
160180
161-
// Retrieve the "release_version" column from the first row of our result set
181+
// Retrieve a specific column from the first row of the result set
162182
String release_version = my_result_set.first_row().get_column("release_version")
163183
164-
// Close our Session and Cluster
184+
// Close the Session and Cluster
165185
my_session.close()
166186
my_cluster.close()
167187
168-
// Display the release version to the user
188+
// Print the data retrieved from the result set
169189
print(release_version)
170190
----
171191
====
172192

193+
=== 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
219+
auth_provider = PlainTextAuthProvider("token", os.environ["APPLICATION_TOKEN"])
220+
221+
# Create the Cluster and Session objects with Astra credentials
222+
cluster = Cluster(cloud=cloud_config, auth_provider=auth_provider)
223+
session = cluster.connect()
224+
----
225+
226+
For more information and examples of {astra-db} connections, see <<compare-connection-parameters>> and xref:datastax-drivers:connecting:connect-cloud.adoc[].
227+
173228
=== Other code changes for {astra-db}
174229

175230
In addition to updating connection strings, you might also need to make the following code changes:

0 commit comments

Comments
 (0)