Get Started with ScalarDL TableStore
ScalarDL TableStore is a high-level abstraction on top of the low-level ledger abstraction. It offers an SQL interface instead of primitive CRUD interfaces like get and put, enabling you to build versatile, tamper-evident applications with the familiar data model and commands quickly and easily.
This getting started tutorial explains how to configure TableStore on your preferred database and manage tables and records in a tamper-evident manner.
What is ScalarDL TableStore?
TableStore provides table-based data management through an SQL interface. You can create tables in a flexible schemaless manner, perform SQL operations like SELECT, INSERT, and UPDATE, and maintain complete audit trails of all data modifications. It also provides an indexing capability, allowing you to select records not only by a primary key but also by an index key.
Prerequisites
- One of the following Java Development Kits (JDKs):
- Oracle JDK: 8, 11, 17, or 21 (LTS versions)
- OpenJDK (Eclipse Temurin, Amazon Corretto, or Microsoft Build of OpenJDK): 8, 11, 17, or 21 (LTS versions)
- Docker 20.10 or later with Docker Compose v2.20.0 or later
Since ScalarDL is built with JDK 8, contracts must be a JDK 8–compatible binary. If you use a version other than JDK 8, you must configure your build tool to build the JDK 8–compatible binary. There are several ways to specify binary compatibility, including using the --release 8
option for javac or setting Gradle or Maven configurations to use the JDK 8 toolchain. The following shows the configuration for Gradle:
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
For more details about the Gradle and Maven configurations, see Toolchains for JVM projects for Gradle and Guide to Using Toolchains for Maven.
Clone the ScalarDL samples repository
Open Terminal, then clone the ScalarDL samples repository by running the following command:
git clone https://github.com/scalar-labs/scalardl-samples
Then, go to the directory that contains the sample configuration by running the following command:
cd scalardl-samples
Start up ScalarDL with your preferred database
Select your database, and follow the instructions to deploy ScalarDL Ledger with it. For a list of databases that ScalarDL supports, see Databases.
- MySQL
- PostgreSQL
- Oracle Database
- SQL Server
- DynamoDB
- Cosmos DB for NoSQL
- Cassandra
Set up your license (Enterprise edition only)
If you're using the ScalarDL Enterprise edition, set up your license as follows. If you're using the Community edition, skip to the next section to start up ScalarDL.
See here to set up your license
-
Enable the container image for the Enterprise edition in the
mysql/docker-compose-ledger.yml
file as follows:-
Before changing the image (default configuration):
services:
scalardl-ledger:
image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
# image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION} -
After changing the image:
services:
scalardl-ledger:
# image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION}
-
-
Set your license key for ScalarDL Ledger. In the
mysql/ledger.properties
file, replace<SET_YOUR_LICENSE_KEY>
with your license key. For example:##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) #####
scalar.dl.licensing.license_key={"organization_name":"XXXXXXXX","expiration_date_time":"YYYY-MM-DDTHH:mm:SS+TIMEZONE","product_name":"ScalarDL Ledger","product_version":N,"license_type":"trial","signature":"XXXXXXXX"}
##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) ##### -
To check the license, update the
mysql/docker-compose-ledger.yml
file as follows. If you're using a trial license, skip this step.-
Before changing the certificate file path (default configuration):
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
- ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
# - ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem -
After changing the certificate file path:
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
# - ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
- ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem
-
Start up ScalarDL
You can start ScalarDL Ledger by following the steps below:
-
Run MySQL locally by running the following command:
docker compose -f mysql/docker-compose-ledger.yml up -d mysql
-
Load the database schema for ScalarDL Ledger by running the following command:
docker compose -f mysql/docker-compose-ledger.yml up -d scalardl-ledger-schema-loader
-
Run ScalarDL Ledger and its dependent components by running the following command:
docker compose -f mysql/docker-compose-ledger.yml up -d
Set up your license (Enterprise edition only)
If you're using the ScalarDL Enterprise edition, set up your license as follows. If you're using the Community edition, skip to the next section to start up ScalarDL.
See here to set up your license
-
Enable the container image for the Enterprise edition in the
postgres/docker-compose-ledger.yml
file as follows:-
Before changing the image (default configuration):
services:
scalardl-ledger:
image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
# image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION} -
After changing the image:
services:
scalardl-ledger:
# image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION}
-
-
Set your license key for ScalarDL Ledger. In the
postgres/ledger.properties
file, replace<SET_YOUR_LICENSE_KEY>
with your license key. For example:##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) #####
scalar.dl.licensing.license_key={"organization_name":"XXXXXXXX","expiration_date_time":"YYYY-MM-DDTHH:mm:SS+TIMEZONE","product_name":"ScalarDL Ledger","product_version":N,"license_type":"trial","signature":"XXXXXXXX"}
##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) ##### -
To check the license, update the
postgres/docker-compose-ledger.yml
file as follows. If you're using a trial license, skip this step.-
Before changing the certificate file path (default configuration):
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
- ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
# - ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem -
After changing the certificate file path:
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
# - ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
- ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem
-
Start up ScalarDL
You can start ScalarDL Ledger by following the steps below:
-
Run PostgreSQL locally by running the following command:
docker compose -f postgres/docker-compose-ledger.yml up -d postgres
-
Load the database schema for ScalarDL Ledger by running the following command:
docker compose -f postgres/docker-compose-ledger.yml up -d scalardl-ledger-schema-loader
-
Run ScalarDL Ledger and its dependent components by running the following command:
docker compose -f postgres/docker-compose-ledger.yml up -d
Set up your license (Enterprise edition only)
If you're using the ScalarDL Enterprise edition, set up your license as follows. If you're using the Community edition, skip to the next section to start up ScalarDL.
See here to set up your license
-
Enable the container image for the Enterprise edition in the
oracle/docker-compose-ledger.yml
file as follows:-
Before changing the image (default configuration):
services:
scalardl-ledger:
image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
# image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION} -
After changing the image:
services:
scalardl-ledger:
# image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION}
-
-
Set your license key for ScalarDL Ledger. In the
oracle/ledger.properties
file, replace<SET_YOUR_LICENSE_KEY>
with your license key. For example:##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) #####
scalar.dl.licensing.license_key={"organization_name":"XXXXXXXX","expiration_date_time":"YYYY-MM-DDTHH:mm:SS+TIMEZONE","product_name":"ScalarDL Ledger","product_version":N,"license_type":"trial","signature":"XXXXXXXX"}
##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) ##### -
To check the license, update the
oracle/docker-compose-ledger.yml
file as follows. If you're using a trial license, skip this step.-
Before changing the certificate file path (default configuration):
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
- ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
# - ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem -
After changing the certificate file path:
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
# - ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
- ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem
-
Start up ScalarDL
You can start ScalarDL Ledger by following the steps below:
-
Run Oracle Database locally by running the following command:
docker compose -f oracle/docker-compose-ledger.yml up -d oracle
-
Load the database schema for ScalarDL Ledger by running the following command:
docker compose -f oracle/docker-compose-ledger.yml up -d scalardl-ledger-schema-loader
-
Run ScalarDL Ledger and its dependent components by running the following command:
docker compose -f oracle/docker-compose-ledger.yml up -d
Set up your license (Enterprise edition only)
If you're using the ScalarDL Enterprise edition, set up your license as follows. If you're using the Community edition, skip to the next section to start up ScalarDL.
See here to set up your license
-
Enable the container image for the Enterprise edition in the
sqlserver/docker-compose-ledger.yml
file as follows:-
Before changing the image (default configuration):
services:
scalardl-ledger:
image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
# image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION} -
After changing the image:
services:
scalardl-ledger:
# image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION}
-
-
Set your license key for ScalarDL Ledger. In the
sqlserver/ledger.properties
file, replace<SET_YOUR_LICENSE_KEY>
with your license key. For example:##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) #####
scalar.dl.licensing.license_key={"organization_name":"XXXXXXXX","expiration_date_time":"YYYY-MM-DDTHH:mm:SS+TIMEZONE","product_name":"ScalarDL Ledger","product_version":N,"license_type":"trial","signature":"XXXXXXXX"}
##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) ##### -
To check the license, update the
sqlserver/docker-compose-ledger.yml
file as follows. If you're using a trial license, skip this step.-
Before changing the certificate file path (default configuration):
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
- ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
# - ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem -
After changing the certificate file path:
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
# - ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
- ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem
-
Start up ScalarDL
You can start ScalarDL Ledger by following the steps below:
-
Run SQL Server locally by running the following command:
docker compose -f sqlserver/docker-compose-ledger.yml up -d sqlserver
-
Load the database schema for ScalarDL Ledger by running the following command:
docker compose -f sqlserver/docker-compose-ledger.yml up -d scalardl-ledger-schema-loader
-
Run ScalarDL Ledger and its dependent components by running the following command:
docker compose -f sqlserver/docker-compose-ledger.yml up -d
Set up your license (Enterprise edition only)
If you're using the ScalarDL Enterprise edition, set up your license as follows. If you're using the Community edition, skip to the next section to start up ScalarDL.
See here to set up your license
-
Enable the container image for the Enterprise edition in the
dynamodb/docker-compose-ledger.yml
file as follows:-
Before changing the image (default configuration):
services:
scalardl-ledger:
image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
# image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION} -
After changing the image:
services:
scalardl-ledger:
# image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION}
-
-
Set your license key for ScalarDL Ledger. In the
dynamodb/ledger.properties
file, replace<SET_YOUR_LICENSE_KEY>
with your license key. For example:##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) #####
scalar.dl.licensing.license_key={"organization_name":"XXXXXXXX","expiration_date_time":"YYYY-MM-DDTHH:mm:SS+TIMEZONE","product_name":"ScalarDL Ledger","product_version":N,"license_type":"trial","signature":"XXXXXXXX"}
##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) ##### -
To check the license, update the
dynamodb/docker-compose-ledger.yml
file as follows. If you're using a trial license, skip this step.-
Before changing the certificate file path (default configuration):
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
- ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
# - ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem -
After changing the certificate file path:
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
# - ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
- ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem
-
Start up ScalarDL
You can start ScalarDL Ledger by following the steps below:
-
Run DynamoDB locally by running the following command:
docker compose -f dynamodb/docker-compose-ledger.yml up -d dynamodb
-
Load the database schema for ScalarDL Ledger by running the following command:
docker compose -f dynamodb/docker-compose-ledger.yml up -d scalardl-ledger-schema-loader
-
Run ScalarDL Ledger and its dependent components by running the following command:
docker compose -f dynamodb/docker-compose-ledger.yml up -d
Set up your license (Enterprise edition only)
If you're using the ScalarDL Enterprise edition, set up your license as follows. If you're using the Community edition, skip to the next section to start up ScalarDL.
See here to set up your license
-
Enable the Docker image for the Enterprise edition in the
cosmosdb/docker-compose-ledger.yml
file as follows:-
Before changing the image (default configuration):
services:
scalardl-ledger:
image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
# image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION} -
After changing the image:
services:
scalardl-ledger:
# image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION}
-
-
Set your license key for ScalarDL Ledger. In the
cosmosdb/ledger.properties
file, replace<SET_YOUR_LICENSE_KEY>
with your license key. For example:##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) #####
scalar.dl.licensing.license_key={"organization_name":"XXXXXXXX","expiration_date_time":"YYYY-MM-DDTHH:mm:SS+TIMEZONE","product_name":"ScalarDL Ledger","product_version":N,"license_type":"trial","signature":"XXXXXXXX"}
##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) ##### -
To check the license, update the
cosmosdb/docker-compose-ledger.yml
file as follows. If you're using a trial license, skip this step.-
Before changing the certificate file path (default configuration):
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
- ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
# - ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem -
After changing the certificate file path:
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
# - ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
- ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem
-
Start up ScalarDL
You can start ScalarDL Ledger by following the steps below:
-
Configure Cosmos DB for NoSQL.
To use Azure Cosmos DB for NoSQL, you must have an Azure account. If you don't have an Azure account, visit Create an Azure Cosmos DB account.
After setting up Cosmos DB for NoSQL, modify the following items in
cosmodb/ledger.properties
based on your configuration of Cosmos DB for NoSQL.scalar.db.contact_points=<COSMOS_DB_FOR_NOSQL_URI>
scalar.db.password=<COSMOS_DB_FOR_NOSQL_KEY> -
Load the database schema for ScalarDL Ledger by running the following command:
docker compose -f cosmosdb/docker-compose-ledger.yml up -d scalardl-ledger-schema-loader
-
Run ScalarDL Ledger by running the following command:
docker compose -f cosmosdb/docker-compose-ledger.yml up -d
Set up your license (Enterprise edition only)
If you're using the ScalarDL Enterprise edition, set up your license as follows. If you're using the Community edition, skip to the next section to start up ScalarDL.
See here to set up your license
-
Enable the container image for the Enterprise edition in the
cassandra/docker-compose-ledger.yml
file as follows:-
Before changing the image (default configuration):
services:
scalardl-ledger:
image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
# image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION} -
After changing the image:
services:
scalardl-ledger:
# image: ghcr.io/scalar-labs/scalardl-ledger:${SCALARDL_VERSION}
image: ghcr.io/scalar-labs/scalardl-ledger-byol:${SCALARDL_VERSION}
-
-
Set your license key for ScalarDL Ledger. In the
cassandra/ledger.properties
file, replace<SET_YOUR_LICENSE_KEY>
with your license key. For example:##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) #####
scalar.dl.licensing.license_key={"organization_name":"XXXXXXXX","expiration_date_time":"YYYY-MM-DDTHH:mm:SS+TIMEZONE","product_name":"ScalarDL Ledger","product_version":N,"license_type":"trial","signature":"XXXXXXXX"}
##### PLEASE REPLACE THIS VALUE WITH YOUR LICENSE KEY (ENTERPRISE EDITION ONLY) ##### -
To check the license, update the
cassandra/docker-compose-ledger.yml
file as follows. If you're using a trial license, skip this step.-
Before changing the certificate file path (default configuration):
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
- ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
# - ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem -
After changing the certificate file path:
services:
scalardl-ledger:
volumes:
- ./ledger.properties:/scalar/ledger/ledger.properties.tmpl
- ../fixture/ledger-key.pem:/scalar/ledger-key.pem
# - ../fixture/trial-license-cert.pem:/scalar/license-cert.pem
# If you have a commercial license key, you must use `commercial-license-cert.pem` instead of `trial-license-cert.pem`.
- ../fixture/commercial-license-cert.pem:/scalar/license-cert.pem
-
Start up ScalarDL
You can start ScalarDL Ledger by following the steps below:
-
Run Cassandra locally by running the following command:
docker compose -f cassandra/docker-compose-ledger.yml up -d cassandra
-
Load the database schema for ScalarDL Ledger by running the following command:
docker compose -f cassandra/docker-compose-ledger.yml up -d scalardl-ledger-schema-loader
-
Run ScalarDL Ledger and its dependent components by running the following command:
docker compose -f cassandra/docker-compose-ledger.yml up -d
Download the Client SDK
Next, you'll use the TableStore client tools. Specify a version that is the same as the deployed ScalarDL version and is used for downloading the tools by running the following command:
VERSION=$(grep SCALARDL_VERSION .env | awk -F= '{print $2}')
Then, download the tools by running the following command:
curl -OL https://github.com/scalar-labs/scalardl/releases/download/v$VERSION/scalardl-tablestore-java-client-sdk-$VERSION.zip
unzip scalardl-tablestore-java-client-sdk-$VERSION.zip
mv scalardl-tablestore-java-client-sdk-$VERSION client
Configure the client properties
Before interacting with TableStore, you need to configure the client. To create a configuration file with the minimum required properties for the client, run the following command:
cat << 'EOF' > client.properties
# A host name for ScalarDL Ledger.
scalar.dl.client.server.host=localhost
# An ID for the certificate holder. This must be configured for each private key and must be unique in the system.
scalar.dl.client.cert_holder_id=foo
# A path to the certificate file.
scalar.dl.client.cert_path=./fixture/client.pem
# A path to the private key file.
scalar.dl.client.private_key_path=./fixture/client-key.pem
EOF
You can use localhost
for the ScalarDL Ledger host name in this tutorial. For the private key and certificate, you can use the ones provided in the fixture
directory of the scalardl-samples
repository (client-key.pem
and client.pem
, respectively). For the certificate holder, any unique ID can be specified.
Do not use the sample private key and certificate in production environments. For details about getting your own certificate, see How to Get a Certificate.
Bootstrap
Next, you can bootstrap TableStore by running the following command:
client/bin/scalardl-tablestore bootstrap --properties client.properties
The bootstrap command internally registers identity information (a certificate or secret) and predefined contracts necessary to use TableStore.
Interact with TableStore
Now you can execute SQL statements with TableStore. In this section, you'll try the following functionalities through two sample tables (employee
and department
) that can be joined through the department IDs of employees: