You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: Add batch commit mode for MySQL OnlineStore (#5699)
* feat: Support batch_write for MySQL OnlineStore
Signed-off-by: Chimey Rock <[email protected]>
docs: update document for MySQL Online Store to support batch write
Signed-off-by: Chimey Rock <[email protected]>
* docs: Add batch_write for MySQL Online Store
Signed-off-by: Chimey Rock <[email protected]>
---------
Signed-off-by: Chimey Rock <[email protected]>
Copy file name to clipboardExpand all lines: docs/reference/online-stores/mysql.md
+22Lines changed: 22 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,28 @@ online_store:
28
28
29
29
The full set of configuration options is available in [MySQLOnlineStoreConfig](https://rtd.feast.dev/en/master/#feast.infra.online_stores.mysql_online_store.MySQLOnlineStoreConfig).
30
30
31
+
## Batch write mode
32
+
By default, the MySQL online store performs row-by-row insert and commit for each feature record. While this ensures per-record atomicity, it can lead to significant overhead on write operations — especially on distributed SQL databases (for example, TiDB, which is MySQL-compatible and uses a consensus protocol).
33
+
34
+
To improve writing performance, you can enable batch write mode by setting `batch_write` to `true` and `batch_size`, which executes multiple insert queries in batches and commits them together per batch instead of committing each record individually.
35
+
36
+
{% code title="feature_store.yaml" %}
37
+
```yaml
38
+
project: my_feature_repo
39
+
registry: data/registry.db
40
+
provider: local
41
+
online_store:
42
+
type: mysql
43
+
host: DB_HOST
44
+
port: DB_PORT
45
+
database: DB_NAME
46
+
user: DB_USERNAME
47
+
password: DB_PASSWORD
48
+
batch_write: true
49
+
batch_size: 100
50
+
```
51
+
{% endcode %}
52
+
31
53
## Functionality Matrix
32
54
33
55
The set of functionality supported by online stores is described in detail [here](overview.md#functionality).
0 commit comments