Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revise configuration related documents #905

Merged
merged 9 commits into from
Jun 21, 2023

Conversation

brfrn169
Copy link
Collaborator

This PR revises the configuration related documents. Please take a look!

@@ -20,6 +20,9 @@ From here, we assume Oracle JDK 8 and Cassandra 3.11.x are properly installed in
The **scalardb.properties** (getting-started/scalardb.properties) file holds the configuration for ScalarDB. Basically, it describes the Cassandra installation that will be used.

```properties
# Cassandra storage implementation is used for Consensus Commit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cassandra storage implementation

Cassandra storage adaptor or something might be better?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Currently, there is no consistent name for implementations of DistributedStorage. We call them storage implementations, storage adapters, or shims. I think we should unify this naming. Let's keep it as it is for now and unify it later in another PR. Thanks.

Copy link
Contributor

@kota2and3kan kota2and3kan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the update!
I left some suggestions.
Please take a look when you have time!

docs/configurations.md Outdated Show resolved Hide resolved
docs/configurations.md Outdated Show resolved Hide resolved
docs/configurations.md Outdated Show resolved Hide resolved
docs/configurations.md Outdated Show resolved Hide resolved
docs/configurations.md Outdated Show resolved Hide resolved
docs/configurations.md Outdated Show resolved Hide resolved
docs/configurations.md Outdated Show resolved Hide resolved

For the details of ScalarDB Server, see [ScalarDB Server](scalardb-server.md).

### JDBC transactions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are several notes for JDBC transactions as follows.

  1. You can use JDBC transactions with the JDBC database only (i.e., we cannot use JDBC transactions with some NoSQL databases).
  2. You cannot use JDBC transactions with Multi-storage transactions even if the all underlying databases are JDBC databases.

Especially, I think the second one (limitation for Multi-storage transactions) is a bit confusing. So, I think it would be better to add a note for Multi-storage transactions in this section.

What do you think?

Copy link
Collaborator Author

@brfrn169 brfrn169 Jun 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, as described in configurations.md, the storage property scalar.db.storage is specifically for the Consensus Commit transaction manager. So other transaction manager implementations (jdbc and grpc) do not use it.

Previously, this was not explicitly mentioned, but in the updated configurations.md included in this PR, I think we have made this clear. Given this, do you think we still need to add the special note for Multi-storage transactions?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation! I understood the scalar.db.storage is a dedicated configuration for Consensus Commit.

I didn't notice the scalar.db.storage is a specific configuration for Consensus Commit.

So, I think the special note is not necessary.

By the way, I was just curious, but if we specify both scalar.db.transaction_manager=jdbc and scalar.db.storage=mutli-storage, does ScalarDB ignore the values of scalar.db.storage?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but I think it is probably better to throw an exception if scalar.db.transaction_manager=jdbc and scalar.db.storage are both set.

Copy link
Collaborator Author

@brfrn169 brfrn169 Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, I was just curious, but if we specify both scalar.db.transaction_manager=jdbc and scalar.db.storage=mutli-storage, does ScalarDB ignore the values of scalar.db.storage?

@kota2and3kan Basically, that's correct. But, there is an exception for this. I will explain it along with my response to @feeblefakie's comment.

Not for this PR, but I think it is probably better to throw an exception if scalar.db.transaction_manager=jdbc and scalar.db.storage are both set.

@feeblefakie @kota2and3kan This is also related to @kota2and3kan's question.

In fact, there is a scenario where both configurations are used. This happens when you use both the JDBC transaction manager and the storage API directly. Although this seems like a very rare case, it's technically possible. While the JDBC transaction manager doesn't use the scalar.db.storage property, the property is used by the storage API.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@brfrn169
Ah, I see. Thank you for your answers!
I feel it is a little bit confusing for users...
So, it might be better to separate properties for DistributedTransaction and DistributedStorage explicitly in the future.
(But, basically, users don't use Storage API directly. So, it might be OK to keep the current behavior.)

docs/multi-storage-transactions.md Outdated Show resolved Hide resolved
docs/two-phase-commit-transactions.md Show resolved Hide resolved
Copy link
Contributor

@Torch3333 Torch3333 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@brfrn169 brfrn169 requested a review from komamitsu June 15, 2023 12:21
@@ -88,7 +88,7 @@ protected void load() {
metadataCacheExpirationTimeSecs =
getLong(getProperties(), METADATA_CACHE_EXPIRATION_TIME_SECS, -1);
activeTransactionManagementExpirationTimeMillis =
getLong(getProperties(), ACTIVE_TRANSACTION_MANAGEMENT_EXPIRATION_TIME_MILLIS, 0);
getLong(getProperties(), ACTIVE_TRANSACTION_MANAGEMENT_EXPIRATION_TIME_MILLIS, -1);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed the default value of the property scalar.db.active_transaction_management.expiration_time_millis for consistency. However, it's not backward incompatible change because values less than or equal to 0 are treated the same as before.

brfrn169 and others added 3 commits June 15, 2023 21:53
Co-authored-by: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com>
Co-authored-by: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com>
Copy link
Contributor

@kota2and3kan kota2and3kan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!


For the details of ScalarDB Server, see [ScalarDB Server](scalardb-server.md).

### JDBC transactions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the explanation! I understood the scalar.db.storage is a dedicated configuration for Consensus Commit.

I didn't notice the scalar.db.storage is a specific configuration for Consensus Commit.

So, I think the special note is not necessary.

By the way, I was just curious, but if we specify both scalar.db.transaction_manager=jdbc and scalar.db.storage=mutli-storage, does ScalarDB ignore the values of scalar.db.storage?

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!
I left some comments and suggestions. PTAL!


For the details of ScalarDB Server, see [ScalarDB Server](scalardb-server.md).

### JDBC transactions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not for this PR, but I think it is probably better to throw an exception if scalar.db.transaction_manager=jdbc and scalar.db.storage are both set.


For the details of the Multi-storage, see [Multi-storage Transactions](multi-storage-transactions.md).

### ScalarDB Server (gRPC)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we mark it as deprecated? (or recommend users to use ScalarDB Cluster?)
Also, can you add a section for ScalarDB Cluster?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Actually, I was hesitant to mention ScalarDB Cluster here because this is the document of ScalarDB that is a community edition (OSS) product, but ScalarDB Cluster is an enterprise edition product. I think it would be good to discuss the differentiation between the community and enterprise editions. Thank you.

Copy link
Collaborator Author

@brfrn169 brfrn169 Jun 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per our offline discussion, I will proceed to mark ScalarDB Server as deprecated and will also add a note about ScalarDB Cluster in another PR. Thanks.

In order to avoid frequent errors caused internally by the [`SQLITE_BUSY`](https://www.sqlite.org/rescode.html#busy),
it is recommended to set a [`busy_timeout`](https://www.sqlite.org/c3ref/busy_timeout.html) parameter.

## ScalarDB Server configurations
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ditto.

docs/configurations.md Outdated Show resolved Hide resolved
docs/configurations.md Outdated Show resolved Hide resolved
Co-authored-by: Hiroyuki Yamada <mogwaing@gmail.com>
@brfrn169 brfrn169 force-pushed the revise-configuration-related-docs branch from 845b7a5 to d38a758 Compare June 16, 2023 10:28
Copy link
Member

@josh-wong josh-wong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I've left some suggestions and comments. PTAL!

docs/api-guide.md Outdated Show resolved Hide resolved
```
Note that you can use a primary key or a secondary key for `<COSMOS_DB_FOR_NOSQL_KEY>`.

For the details of the configuration, please refer to [ScalarDB Configurations](configurations.md).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For the details of the configuration, please refer to [ScalarDB Configurations](configurations.md).
For details about configurations, see [ScalarDB Configurations](configurations.md).

```

For the details of the configuration, please refer to [ScalarDB Configurations](configurations.md).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For the details of the configuration, please refer to [ScalarDB Configurations](configurations.md).
For details about configurations, see [ScalarDB Configurations](configurations.md).

```properties
scalar.db.transaction_manager=jdbc
```
For the details of the configuration, please refer to [ScalarDB Configurations](configurations.md).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For the details of the configuration, please refer to [ScalarDB Configurations](configurations.md).
For details about configurations, see [ScalarDB Configurations](configurations.md).

Please follow [Getting Started with ScalarDB](getting-started-with-scalardb.md) to run the application.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Please follow [Getting Started with ScalarDB](getting-started-with-scalardb.md) to run the application.
To run the application, follow the instructions in [Getting Started with ScalarDB](getting-started-with-scalardb.md).

Comment on lines 255 to 256
And an example of configurations for ScalarDB Server is as follows:
```properties
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
And an example of configurations for ScalarDB Server is as follows:
```properties
And an example of configurations for ScalarDB Server is as follows:
```properties

scalar.db.contact_points=<ScalarDB Server host>

