Skip to content

Commit 3116aa5

Browse files
authored
Add ScalarDB 3.16 docs (#1355)
* Move file to 3.15 * Update version * Add 3.15 * Create version-3.15-sidebars.json * Create version-3.15.json * Create 3.16.tsx * Create 3.16.tsx * Create index.mdx * Create index.mdx * Fix links; remove asterisks * Create placeholder draft of release-notes.mdx * Create placeholder draft of release-notes.mdx * Create release-support-policy.mdx * Create release-support-policy.mdx * Add `3.16` as `latest`; change `3.15` to number * Add announcement for 3.16 release * Add `3.15` to `allowedLanguageDropdownVersions` * Update support dates for 3.16 and 3.15 * Add release notes for 3.16.0 * Add patch version release notes for 3.15.4 eab8fbc * Remove misplaced feature ABAC was introduced in 3.15, so we shouldn't re-introduce it here. * Rename `semi-synchronous replication` to `remote replication` * Apply redesign done in #1346 We need to apply the redesign here since we're in the middle of releasing version 3.16. * Remove misplaced feature ABAC was introduced in 3.15, so we shouldn't re-introduce it here. * Add placeholder for new blog posts * Change message from release note link to IBM Db2 info * Add doc for 3.16 * Add Data Loader and Schema Loader error code docs * Match version home page redesign from #1346 * Specify Db2 in link
1 parent 8ed279f commit 3116aa5

File tree

571 files changed

+99229
-1223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

571 files changed

+99229
-1223
lines changed

docs/api-guide.mdx

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -370,14 +370,14 @@ DistributedTransaction transaction = transactionManager.start();
370370
Alternatively, you can use the `begin` method for a transaction by specifying a transaction ID as follows:
371371

372372
```java
373-
// Begin a transaction with specifying a transaction ID.
373+
// Begin a transaction by specifying a transaction ID.
374374
DistributedTransaction transaction = transactionManager.begin("<TRANSACTION_ID>");
375375
```
376376

377377
Or, you can use the `start` method for a transaction by specifying a transaction ID as follows:
378378

379379
```java
380-
// Start a transaction with specifying a transaction ID.
380+
// Start a transaction by specifying a transaction ID.
381381
DistributedTransaction transaction = transactionManager.start("<TRANSACTION_ID>");
382382
```
383383

@@ -389,6 +389,48 @@ When you specify a transaction ID, make sure you specify a unique ID (for exampl
389389

390390
:::
391391

392+
##### Begin or start a transaction in read-only mode
393+
394+
You can also begin or start a transaction in read-only mode. In this case, the transaction will not allow any write operations, and it will be optimized for read operations.
395+
396+
:::note
397+
398+
Using read-only transactions for read-only operations is strongly recommended to improve performance and reduce resource usage.
399+
400+
:::
401+
402+
You can begin or start a transaction in read-only mode as follows:
403+
404+
```java
405+
// Begin a transaction in read-only mode.
406+
DistributedTransaction transaction = transactionManager.beginReadOnly();
407+
```
408+
409+
```java
410+
// Start a transaction in read-only mode.
411+
DistributedTransaction transaction = transactionManager.startReadOnly();
412+
```
413+
414+
Alternatively, you can use the `beginReadOnly` and `startReadOnly` methods by specifying a transaction ID as follows:
415+
416+
```java
417+
// Begin a transaction in read-only mode by specifying a transaction ID.
418+
DistributedTransaction transaction = transactionManager.beginReadOnly("<TRANSACTION_ID>");
419+
```
420+
421+
```java
422+
// Start a transaction in read-only mode by specifying a transaction ID.
423+
DistributedTransaction transaction = transactionManager.startReadOnly("<TRANSACTION_ID>");
424+
```
425+
426+
:::note
427+
428+
Specifying a transaction ID is useful when you want to link external systems to ScalarDB. Otherwise, you should use the `beginReadOnly()` method or the `startReadOnly()` method.
429+
430+
When you specify a transaction ID, make sure you specify a unique ID (for example, UUID v4) throughout the system since ScalarDB depends on the uniqueness of transaction IDs for correctness.
431+
432+
:::
433+
392434
#### Join a transaction
393435

394436
Joining a transaction is particularly useful in a stateful application where a transaction spans multiple client requests. In such a scenario, the application can start a transaction during the first client request. Then, in subsequent client requests, the application can join the ongoing transaction by using the `join()` method.
@@ -629,9 +671,14 @@ If the result has more than one record, `transaction.get()` will throw an except
629671

630672
##### `Scan` operation
631673

632-
`Scan` is an operation to retrieve multiple records within a partition. You can specify clustering-key boundaries and orderings for clustering-key columns in `Scan` operations.
674+
`Scan` is an operation to retrieve multiple records within a partition. You can specify clustering-key boundaries and orderings for clustering-key columns in `Scan` operations. To execute a `Scan` operation, you can use the `transaction.scan()` method or the `transaction.getScanner()` method:
675+
676+
- `transaction.scan()`:
677+
- This method immediately executes the given `Scan` operation and returns a list of all matching records. It is suitable when the result set is expected to be small enough to fit in memory.
678+
- `transaction.getScanner()`:
679+
- This method returns a `Scanner` object that allows you to iterate over the result set lazily. It is useful when the result set may be large, as it avoids loading all records into memory at once.
633680

634-
You need to create a `Scan` object first, and then you can execute the object by using the `transaction.scan()` method as follows:
681+
You need to create a `Scan` object first, and then you can execute the object by using the `transaction.scan()` method or the `transaction.getScanner()` method as follows:
635682

636683
```java
637684
// Create a `Scan` operation.
@@ -652,8 +699,17 @@ Scan scan =
652699
.limit(10)
653700
.build();
654701

655-
// Execute the `Scan` operation.
702+
// Execute the `Scan` operation by using the `transaction.scan()` method.
656703
List<Result> results = transaction.scan(scan);
704+
705+
// Or, execute the `Scan` operation by using the `transaction.getScanner()` method.
706+
try (TransactionCrudOperable.Scanner scanner = transaction.getScanner(scan)) {
707+
// Fetch the next result from the scanner
708+
Optional<Result> result = scanner.one();
709+
710+
// Fetch all remaining results from the scanner
711+
List<Result> allResults = scanner.all();
712+
}
657713
```
658714

659715
You can omit the clustering-key boundaries or specify either a `start` boundary or an `end` boundary. If you don't specify `orderings`, you will get results ordered by the clustering order that you defined when creating the table.
@@ -1292,9 +1348,14 @@ For details about the `Get` operation, see [`Get` operation](#get-operation).
12921348

12931349
#### Execute `Scan` operation
12941350

1295-
`Scan` is an operation to retrieve multiple records within a partition. You can specify clustering-key boundaries and orderings for clustering-key columns in `Scan` operations.
1351+
`Scan` is an operation to retrieve multiple records within a partition. You can specify clustering-key boundaries and orderings for clustering-key columns in `Scan` operations. To execute a `Scan` operation, you can use the `transactionManager.scan()` method or the `transactionManager.getScanner()` method:
1352+
1353+
- `transactionManager.scan()`:
1354+
- This method immediately executes the given `Scan` operation and returns a list of all matching records. It is suitable when the result set is expected to be small enough to fit in memory.
1355+
- `transactionManager.getScanner()`:
1356+
- This method returns a `Scanner` object that allows you to iterate over the result set lazily. It is useful when the result set may be large, as it avoids loading all records into memory at once.
12961357

1297-
You need to create a `Scan` object first, and then you can execute the object by using the `transactionManager.scan()` method as follows:
1358+
You need to create a `Scan` object first, and then you can execute the object by using the `transactionManager.scan()` method or the `transactionManager.getScanner()` method as follows:
12981359

12991360
```java
13001361
// Create a `Scan` operation.
@@ -1314,8 +1375,17 @@ Scan scan =
13141375
.limit(10)
13151376
.build();
13161377

1317-
// Execute the `Scan` operation.
1378+
// Execute the `Scan` operation by using the `transactionManager.scan()` method.
13181379
List<Result> results = transactionManager.scan(scan);
1380+
1381+
// Or, execute the `Scan` operation by using the `transactionManager.getScanner()` method.
1382+
try (TransactionManagerCrudOperable.Scanner scanner = transactionManager.getScanner(scan)) {
1383+
// Fetch the next result from the scanner
1384+
Optional<Result> result = scanner.one();
1385+
1386+
// Fetch all remaining results from the scanner
1387+
List<Result> allResults = scanner.all();
1388+
}
13191389
```
13201390

13211391
For details about the `Scan` operation, see [`Scan` operation](#scan-operation).

docs/backup-restore.mdx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ The backup methods by database listed below are just examples of some of the dat
6666
<TabItem value="YugabyteDB_Managed" label="YugabyteDB Managed">
6767
Clusters are backed up automatically based on the backup policy, and these backups are retained for a specific duration. You can also perform on-demand backups. For details on performing backups, see [YugabyteDB Managed: Back up and restore clusters](https://docs.yugabyte.com/preview/yugabyte-cloud/cloud-clusters/backup-clusters/).
6868
</TabItem>
69+
<TabItem value="Db2" label="Db2">
70+
Use the `backup` command. For details, on performing backups, see [Db2: Backup overview](https://www.ibm.com/docs/en/db2/12.1.0?topic=recovery-backup).
71+
</TabItem>
6972
</Tabs>
7073

7174
### Back up with explicit pausing
@@ -175,4 +178,7 @@ The restore methods by database listed below are just examples of some of the da
175178
<TabItem value="YugabyteDB_Managed" label="YugabyteDB Managed">
176179
You can restore from the scheduled or on-demand backup within the backup retention period. For details on performing backups, see [YugabyteDB Managed: Back up and restore clusters](https://docs.yugabyte.com/preview/yugabyte-cloud/cloud-clusters/backup-clusters/).
177180
</TabItem>
181+
<TabItem value="Db2" label="Db2">
182+
Use the `restore` command. For details, on restoring the database, see [Db2: Restore overview](https://www.ibm.com/docs/en/db2/12.1.0?topic=recovery-restore).
183+
</TabItem>
178184
</Tabs>

0 commit comments

Comments
 (0)