Skip to content

Commit

Permalink
Clean up get started page, make guide use grid cards for scenarios an…
Browse files Browse the repository at this point in the history
…d data sources, add in unique validation documentation
  • Loading branch information
pflooky committed Oct 9, 2023
1 parent 725c044 commit 874d35c
Show file tree
Hide file tree
Showing 20 changed files with 220 additions and 155 deletions.
Binary file not shown.
4 changes: 4 additions & 0 deletions docs/diagrams/use_case_replicate_production.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 4 additions & 25 deletions docs/get-started/docker.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# Run Data Caterer

## Docker

### Quick start
## Quick start

Ensure you have `docker` installed and running.

Expand All @@ -12,33 +10,14 @@ git clone [email protected]:pflooky/data-caterer-example.git
#check results under docker/sample/report/index.html folder
```

#### Report
### Report

Check the report generated under `docker/data/custom/report/index.html`.

Sample report can also be seen [**here**](../sample/report/html/index.html)

### Guided tour
## Guided tour

Check out the started guide [**here**](../setup/guide/scenario/first-data-generation.md) that will take your through
Check out the starter guide [**here**](../setup/guide/scenario/first-data-generation.md) that will take your through
step by step. You can also check the other guides [**here**](../setup/guide/index.md) to see the other possibilities of
what Data Caterer can achieve for you.

### Other data sources

To run for another data source, you can run using `docker-compose` and set `DATA_SOURCE` like below

```shell
./gradlew build
cd docker
DATA_SOURCE=postgres docker-compose up -d datacaterer
```

Can set it to one of the following:

- postgres
- mysql
- cassandra
- solace
- kafka
- http
3 changes: 1 addition & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ Main features include:

---

Provide optionality for users on their preferred usage of the tool via either Scala, Java or YAML. Connect to data or
metadata sources to generate data and validate.
Can use the tool via either Scala, Java or YAML. Connect to data or metadata sources to generate data and validate.

- :material-run-fast: __Developer productivity tool__

Expand Down
5 changes: 3 additions & 2 deletions docs/setup/connection/connection.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ All connection details follow the same pattern.
```

!!! info "Overriding configuration"
When defining a configuration value that can be defined by a system property or environment variable at runtime, you can
define that via the following:

When defining a configuration value that can be defined by a system property or environment variable at runtime, you can
define that via the following:

```
url = "localhost"
url = ${?POSTGRES_URL}
Expand Down
41 changes: 35 additions & 6 deletions docs/setup/guide/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Guides

Below are a list of guides you can follow to create your data generation for your use case.

Checkout this [repo](https://github.com/pflooky/data-caterer-example) for example Java and Scala API usage.

## Java/Scala API
Expand All @@ -10,26 +10,34 @@ Checkout this [repo](https://github.com/pflooky/data-caterer-example) for exampl

!!! note "Free tier scenarios"

<div class="grid cards" markdown>

- __[First Data Generation]__ - If you are new, this is the place to start
- __[Multiple Records Per Column Value]__ - How you can generate multiple records per set of columns
- __[Foreign Keys Across Data Sources]__ - Generate matching values across generated data sets
- __[Data Validations]__ - (Soon to document) Run data validations after generating data

</div>

[First Data Generation]: scenario/first-data-generation.md
[Multiple Records Per Column Value]: scenario/records-per-column.md
[Foreign Keys Across Data Sources]: scenario/batch-and-event.md
[Data Validations]: scenario/first-data-generation.md

!!! example "Paid tier scenarios"

<div class="grid cards" markdown>

- __[Auto Generate From Data Connection]__ - Automatically generating data from just defining data sources
- __[Delete Generated Data]__ - Delete the generated data whilst leaving other data
- __[Generate Batch and Event Data]__ - Generate matching batch and event data

</div>

[Auto Generate From Data Connection]: scenario/auto-generate-connection.md
[Delete Generated Data]: scenario/delete-generated-data.md
[Generate Batch and Event Data]: scenario/batch-and-event.md

### Data Sources

!!! note "Free tier data sources"
Expand Down Expand Up @@ -68,10 +76,13 @@ Checkout this [repo](https://github.com/pflooky/data-caterer-example) for exampl

### Base Concept

The execution of the data generator is based on the concept of plans and tasks. A plan represent the set of tasks that need to be executed,
The execution of the data generator is based on the concept of plans and tasks. A plan represent the set of tasks that
need to be executed,
along with other information that spans across tasks, such as foreign keys between data sources.
A task represent the component(s) of a data source and its associated metadata so that it understands what the data should look like
and how many steps (sub data sources) there are (i.e. tables in a database, topics in Kafka). Tasks can define one or more steps.
A task represent the component(s) of a data source and its associated metadata so that it understands what the data
should look like
and how many steps (sub data sources) there are (i.e. tables in a database, topics in Kafka). Tasks can define one or
more steps.

### Plan

Expand All @@ -95,7 +106,25 @@ and how many steps (sub data sources) there are (i.e. tables in a database, topi
| JMS | Solace | [Sample](https://github.com/pflooky/data-caterer-example/blob/main/docker/data/custom/task/jms/solace/jms-account-task.yaml) | JSON formatted message |
| HTTP | PUT | [Sample](https://github.com/pflooky/data-caterer-example/blob/main/docker/data/custom/task/http/http-account-task.yaml) | JSON formatted PUT body |


### Configuration

[Basic configuration](https://github.com/pflooky/data-caterer-example/blob/main/docker/data/custom/application.conf)

## Docker-compose

To see how it runs against different data sources, you can run using `docker-compose` and set `DATA_SOURCE` like below

```shell
./gradlew build
cd docker
DATA_SOURCE=postgres docker-compose up -d datacaterer
```

Can set it to one of the following:

- postgres
- mysql
- cassandra
- solace
- kafka
- http
28 changes: 28 additions & 0 deletions docs/setup/validation/basic-validation.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,34 @@ Ensure all data in column does not contain certain string. Column has to have ty
- expr: "!CONTAINS(name, 'peter')"
```

