Skip to content

Commit

Permalink
Merge pull request #67 from scalar-labs/add-updated-oss-samples
Browse files Browse the repository at this point in the history
Add updated samples docs for ScalarDB and ScalarDB with support for microservice and multi-storage transactions
  • Loading branch information
josh-wong authored Oct 25, 2023
2 parents 6447884 + f46f0bf commit 2decac0
Show file tree
Hide file tree
Showing 21 changed files with 63 additions and 77 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This tutorial describes how to create a sample application that supports microse

## Overview

The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample) but takes advantage of [transactions with a two-phase commit interface](https://github.com/scalar-labs/scalardb/tree/master/docs/two-phase-commit-transactions.md) when using ScalarDB.
The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample/README.md) but takes advantage of [transactions with a two-phase commit interface](https://github.com/scalar-labs/scalardb/tree/master/docs/two-phase-commit-transactions.md) when using ScalarDB.

The sample application has two microservices called the *Customer Service* and the *Order Service* based on the [database-per-service pattern](https://microservices.io/patterns/data/database-per-service.html):

Expand Down Expand Up @@ -155,7 +155,7 @@ The Entity Relationship Diagram for the schema is as follows:

![ERD](images/ERD.png)

## Load the initial data by starting the microservices
### Load the initial data by starting the microservices

Before starting the microservices, build the Docker images of the sample application by running the following command:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This tutorial describes how to create a sample application that supports the mul

## Overview

The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample) but takes advantage of the [multi-storage transactions](https://github.com/scalar-labs/scalardb/blob/master/docs/multi-storage-transactions.md) feature in ScalarDB.
The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample/README.md) but takes advantage of the [multi-storage transactions](https://github.com/scalar-labs/scalardb/blob/master/docs/multi-storage-transactions.md) feature in ScalarDB.

In this tutorial, you will build an application that uses both Cassandra and MySQL. By using the multi-storage transactions feature in ScalarDB, you can execute a transaction that spans both Cassandra and MySQL.

Expand Down Expand Up @@ -306,7 +306,6 @@ You should see a similar output as below, with a different UUID for `order_id`,
```console
...
{"order_id": "8911cab3-1c2b-4322-9386-adb1c024e078"}
The balance for merchant1 is 100
...
```

Expand Down
13 changes: 6 additions & 7 deletions docs/3.10/scalardb-samples/scalardb-sample/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Create a Sample Application by Using ScalarDB
# Create a Sample Application That Uses ScalarDB

This tutorial describes how to create a sample e-commerce application by using ScalarDB.

Expand Down Expand Up @@ -68,7 +68,7 @@ $ cd scalardb-samples/scalardb-sample

### Start Cassandra

Cassandra is already configured for the sample application, as shown in [**database.properties**](database.properties).
Cassandra is already configured for the sample application, as shown in [`database.properties`](database.properties).

To start Cassandra, which is included in the Docker container for the sample application, make sure Docker is running and then run the following command:

Expand All @@ -86,19 +86,19 @@ Starting the Docker container may take more than one minute depending on your de

### Load the schema

The database schema (the method in which the data will be organized) for the sample application has already been defined in [**schema.json**](schema.json).
The database schema (the method in which the data will be organized) for the sample application has already been defined in [`schema.json`](schema.json).

To apply the schema, go to the [`scalardb` Releases](https://github.com/scalar-labs/scalardb/releases) page and download the ScalarDB Schema Loader that matches the version of ScalarDB that you want to use to the `scalardb-samples/scalardb-sample` folder.
To apply the schema, go to the [ScalarDB Releases](https://github.com/scalar-labs/scalardb/releases) page and download the ScalarDB Schema Loader that matches the version of ScalarDB that you want to use to the `scalardb-samples/scalardb-sample` folder.

Then, run the following command, replacing `<VERSION>` with the version of the ScalarDB Schema Loader that you downloaded:

```console
$ java -jar scalardb-schema-loader-<VERSION>.jar --config database.properties --schema-file schema.json --coordinator
```

#### Schema reference
#### Schema details

As shown in [**schema.json**](schema.json) for the sample application, all the tables are created in the `sample` namespace.
As shown in [`schema.json`](schema.json) for the sample application, all the tables are created in the `sample` namespace.

- `sample.customers`: a table that manages customer information
- `credit_limit`: the maximum amount of money that the lender will allow the customer to spend from their line of credit
Expand Down Expand Up @@ -306,7 +306,6 @@ You should see a similar output as below, with a different UUID for `order_id`,
```
...
{"order_id": "8911cab3-1c2b-4322-9386-adb1c024e078"}
The balance for merchant1 is 100
...
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This tutorial describes how to create a sample application that supports microse

## Overview

The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample) but takes advantage of [transactions with a two-phase commit interface](https://github.com/scalar-labs/scalardb/tree/master/docs/two-phase-commit-transactions.md) when using ScalarDB.
The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample/README.md) but takes advantage of [transactions with a two-phase commit interface](https://github.com/scalar-labs/scalardb/tree/master/docs/two-phase-commit-transactions.md) when using ScalarDB.

The sample application has two microservices called the *Customer Service* and the *Order Service* based on the [database-per-service pattern](https://microservices.io/patterns/data/database-per-service.html):

Expand Down Expand Up @@ -155,7 +155,7 @@ The Entity Relationship Diagram for the schema is as follows:

![ERD](images/ERD.png)

## Load the initial data by starting the microservices
### Load the initial data by starting the microservices

Before starting the microservices, build the Docker images of the sample application by running the following command:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This tutorial describes how to create a sample application that supports the mul

## Overview

The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample) but takes advantage of the [multi-storage transactions](https://github.com/scalar-labs/scalardb/blob/master/docs/multi-storage-transactions.md) feature in ScalarDB.
The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample/README.md) but takes advantage of the [multi-storage transactions](https://github.com/scalar-labs/scalardb/blob/master/docs/multi-storage-transactions.md) feature in ScalarDB.

In this tutorial, you will build an application that uses both Cassandra and MySQL. By using the multi-storage transactions feature in ScalarDB, you can execute a transaction that spans both Cassandra and MySQL.

Expand Down Expand Up @@ -306,7 +306,6 @@ You should see a similar output as below, with a different UUID for `order_id`,
```console
...
{"order_id": "8911cab3-1c2b-4322-9386-adb1c024e078"}
The balance for merchant1 is 100
...
```

Expand Down
13 changes: 6 additions & 7 deletions docs/3.5/scalardb-samples/scalardb-sample/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Create a Sample Application by Using ScalarDB
# Create a Sample Application That Uses ScalarDB

This tutorial describes how to create a sample e-commerce application by using ScalarDB.

Expand Down Expand Up @@ -68,7 +68,7 @@ $ cd scalardb-samples/scalardb-sample

### Start Cassandra

Cassandra is already configured for the sample application, as shown in [**database.properties**](database.properties).
Cassandra is already configured for the sample application, as shown in [`database.properties`](database.properties).

To start Cassandra, which is included in the Docker container for the sample application, make sure Docker is running and then run the following command:

Expand All @@ -86,19 +86,19 @@ Starting the Docker container may take more than one minute depending on your de

### Load the schema

The database schema (the method in which the data will be organized) for the sample application has already been defined in [**schema.json**](schema.json).
The database schema (the method in which the data will be organized) for the sample application has already been defined in [`schema.json`](schema.json).

To apply the schema, go to the [`scalardb` Releases](https://github.com/scalar-labs/scalardb/releases) page and download the ScalarDB Schema Loader that matches the version of ScalarDB that you want to use to the `scalardb-samples/scalardb-sample` folder.
To apply the schema, go to the [ScalarDB Releases](https://github.com/scalar-labs/scalardb/releases) page and download the ScalarDB Schema Loader that matches the version of ScalarDB that you want to use to the `scalardb-samples/scalardb-sample` folder.

Then, run the following command, replacing `<VERSION>` with the version of the ScalarDB Schema Loader that you downloaded:

```console
$ java -jar scalardb-schema-loader-<VERSION>.jar --config database.properties --schema-file schema.json --coordinator
```

#### Schema reference
#### Schema details

As shown in [**schema.json**](schema.json) for the sample application, all the tables are created in the `sample` namespace.
As shown in [`schema.json`](schema.json) for the sample application, all the tables are created in the `sample` namespace.

- `sample.customers`: a table that manages customer information
- `credit_limit`: the maximum amount of money that the lender will allow the customer to spend from their line of credit
Expand Down Expand Up @@ -306,7 +306,6 @@ You should see a similar output as below, with a different UUID for `order_id`,
```
...
{"order_id": "8911cab3-1c2b-4322-9386-adb1c024e078"}
The balance for merchant1 is 100
...
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This tutorial describes how to create a sample application that supports microse

## Overview

The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample) but takes advantage of [transactions with a two-phase commit interface](https://github.com/scalar-labs/scalardb/tree/master/docs/two-phase-commit-transactions.md) when using ScalarDB.
The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample/README.md) but takes advantage of [transactions with a two-phase commit interface](https://github.com/scalar-labs/scalardb/tree/master/docs/two-phase-commit-transactions.md) when using ScalarDB.

The sample application has two microservices called the *Customer Service* and the *Order Service* based on the [database-per-service pattern](https://microservices.io/patterns/data/database-per-service.html):

Expand Down Expand Up @@ -155,7 +155,7 @@ The Entity Relationship Diagram for the schema is as follows:

![ERD](images/ERD.png)

## Load the initial data by starting the microservices
### Load the initial data by starting the microservices

Before starting the microservices, build the Docker images of the sample application by running the following command:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This tutorial describes how to create a sample application that supports the mul

## Overview

The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample) but takes advantage of the [multi-storage transactions](https://github.com/scalar-labs/scalardb/blob/master/docs/multi-storage-transactions.md) feature in ScalarDB.
The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample/README.md) but takes advantage of the [multi-storage transactions](https://github.com/scalar-labs/scalardb/blob/master/docs/multi-storage-transactions.md) feature in ScalarDB.

In this tutorial, you will build an application that uses both Cassandra and MySQL. By using the multi-storage transactions feature in ScalarDB, you can execute a transaction that spans both Cassandra and MySQL.

Expand Down Expand Up @@ -306,7 +306,6 @@ You should see a similar output as below, with a different UUID for `order_id`,
```console
...
{"order_id": "8911cab3-1c2b-4322-9386-adb1c024e078"}
The balance for merchant1 is 100
...
```

Expand Down
13 changes: 6 additions & 7 deletions docs/3.6/scalardb-samples/scalardb-sample/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Create a Sample Application by Using ScalarDB
# Create a Sample Application That Uses ScalarDB

This tutorial describes how to create a sample e-commerce application by using ScalarDB.

Expand Down Expand Up @@ -68,7 +68,7 @@ $ cd scalardb-samples/scalardb-sample

### Start Cassandra

Cassandra is already configured for the sample application, as shown in [**database.properties**](database.properties).
Cassandra is already configured for the sample application, as shown in [`database.properties`](database.properties).

To start Cassandra, which is included in the Docker container for the sample application, make sure Docker is running and then run the following command:

Expand All @@ -86,19 +86,19 @@ Starting the Docker container may take more than one minute depending on your de

### Load the schema

The database schema (the method in which the data will be organized) for the sample application has already been defined in [**schema.json**](schema.json).
The database schema (the method in which the data will be organized) for the sample application has already been defined in [`schema.json`](schema.json).

To apply the schema, go to the [`scalardb` Releases](https://github.com/scalar-labs/scalardb/releases) page and download the ScalarDB Schema Loader that matches the version of ScalarDB that you want to use to the `scalardb-samples/scalardb-sample` folder.
To apply the schema, go to the [ScalarDB Releases](https://github.com/scalar-labs/scalardb/releases) page and download the ScalarDB Schema Loader that matches the version of ScalarDB that you want to use to the `scalardb-samples/scalardb-sample` folder.

Then, run the following command, replacing `<VERSION>` with the version of the ScalarDB Schema Loader that you downloaded:

```console
$ java -jar scalardb-schema-loader-<VERSION>.jar --config database.properties --schema-file schema.json --coordinator
```

#### Schema reference
#### Schema details

As shown in [**schema.json**](schema.json) for the sample application, all the tables are created in the `sample` namespace.
As shown in [`schema.json`](schema.json) for the sample application, all the tables are created in the `sample` namespace.

- `sample.customers`: a table that manages customer information
- `credit_limit`: the maximum amount of money that the lender will allow the customer to spend from their line of credit
Expand Down Expand Up @@ -306,7 +306,6 @@ You should see a similar output as below, with a different UUID for `order_id`,
```
...
{"order_id": "8911cab3-1c2b-4322-9386-adb1c024e078"}
The balance for merchant1 is 100
...
```

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This tutorial describes how to create a sample application that supports microse

## Overview

The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample) but takes advantage of [transactions with a two-phase commit interface](https://github.com/scalar-labs/scalardb/tree/master/docs/two-phase-commit-transactions.md) when using ScalarDB.
The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample/README.md) but takes advantage of [transactions with a two-phase commit interface](https://github.com/scalar-labs/scalardb/tree/master/docs/two-phase-commit-transactions.md) when using ScalarDB.

The sample application has two microservices called the *Customer Service* and the *Order Service* based on the [database-per-service pattern](https://microservices.io/patterns/data/database-per-service.html):

Expand Down Expand Up @@ -155,7 +155,7 @@ The Entity Relationship Diagram for the schema is as follows:

![ERD](images/ERD.png)

## Load the initial data by starting the microservices
### Load the initial data by starting the microservices

Before starting the microservices, build the Docker images of the sample application by running the following command:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ This tutorial describes how to create a sample application that supports the mul

## Overview

The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample) but takes advantage of the [multi-storage transactions](https://github.com/scalar-labs/scalardb/blob/master/docs/multi-storage-transactions.md) feature in ScalarDB.
The sample e-commerce application shows how users can order and pay for items by using a line of credit. The use case described in this tutorial is the same as the basic [ScalarDB sample](../scalardb-sample/README.md) but takes advantage of the [multi-storage transactions](https://github.com/scalar-labs/scalardb/blob/master/docs/multi-storage-transactions.md) feature in ScalarDB.

In this tutorial, you will build an application that uses both Cassandra and MySQL. By using the multi-storage transactions feature in ScalarDB, you can execute a transaction that spans both Cassandra and MySQL.

Expand Down Expand Up @@ -306,7 +306,6 @@ You should see a similar output as below, with a different UUID for `order_id`,
```console
...
{"order_id": "8911cab3-1c2b-4322-9386-adb1c024e078"}
The balance for merchant1 is 100
...
```

Expand Down
Loading

0 comments on commit 2decac0

Please sign in to comment.