# ScalarDB Server port
scalar.db.contact_port=<ScalarDB Server port>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scalar.db.contact_port=<ScalarDB Server port>
scalar.db.contact_port=<SCALARDB_SERVER_PORT>

scalar.db.transaction_manager=grpc

# ScalarDB Server host
scalar.db.contact_points=<ScalarDB Server host>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scalar.db.contact_points=<ScalarDB Server host>
scalar.db.contact_points=<SCALARDB_SERVER_HOST>

Comment on lines 243 to 244
In this case, an example of configurations for App is as follows:
```properties
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this case, an example of configurations for App is as follows:
```properties
In this case, an example of configurations for the app is as follows:
```properties

Comment on lines 239 to 241
In this setting, App (ScalarDB Library with gRPC) connects to an underlying storage/database through ScalarDB Server.
This setting is recommended for production use.
This is because ScalarDB Server implements [scalar-admin](https://github.com/scalar-labs/scalar-admin) interface, which enables you to take transactionally-consistent backups for ScalarDB by pausing the ScalarDB Server.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In this setting, App (ScalarDB Library with gRPC) connects to an underlying storage/database through ScalarDB Server.
This setting is recommended for production use.
This is because ScalarDB Server implements [scalar-admin](https://github.com/scalar-labs/scalar-admin) interface, which enables you to take transactionally-consistent backups for ScalarDB by pausing the ScalarDB Server.
In this configuration, the app (ScalarDB Library with gRPC) connects to an underlying storage/database through ScalarDB Server.
This configuration is recommended for production use because ScalarDB Server implements the [scalar-admin](https://github.com/scalar-labs/scalar-admin) interface, which enables you to take transactionally consistent backups for ScalarDB by pausing ScalarDB Server.

Copy link
Member

@josh-wong josh-wong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! I've left some suggestions and comments. PTAL!

brfrn169 and others added 2 commits June 16, 2023 20:15
Co-authored-by: Josh Wong <joshua.wong@scalar-labs.com>
@brfrn169 brfrn169 requested a review from josh-wong June 16, 2023 12:22
@brfrn169
Copy link
Collaborator Author

brfrn169 commented Jun 16, 2023

@josh-wong Thank you for the helpful suggestions! I have applied them and made some adjustments in fa39625. Please take a look again when you have time!

| Name | Description | Default |
|--------------------------------------------|------------------------------------------------------------------------------------------------|------------|
| `scalar.db.storage` | `cosmos` must be specified. | - |
| `scalar.db.contact_points` | Azure Cosmos DB endpoint the SDK will connect to. | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SDK sounds a bit weird to me since I'm wondering whether it means ScalarDB or not. How about ScalarDB instead? Sorry if I'm missing something.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in c09b36d. Thanks.


| Name | Description | Default |
|------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------|
| `scalar.db.metadata.cache_expiration_time_secs` | ScalarDB has a metadata cache to reduce the number of requests to the database. This setting specifies the expiration time of the cache in seconds. | `-1` (no expiration) |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not for this PR, but no expiration by default sounds a bit unsafe as, IIUC, other ScalarDB server instances keep old cache? 30 seconds by default or so might be safer

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, that's a good point. I'll create another PR for this. Thanks.

@brfrn169 brfrn169 requested a review from komamitsu June 19, 2023 07:11
Copy link
Contributor

@komamitsu komamitsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👍

Copy link
Member

@josh-wong josh-wong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you🙌

Copy link
Contributor

@feeblefakie feeblefakie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you!

@feeblefakie feeblefakie merged commit 527ce11 into master Jun 21, 2023
12 checks passed
@feeblefakie feeblefakie deleted the revise-configuration-related-docs branch June 21, 2023 11:12
brfrn169 added a commit that referenced this pull request Jun 22, 2023
@brfrn169
Copy link
Collaborator Author

Pushed to the 3.9 branch as well.

@josh-wong I only pushed the changes from this PR to the 3.9 branch because I encountered a lot of conflicts when trying to merge them with other release branches.

@josh-wong
Copy link
Member

@brfrn169 Thank you! I'll consider how we can address documentation in previous releases/branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants