Skip to content

Commit

Permalink
docs: fix broken links (#6959)
Browse files Browse the repository at this point in the history
Fixes #6933
  • Loading branch information
hassankhan authored Aug 1, 2023
1 parent bd12783 commit 682f8e1
Show file tree
Hide file tree
Showing 95 changed files with 1,031 additions and 1,014 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ when data outside the last partition can be updated.
[ref-intro]: /product/introduction
[ref-caching]: /product/caching
[ref-pre-agg-refresh-key]:
/product/data-modeling/reference/pre-aggregations#parameters-refresh-key
/product/data-modeling/reference/pre-aggregations#refresh_key
[ref-config-apis]: /product/configuration/visualization-tools#ap-is-references
[ref-caching-using-pre-aggs]: /product/caching/getting-started-pre-aggregations
[ref-query-history]: /product/workspace/query-history
Expand Down
22 changes: 11 additions & 11 deletions docs/docs-new/pages/guides/examples.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,15 @@ The following tutorials cover advanced concepts of Cube:

Learn more about prominent features of Cube:

| Feature | Story | Demo |
| :-------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- | :------------------------------------------------ |
| [Drill downs](https://cube.dev/docs/schema/fundamentals/additional-concepts#drilldowns) | [Introducing a drill down table API](https://cube.dev/blog/introducing-a-drill-down-table-api-in-cubejs/) | [Demo](https://drill-downs-demo.cube.dev) |
| [Compare date range](https://cube.dev/docs/query-format#time-dimensions-format) | [Comparing data over different time periods](https://cube.dev/blog/comparing-data-over-different-time-periods/) | [Demo](https://compare-date-range-demo.cube.dev) |
| [Data blending](https://cube.dev/docs/recipes/data-blending) | [Introducing data blending API](https://cube.dev/blog/introducing-data-blending-api/) | [Demo](https://data-blending-demo.cube.dev) |
| [Real-time data fetch](https://cube.dev/docs/real-time-data-fetch) | [Real-time dashboard guide](https://real-time-dashboard.cube.dev) | [Demo](https://real-time-dashboard-demo.cube.dev) |
| [Dynamic data model](https://cube.dev/docs/dynamic-schema-creation) | [Using asyncModule to generate schemas](https://github.com/cube-js/cube/tree/master/examples/async-module-simple) ||
| [Authentication](https://cube.dev/docs/security#using-json-web-key-sets-jwks) | [Auth0 integration](https://github.com/cube-js/cube/tree/master/examples/auth0) ||
| [Authentication](https://cube.dev/docs/security#using-json-web-key-sets-jwks) | [AWS Cognito integration](https://github.com/cube-js/cube/tree/master/examples/cognito) ||
| Feature | Story | Demo |
| :-------------------------------------------------------------------------------------------- | :---------------------------------------------------------------------------------------------------------------- | :------------------------------------------------ |
| [Drill downs](/product/data-modeling/fundamentals/additional-concepts#drilldowns) | [Introducing a drill down table API](https://cube.dev/blog/introducing-a-drill-down-table-api-in-cubejs/) | [Demo](https://drill-downs-demo.cube.dev) |
| [Compare date range](/product/apis-integrations/rest-api/query-format#time-dimensions-format) | [Comparing data over different time periods](https://cube.dev/blog/comparing-data-over-different-time-periods/) | [Demo](https://compare-date-range-demo.cube.dev) |
| [Data blending](/product/data-modeling/advanced/data-blending) | [Introducing data blending API](https://cube.dev/blog/introducing-data-blending-api/) | [Demo](https://data-blending-demo.cube.dev) |
| [Real-time data fetch](/product/apis-integrations/rest-api/real-time-data-fetch) | [Real-time dashboard guide](https://real-time-dashboard.cube.dev) | [Demo](https://real-time-dashboard-demo.cube.dev) |
| [Dynamic data model](/product/data-modeling/advanced/dynamic-schema-creation) | [Using asyncModule to generate schemas](https://github.com/cube-js/cube/tree/master/examples/async-module-simple) ||
| [Authentication](/product/auth#using-json-web-key-sets-jwks) | [Auth0 integration](https://github.com/cube-js/cube/tree/master/examples/auth0) ||
| [Authentication](/product/auth#using-json-web-key-sets-jwks) | [AWS Cognito integration](https://github.com/cube-js/cube/tree/master/examples/cognito) ||

### Front-end integrations

Expand All @@ -75,6 +75,6 @@ Have a look at some demo applications you can build with Cube:
| [Hacktoberfest 2020](https://hacktoberfest.cube.dev) | [Hacktoberfest 2020 in insights and statistics](https://dev.to/igorlukanin/hacktoberfest-2020-in-insights-and-statistics-3m57) |

Cube integrates with all kinds of
[data sources](https://cube.dev/docs/config/databases) and data
[visualization tools](https://cube.dev/docs/config/downstream). You can
[data sources](/product/configuration/data-sources) and data
[visualization tools](/product/configuration/visualization-tools). You can
[find](https://cube.dev/for) more easy-step guides to get started with Cube.
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ products. A supplier can't see other supplier's products.
## Data modeling

To implement column-based access, we will use supplier's email from a
[JSON Web Token](https://cube.dev/docs/security), and the
[`queryRewrite`](https://cube.dev/docs/security/context#using-query-rewrite)
extension point to manage data access.
[JSON Web Token](/product/auth), and the
[`queryRewrite`](/product/auth/context#using-queryrewrite) extension point to
manage data access.

We have `products` and `suppliers` cubes with a `many_to_one` relationship from
products to suppliers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ learn how to add mandatory filters to all queries.
## Configuration

To enforce mandatory filters we'll use the
[`queryRewrite`](https://cube.dev/docs/security/context#using-query-rewrite)
parameter in the `cube.js` configuration file.
[`queryRewrite`](/product/auth/context#using-queryrewrite) parameter in the
`cube.js` configuration file.

To solve this, we add a filter that will apply to all queries. This will make
sure we only show orders created after December 30th, 2019.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ from a shop and a `manager` can only view shipped and completed orders.

## Configuration

To implement role-based access, we will use a
[JSON Web Token](https://cube.dev/docs/security) with role information in the
payload, and the
[`queryRewrite`](https://cube.dev/docs/security/context#using-query-rewrite)
extension point to manage data access.
To implement role-based access, we will use a [JSON Web Token](/product/auth)
with role information in the payload, and the
[`queryRewrite`](/product/auth/context#using-queryrewrite) extension point to
manage data access.

Let's add the role verification in the `cube.js` file.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,16 @@ model/
```

Let's configure Cube to use a specific data model path for each tenant. We'll
pass the tenant name as a part of
[`securityContext`](https://cube.dev/docs/security/context#top) into the
[`repositoryFactory`](https://cube.dev/docs/config#repository-factory) function.
pass the tenant name as a part of [`securityContext`](/product/auth/context#top)
into the
[`repositoryFactory`](/reference/configuration/config#repositoryfactory)
function.

We'll also need to override the
[`contextToAppId`](https://cube.dev/docs/config#context-to-app-id) function to
[`contextToAppId`](/reference/configuration/config#contexttoappid) function to
control how the data model compilation result is cached and provide the tenant
names via the
[`scheduledRefreshContexts`](https://cube.dev/docs/config#scheduled-refresh-contexts)
[`scheduledRefreshContexts`](/reference/configuration/config#scheduledrefreshcontexts)
function so a refresh worker can find all existing data models and build
pre-aggregations for them, if needed.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ basic metrics. For example, the WAU to MAU ratio, which we can add by using
already defined `weekly_active_users` and `monthly_active_users`.

To calculate daily, weekly, or monthly active users we’re going to use the
[`rolling_window`](https://cube.dev/docs/schema/reference/measures#parameters-rolling-window)
[`rolling_window`](/product/data-modeling/reference/measures#rolling_window)
measure parameter.

<CodeTabs>
Expand Down
2 changes: 1 addition & 1 deletion docs/docs-new/pages/guides/recipes/analytics/funnels.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,4 @@ cube(`PurchaseFunnel`, {
[ref-partitioned-rollups]:
/product/caching/using-pre-aggregations#time-partitioning
[ref-schema-ref-preaggs-origsql]:
/product/data-modeling/reference/pre-aggregations#type-originalsql
/product/data-modeling/reference/pre-aggregations#original_sql
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ exports.fetchStatuses = async () => {
In the cube file, we will use the `fetchStatuses` function to load the list of
statuses. We will also wrap the cube definition with the `asyncModule` built-in
function that allows the data model to be created
[dynamically](https://cube.dev/docs/schema/advanced/dynamic-schema-creation).
[dynamically](/product/data-modeling/advanced/dynamic-schema-creation).

```javascript
const fetchStatuses = require("../fetch").fetchStatuses;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ information about users, including their age:
```

Calculating the average age is as simple as defining a measure with the built-in
[`avg` type](https://cube.dev/docs/schema/reference/types-and-formats#measures-types-avg).
[`avg` type](/product/data-modeling/reference/types-and-formats#avg).
Calculating the percentiles would require using database-specific functions.
However, almost every database has them under names of `PERCENTILE_CONT` and
`PERCENTILE_DISC`,
Expand Down
10 changes: 5 additions & 5 deletions docs/docs-new/pages/guides/recipes/data-modeling/snapshots.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ in BigQuery.
</InfoBox>

Please note that it makes sense to make the `status_snapshots` cube
[extend](https://cube.dev/docs/schema/reference/cube#parameters-extends) the
original `statuses` cube in order to reuse the dimension definitions. We only
need to add a new dimension that indicates the `date` of a snapshot. We're also
referencing the definition of the `statuses` cube with the
[`sql()` property](https://cube.dev/docs/schema/reference/cube#parameters-sql).
[extend](/product/data-modeling/reference/cube#extends) the original `statuses`
cube in order to reuse the dimension definitions. We only need to add a new
dimension that indicates the `date` of a snapshot. We're also referencing the
definition of the `statuses` cube with the
[`sql()` property](/product/data-modeling/reference/cube#sql).

## Query

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ the local database (bootstrapped in the `docker-compose.yml` file) which has the
same data model.

To enable multitenancy, use the
[`contextToAppId`](https://cube.dev/docs/config#options-reference-context-to-app-id)
function to provide distinct identifiers for each tenant. Also, implement the
[`driverFactory`](https://cube.dev/docs/config#options-reference-driver-factory)
function where you can select a data source based on the tenant name.
[JSON Web Token](https://cube.dev/docs/security) includes information about the
tenant name in the `tenant` property of the `securityContext`.
[`contextToAppId`](/reference/configuration/config#contexttoappid) function to
provide distinct identifiers for each tenant. Also, implement the
[`driverFactory`](/reference/configuration/config#driverfactory) function where
you can select a data source based on the tenant name.
[JSON Web Token](/product/auth) includes information about the tenant name in
the `tenant` property of the `securityContext`.

```javascript
module.exports = {
Expand Down
2 changes: 1 addition & 1 deletion docs/docs-new/pages/guides/recipes/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ These recipes will show you the best practices of using Cube.

### Data modeling

- [Calculating average and percentiles](https://cube.dev/docs/recipes/percentiles)
- [Calculating average and percentiles](/guides/recipes/data-modeling/percentiles)
- [Implementing data snapshots](/guides/recipes/data-modeling/snapshots)
- [Implementing Entity-Attribute-Value model](/guides/recipes/data-modeling/entity-attribute-value)
- [Using different data models for tenants](/guides/recipes/access-control/using-different-schemas-for-tenants)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ redirect_from:
We have a dashboard with information about the users, and we'd like to filter
them by city. To do so, we need to display all unique values for cities in the
dropdown. In the recipe below, we'll learn how to get unique values for
[dimensions](https://cube.dev/docs/schema/reference/dimensions).
[dimensions](/product/data-modeling/reference/dimensions).

## Data modeling

Expand Down Expand Up @@ -90,7 +90,7 @@ dropdown on the dashboard:

In case we need to choose a dimension or render dropdowns for all dimensions, we
can fetch the list of dimensions for all cubes from the
[`/meta` endpoint](https://cube.dev/docs/rest-api#api-reference-v-1-meta):
[`/meta` endpoint](/reference/rest-api#v1meta):

```bash{promptUser: user}
curl http://localhost:4000/cubejs-api/v1/meta
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ used to apply the build ranges as defined by `build_range_start` and
`build_range_end`.

[ref-schema-ref-preagg-buildrange]:
/product/data-modeling/reference/pre-aggregations#parameters-build-range-start-and-build-range-end
/product/data-modeling/reference/pre-aggregations#build_range_start-and-build_range_end
[ref-schema-ref-cube-filterparam]:
/product/data-modeling/reference/cube#filter-params
[self-config-aws-athena]: /config/databases/aws-athena/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ redirect_from:
Let's imagine we store information about products and their suppliers in
separate databases. We want to aggregate data from these data sources while
having decent performance. In the recipe below, we'll learn how to create a
[rollup join](https://cube.dev/docs/schema/reference/pre-aggregations#parameters-type-rollupjoin)
[rollup join](/product/data-modeling/reference/pre-aggregations#rollup_join)
between two databases to achieve our goal.

## Configuration
Expand Down Expand Up @@ -51,7 +51,7 @@ module.exports = {
## Data modeling

First, we'll define
[rollup](https://cube.dev/docs/schema/reference/pre-aggregations#parameters-type-rollup)
[rollup](/product/data-modeling/reference/pre-aggregations#rollup)
pre-aggregations for `products` and `suppliers`. Note that these
pre-aggregations should contain the dimension on which they're joined. In this
case, it's the `supplier_id` dimension in the `products` cube, and the `id`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ redirect_from:
## Use case

We want to run queries against
[pre-aggregations](https://cube.dev/docs/caching#pre-aggregations) only to
ensure our application's superior performance. Usually, accelerating a query is
as simple as including its measures and dimensions to the pre-aggregation
[definition](https://cube.dev/docs/schema/reference/pre-aggregations#parameters-measures).
[pre-aggregations](/product/caching#pre-aggregations) only to ensure our
application's superior performance. Usually, accelerating a query is as simple
as including its measures and dimensions to the pre-aggregation
[definition](/product/data-modeling/reference/pre-aggregations#measures).

[Non-additive](https://cube.dev/docs/caching/pre-aggregations/getting-started#ensuring-pre-aggregations-are-targeted-by-queries-non-additivity)
[Non-additive](/product/caching/getting-started-pre-aggregations#ensuring-pre-aggregations-are-targeted-by-queries-non-additivity)
measures (e.g., average values or distinct counts) are a special case.
Pre-aggregations with such measures are less likely to be
[selected](https://cube.dev/docs/caching/pre-aggregations/getting-started#ensuring-pre-aggregations-are-targeted-by-queries-selecting-the-pre-aggregation)
[selected](/product/caching/getting-started-pre-aggregations#ensuring-pre-aggregations-are-targeted-by-queries-selecting-the-pre-aggregation)
to accelerate a query. However, there are a few ways to work around that.

## Data modeling
Expand All @@ -26,7 +26,7 @@ age:

- count of unique age values (`distinct_ages`)
- average age (`avg_age`)
- 90th [percentile](https://cube.dev/docs/recipes/percentiles) of age
- 90th [percentile](/guides/recipes/data-modeling/percentiles) of age
(`p90_age`)

<CodeTabs>
Expand Down Expand Up @@ -131,7 +131,7 @@ Let's explore some possible workarounds.
### Replacing with approximate additive measures

Often, non-additive `count_distinct` measures can be changed to have the
[`count_distinct_approx` type](https://cube.dev/docs/schema/reference/types-and-formats#measures-types-count-distinct-approx)
[`count_distinct_approx` type](/product/data-modeling/reference/types-and-formats#count_distinct_approx)
which will make them additive and orders of magnitude more performant. This
`count_distinct_approx` measures can be used in pre-aggregations. However, there
are two drawbacks:
Expand Down Expand Up @@ -172,7 +172,7 @@ cube(`users`, {
### Decomposing into a formula with additive measures

Non-additive `avg` measures can be rewritten as
[calculated measures](https://cube.dev/docs/schema/reference/measures#calculated-measures)
[calculated measures](/product/data-modeling/reference/measures#calculated-measures)
that reference additive measures only. Then, this additive measures can be used
in pre-aggregations. Please note, however, that you shouldn't include `avg_age`
measure in your pre-aggregation as it renders it non-additive.
Expand Down
Loading

0 comments on commit 682f8e1

Please sign in to comment.