ScalarDB Cluster Configurations
This document describes the configurations for ScalarDB Cluster. ScalarDB Cluster consists of multiple cluster nodes, and you need to configure each cluster node.
In addition to the configurations described in Transaction manager configurations and Other configurations, you can configure the following configurations for each cluster node.
Basic configurations
The basic configurations for a cluster node are as follows:
Name | Description | Default |
---|---|---|
scalar.db.cluster.membership.type | Membership type. Currently, only KUBERNETES can be specified. | KUBERNETES |
scalar.db.cluster.membership.kubernetes.endpoint.namespace_name | This configuration is for the KUBERNETES membership type. Namespace name for the endpoint resource. | default |
scalar.db.cluster.membership.kubernetes.endpoint.name | This configuration is for the KUBERNETES membership type. Name of the endpoint resource to get the membership info. | |
scalar.db.cluster.node.decommissioning_duration_secs | Decommissioning duration in seconds. | 30 |
scalar.db.cluster.node.grpc.max_inbound_message_size | Maximum message size allowed to be received. | The gRPC default value |
scalar.db.cluster.node.grpc.max_inbound_metadata_size | Maximum size of metadata allowed to be received. | The gRPC default value |
scalar.db.cluster.node.port | Port number of the ScalarDB Cluster node. | 60053 |
scalar.db.cluster.node.prometheus_exporter_port | Port number of the Prometheus exporter. | 9080 |
scalar.db.cluster.grpc.deadline_duration_millis | Deadline duration for gRPC in milliseconds. | 60000 (60 seconds) |
scalar.db.cluster.node.standalone_mode.enabled | Whether standalone mode is enabled. Note that if standalone mode is enabled, the membership configurations (scalar.db.cluster.membership.* ) will be ignored. | false |
scalar.db.active_transaction_management.expiration_time_millis | ScalarDB Cluster nodes maintain ongoing transactions, which can be resumed by using a transaction ID. This configuration specifies the expiration time of this transaction management feature in milliseconds. | 60000 (60 seconds) |
ScalarDB Cluster GraphQL Configurations
The configurations for ScalarDB Cluster GraphQL are as follows:
Name | Description | Default |
---|---|---|
scalar.db.graphql.enabled | Whether ScalarDB Cluster GraphQL is enabled. | false |
scalar.db.graphql.port | Port number of the GraphQL server. | 8080 |
scalar.db.graphql.path | Path component of the URL of the GraphQL endpoint. | /graphql |
scalar.db.graphql.namespaces | Comma-separated list of namespaces of tables for which the GraphQL server generates a schema. Note that at least one namespace is required. | |
scalar.db.graphql.graphiql | Whether the GraphQL server serves GraphiQL IDE. | true |
scalar.db.graphql.schema_checking_interval_millis | Interval in milliseconds at which GraphQL server will rebuild the GraphQL schema if any change is detected in the ScalarDB schema. | 30000 (30 seconds) |
Creating or modifying the ScalarDB schema when the server is running
Since the GraphQL schema is statically built at server startup, if the ScalarDB schema is modified (for example, if a table is added, altered, or deleted), then the corresponding GraphQL schema won't reflect the changes unless it is rebuilt. To address this, the GraphQL server provides two mechanisms: a periodic check and an on-demand check.
Run periodic checks
The server periodically checks if changes in the ScalarDB schema occur and rebuilds the corresponding GraphQL schema if necessary. By default, the check occurs every 30 seconds, but the interval can be configured by using the scalar.db.graphql.schema_checking_interval_millis
property.
If you don't need to run periodic checks, you can disable it by setting the property value to -1
.
Run on-demand checks
You can also request the server to check changes in the ScalarDB schema and rebuild the corresponding GraphQL schema if necessary by performing a POST request to the /update-graphql-schema
endpoint of the HTTP API.
For example, if the HTTP API is running on localhost:8080
and the scalar.db.graphql.path
property is set to /graphql
, this endpoint can be called by running the following command:
curl -X POST http://localhost:8080/graphql/update-graphql-schema
ScalarDB Cluster SQL Configurations
The configurations for ScalarDB Cluster SQL are as follows:
Name | Description | Default |
---|---|---|
scalar.db.sql.enabled | Whether ScalarDB Cluster SQL is enabled. | false |
scalar.db.sql.statement_cache.enabled | Enable the statement cache. | false |
scalar.db.sql.statement_cache.size | Maximum number of cached statements. | 100 |
scalar.db.sql.default_transaction_mode | Default transaction mode. TRANSACTION or TWO_PHASE_COMMIT_TRANSACTION can be set. | TRANSACTION |
scalar.db.sql.default_namespace_name | Default namespace name. If you don't specify a namespace name in your SQL statement, this value is used. |