Skip to content

Commit f06fcbd

Browse files
Move table config to partial so it can be generated with dyy
1 parent 99a67a7 commit f06fcbd

39 files changed

Lines changed: 907 additions & 726 deletions

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
*.tmp
22
*.swp
33
docs/public/
4-
resources/_gen/
4+
docs/resources/_gen/
55
.hugo_build.lock

docs/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
*.tmp
2+
*.swp
3+
docs/public/
4+
resources/_gen/
5+
.hugo_build.lock

docs/assets/_custom.scss

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,21 @@
1212
--hl: #abf7a8;
1313
}
1414

15-
.yaml-doc-container {
15+
.dyy-container {
1616
font-family: 'Monaco', 'Courier New', monospace;
1717
max-width: 1400px;
1818
line-height: 1em;
19-
background: var(--bg);
2019
font-size: 0.9rem;
2120
}
2221

23-
.yaml-doc-container > .line:first-child > .yaml-section {
22+
.dyy-container > .line:first-child > .yaml-section {
2423
padding-top: 0.5rem;
2524
border-top-left-radius: 5px;
2625
border-top-right-radius: 5px;
26+
border-color: white;
2727
}
2828

29-
.yaml-doc-container > .line:first-child > .doc-panel {
29+
.dyy-container > .line:first-child > .doc-panel {
3030
padding-top: 0.5rem;
3131
}
3232

@@ -38,6 +38,7 @@
3838

3939
.yaml-section {
4040
background: var(--bg);
41+
height: 100%;
4142
}
4243

4344
.yaml-line {
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
# License Key
2+
3+
Required license key.
4+
`mlrd -license` to print all active licenses, or get licenses at https://mlrd.app.
5+
6+
# DynamoDB Table
7+
8+
`table_name` sets the DynamoDB table name that clients use.
9+
This setting is always required.
10+
11+
The table name must be or match the common table name in the [table envs]({{ref . "table-envs" }}) for the license.
12+
13+
**Values shown are only examples.**
14+
15+
# Primary Key
16+
17+
Primary key definition: required `partition_key` and optional `sort_key`.
18+
19+
Values are coded attributes: "<type>,<attribute>".
20+
For example:
21+
* "S,Artist"
22+
* "N,Year"
23+
* "B,Checksum"
24+
25+
If the primary key is not defined and the table mode is transparent or migration, mlrd auto-defines the table by calling `DescribeTable`.
26+
In SQL table mode, the primary key (and secondary indexes) must be defined.
27+
28+
# Secondary Indexes
29+
30+
Optional map of secondary indexes (GSI and LSI).
31+
32+
* Map key: case-sensitive index name
33+
* Map fields are shown with example values
34+
35+
`include` is a list of attributes to project with the secondary index.
36+
37+
# AWS
38+
39+
Configures AWS access to DynamoDB.
40+
41+
By default (no values), the AWS SDK uses its defaults:
42+
* Env variables: `AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, etc.
43+
* Shared configuration files
44+
* Shared credentials files
45+
46+
For security, mlrd does not accept AWS access key values in the table config.
47+
Best practice is to use AWS SDK defaults.
48+
49+
# Migration Step
50+
51+
Sets migration step, runs table in migration mode.
52+
See [migration overview]({{ref . "overview" }}).
53+
54+
# MySQL
55+
56+
MySQL connection and credential settings.
57+
58+
If `hostname` and `socket` are not set, mlrd auto-detects a local MySQL socket; if that fails, it defaults to `host: 127.0.0.1:3306`.
59+
For consistency and clarity, set `socket` or `hostname`.
60+
If both are set, `socket` takes precedence.
61+
62+
MySQL password source: one of `password`, `password_file`, `iam_auth`, or `password_secret` must be set and non-empty.
63+
mlrd supports online password rotation: password source is reloaded if MySQL returns an auth error; no need to restart mlrd.
64+
65+
`table_name` defaults to `ddb.table_name`.
66+
This settings allows for a different MySQL table name.
67+
Clients always reference table by `ddb.table_name`.
68+
69+
Other settings (`max_conn`, `storage`, etc.) are low-level and shouldn't be changed without consulting with mlrd.tech first.
70+
71+
`sharded` affects how BatchGetItem and BatchWriteItem work.
72+
If false (default), SQL queries are optimized to run on a single node.
73+
If true, SQL queries are modified to execute on multiple shards.
74+
In the future, this setting will also affect TransactWriteItems and TransactGetItems.
75+
76+
# TLS
77+
78+
Certificate authority (CA), certificate, and key files for TLS connection to MySQL.
79+
80+
`ca` can be defined alone.
81+
`key` and `cert` must be defined together.
82+
83+
If no TLS is defined, a TLS-encrypted connection is still used (except for localhost and 127.0.0.1) but the sever identity is not verified.
84+
85+
mlrd auto-detects AWS RDS/Aurora hostnames and uses the AWS Global Certificate Authority (CA) automatically.
86+
87+
# AWS RDS
88+
89+
AWS RDS access if MySQL is an AWS RDS or Aurora instance.
90+
91+
# Low-level Storage
92+
93+
Consult with mlrd.tech before changing these settings.
94+
95+
# OpenTelemetry Metrics
96+
97+
Configures mlrd to send OpenTelemetry metrics via gRPC (OLTP/gRPC).
98+
Set `endpoint` to enable.
99+
100+
> [!NOTE]
101+
> **Sys Metrics**
102+
> Tables inherit sys config metrics if set. This makes it easy to enable metrics for all tables. If table config contains a `metrics` section, it overrides the sys config metrics.
103+
104+
`freq` is a Go time duration string, minimum "1s" but default "5s" recommended.
105+
106+
`disable` disables table metrics, even if sys metrics are set.
107+
108+
# Percentiles
109+
110+
Percentiles to report for response time metrics.
111+
Defaults shown: P50 (median) and P99.
112+
113+
# Sampling Rate
114+
115+
Sampling rates (currently only response time).
116+
Values are every Nth:
117+
118+
- 100 = 1%
119+
- 20 = 5%
120+
- 10 = 10%
121+
- 5 = 20%
122+
- 4 = 25% (default)
123+
- 2 = 50%
124+
- 1 = 100% (not recommended)
125+
126+
# Disable Features
127+
128+
List of [features]({{ref . "feature-flags" }}) to disable.
129+
Consult with mlrd.tech before setting.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
lkey: "" # License Key {lkey}
2+
3+
ddb: # DynamoDB Table {ddb}
4+
table_name: "Albums"
5+
primary_key: # Primary Key
6+
partition_key: "S,Artist"
7+
sort_key: "S,Title"
8+
indexes: # Secondary Indexes
9+
Year:
10+
partition_key: "N,Year"
11+
include: []
12+
aws: # AWS
13+
config_files: []
14+
credentials_files: []
15+
profile: ""
16+
region: ""
17+
18+
migration_step: "" # Migration Step {migration_step}
19+
20+
mysql: # MySQL {mysql}
21+
username: "mlrd"
22+
hostname: ""
23+
socket: ""
24+
password: ""
25+
password_file: ""
26+
db: "mlrd"
27+
table_name: ""
28+
tls: # TLS
29+
ca: ""
30+
cert: ""
31+
key: ""
32+
aws: # AWS RDS
33+
config_files: []
34+
credentials_files: []
35+
iam_auth: false
36+
password_secret: ""
37+
profile: ""
38+
region: ""
39+
max_conn: 100
40+
max_conn_idle: 100
41+
sharded: false
42+
storage: # Low-level Storage
43+
pk_len: 2048
44+
sk_len: 1024
45+
vgc: false
46+
47+
metrics: # OpenTelemetry Metrics {metrics}
48+
endpoint: ""
49+
freq: "5s"
50+
percentiles: # Percentiles
51+
- 50
52+
- 99
53+
sampling: # Sampling Rate
54+
response_time: 4
55+
disable: false
56+
57+
disable: [] # Disable Features

0 commit comments

Comments
 (0)