## Unqiue

Ensure all data in column is unique.


=== "Java"

```java
validation().unique("account_id", "name")
```

=== "Scala"

```scala
validation.unique("account_id", "name")
```

=== "YAML"

```yaml
---
name: "account_checks"
dataSources:
...
validations:
- unique: ["account_id", "name"]
```

## Less Than

Ensure all data in column is less than certain value.
Expand Down
2 changes: 1 addition & 1 deletion docs/use-case/use-case.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ the following:
3. Validate data to ensure your system runs as expected
4. Clean up data to avoid build up of generated data

![Replicate production flow](../diagrams/use_case_replicate_production.drawio.png "Get latest schemas, generate data, validate and clean data")
![Replicate production flow](../diagrams/use_case_replicate_production.drawio.svg "Get latest schemas, generate data, validate and clean data")

## Local development

Expand Down
Binary file not shown.
4 changes: 4 additions & 0 deletions site/diagrams/use_case_replicate_production.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 6 additions & 50 deletions site/get-started/docker/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -465,18 +465,6 @@
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>

<li class="md-nav__item">
<a href="#docker" class="md-nav__link">
<span class="md-ellipsis">

Docker

</span>
</a>

<nav class="md-nav" aria-label="Docker">
<ul class="md-nav__list">

<li class="md-nav__item">
<a href="#quick-start" class="md-nav__link">
<span class="md-ellipsis">

Expand All @@ -503,8 +491,8 @@
</nav>

</li>
<li class="md-nav__item">

<li class="md-nav__item">
<a href="#guided-tour" class="md-nav__link">
<span class="md-ellipsis">

Expand All @@ -513,22 +501,6 @@
</span>
</a>

</li>

<li class="md-nav__item">
<a href="#other-data-sources" class="md-nav__link">
<span class="md-ellipsis">

Other data sources

</span>
</a>

</li>

</ul>
</nav>

</li>

</ul>
Expand Down Expand Up @@ -1785,35 +1757,19 @@


