-
Notifications
You must be signed in to change notification settings - Fork 38
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
Conversation
@@ -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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
|
||
For the details of ScalarDB Server, see [ScalarDB Server](scalardb-server.md). | ||
|
||
### JDBC transactions |
There was a problem hiding this comment.
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.
- You can use
JDBC transactions
with the JDBC database only (i.e., we cannot useJDBC transactions
with some NoSQL databases). - You cannot use
JDBC transactions
withMulti-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?
There was a problem hiding this comment.
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
?
There was a problem hiding this 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 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
?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
@@ -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); |
There was a problem hiding this comment.
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.
Co-authored-by: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com>
Co-authored-by: kota2and3kan <47254383+kota2and3kan@users.noreply.github.com>
There was a problem hiding this 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 |
There was a problem hiding this 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 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
?
There was a problem hiding this 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 |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto.
Co-authored-by: Hiroyuki Yamada <mogwaing@gmail.com>
845b7a5
to
d38a758
Compare
There was a problem hiding this 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!
``` | ||
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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). |
docs/configurations.md
Outdated
And an example of configurations for ScalarDB Server is as follows: | ||
```properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And an example of configurations for ScalarDB Server is as follows: | |
```properties | |
And an example of configurations for ScalarDB Server is as follows: | |
```properties |
docs/configurations.md
Outdated
scalar.db.contact_points=<ScalarDB Server host> | ||
|
||
# ScalarDB Server port | ||
scalar.db.contact_port=<ScalarDB Server port> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scalar.db.contact_port=<ScalarDB Server port> | |
scalar.db.contact_port=<SCALARDB_SERVER_PORT> |
docs/configurations.md
Outdated
scalar.db.transaction_manager=grpc | ||
|
||
# ScalarDB Server host | ||
scalar.db.contact_points=<ScalarDB Server host> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scalar.db.contact_points=<ScalarDB Server host> | |
scalar.db.contact_points=<SCALARDB_SERVER_HOST> |
docs/configurations.md
Outdated
In this case, an example of configurations for App is as follows: | ||
```properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 |
docs/configurations.md
Outdated
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
There was a problem hiding this 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!
Co-authored-by: Josh Wong <joshua.wong@scalar-labs.com>
@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! |
docs/configurations.md
Outdated
| Name | Description | Default | | ||
|--------------------------------------------|------------------------------------------------------------------------------------------------|------------| | ||
| `scalar.db.storage` | `cosmos` must be specified. | - | | ||
| `scalar.db.contact_points` | Azure Cosmos DB endpoint the SDK will connect to. | | |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) | |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you🙌
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Thank you!
Pushed to the @josh-wong I only pushed the changes from this PR to the |
@brfrn169 Thank you! I'll consider how we can address documentation in previous releases/branches. |
This PR revises the configuration related documents. Please take a look!