<h1 id="run-data-caterer">Run Data Caterer</h1>
<h2 id="docker">Docker</h2>
<h3 id="quick-start">Quick start</h3>
<h2 id="quick-start">Quick start</h2>
<p>Ensure you have <code>docker</code> installed and running.</p>
<div class="highlight"><pre><span></span><code>git<span class="w"> </span>clone<span class="w"> </span>[email protected]:pflooky/data-caterer-example.git
./run.sh
<span class="c1">#check results under docker/sample/report/index.html folder</span>
</code></pre></div>
<h4 id="report">Report</h4>
<h3 id="report">Report</h3>
<p>Check the report generated under <code>docker/data/custom/report/index.html</code>.</p>
<p>Sample report can also be seen <a href="../../sample/report/html/"><strong>here</strong></a></p>
<h3 id="guided-tour">Guided tour</h3>
<p>Check out the started guide <a href="../../setup/guide/scenario/first-data-generation/"><strong>here</strong></a> that will take your through
<h2 id="guided-tour">Guided tour</h2>
<p>Check out the starter guide <a href="../../setup/guide/scenario/first-data-generation/"><strong>here</strong></a> that will take your through
step by step. You can also check the other guides <a href="../../setup/guide/"><strong>here</strong></a> to see the other possibilities of
what Data Caterer can achieve for you.</p>
<h3 id="other-data-sources">Other data sources</h3>
<p>To run for another data source, you can run using <code>docker-compose</code> and set <code>DATA_SOURCE</code> like below</p>
<div class="highlight"><pre><span></span><code>./gradlew<span class="w"> </span>build
<span class="nb">cd</span><span class="w"> </span>docker
<span class="nv">DATA_SOURCE</span><span class="o">=</span>postgres<span class="w"> </span>docker-compose<span class="w"> </span>up<span class="w"> </span>-d<span class="w"> </span>datacaterer
</code></pre></div>
<p>Can set it to one of the following:</p>
<ul>
<li>postgres</li>
<li>mysql</li>
<li>cassandra</li>
<li>solace</li>
<li>kafka</li>
<li>http</li>
</ul>



Expand Down
3 changes: 1 addition & 2 deletions site/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1822,8 +1822,7 @@ <h2 id="what-is-it">What is it</h2>
<li>
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.59 3.41 2 8l4.59 4.6L8 11.18 4.82 8 8 4.82 6.59 3.41m5.82 0L11 4.82 14.18 8 11 11.18l1.41 1.42L17 8l-4.59-4.59m9.18 8.18-8.09 8.09L9.83 16l-1.41 1.41 5.08 5.09L23 13l-1.41-1.41Z"/></svg></span> <strong>Low/no code solution</strong></p>
<hr />
<p>Provide optionality for users on their preferred usage of the tool via either Scala, Java or YAML. Connect to data or
metadata sources to generate data and validate.</p>
<p>Can use the tool via either Scala, Java or YAML. Connect to data or metadata sources to generate data and validate.</p>
</li>
<li>
<p><span class="twemoji"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M16.5 5.5a2 2 0 0 0 2-2 2 2 0 0 0-2-2 2 2 0 0 0-2 2 2 2 0 0 0 2 2m-3.6 13.9 1-4.4 2.1 2v6h2v-7.5l-2.1-2 .6-3A7.298 7.298 0 0 0 22 13v-2c-1.76.03-3.4-.89-4.3-2.4l-1-1.6c-.36-.6-1-1-1.7-1-.3 0-.5.1-.8.1L9 8.3V13h2V9.6l1.8-.7-1.6 8.1-4.9-1-.4 2 7 1.4M4 9a1 1 0 0 1-1-1 1 1 0 0 1 1-1h3v2H4m1-4a1 1 0 0 1-1-1 1 1 0 0 1 1-1h5v2H5m-2 8a1 1 0 0 1-1-1 1 1 0 0 1 1-1h4v2H3Z"/></svg></span> <strong>Developer productivity tool</strong></p>
Expand Down
2 changes: 1 addition & 1 deletion site/search/search_index.json

Large diffs are not rendered by default.

13 changes: 5 additions & 8 deletions site/setup/connection/connection/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2034,17 +2034,14 @@ <h3 id="configuration-file">Configuration file</h3>
</code></pre></div>
<div class="admonition info">
<p class="admonition-title">Overriding configuration</p>
</div>
<p>When defining a configuration value that can be defined by a system property or environment variable at runtime, you can
define that via the following:</p>
<pre><code>```
url = "localhost"
<div class="highlight"><pre><span></span><code>url = &quot;localhost&quot;
url = ${?POSTGRES_URL}
```

The above defines that if there is a system property or environment variable named `POSTGRES_URL`, then that value will
be used for the `url`, otherwise, it will default to `localhost`.
</code></pre>
</code></pre></div>
<p>The above defines that if there is a system property or environment variable named <code>POSTGRES_URL</code>, then that value will
be used for the <code>url</code>, otherwise, it will default to <code>localhost</code>.</p>
</div>
<h2 id="data-sources">Data sources</h2>
<p>To find examples of a task for each type of data source, please check out <a href="../../guide/">this page</a>.</p>
<h3 id="file">File</h3>
Expand Down
Loading

0 comments on commit 874d35c

Please sign in to comment.