Skip to content

Conversation

@chimeyrock999
Copy link
Contributor

What this PR does / why we need it:

Adds optional batch insert and commit mode to the MySQLOnlineStore to improve materialization performance for TiDB and MySQL backends.
By default, Feast writes each row individually and commits per record, which causes large overhead on MySQL compatible Raft-based databases like TiDB.
This PR introduces a configurable batch mode to group inserts and commit per batch, improving write throughput.

Changes

  • Added config flags:
    batch_mode: true
    batch_size: 1000
    
  • Implemented batched insert using executemany() / multi-row SQL.
  • Each batch is committed atomically.
  • Backward compatible (default = per-row mode).

Misc

  • Verified on TiDB v7.5.0 and MySQL 8.0.44.
  • Thanks @ntkathole confirming this direction.

Signed-off-by: Chimey Rock <trinhvanthoai99@gmail.com>

docs: update document for MySQL Online Store to support batch write

Signed-off-by: Chimey Rock <trinhvanthoai99@gmail.com>
@ntkathole
Copy link
Member

@chimeyrock999 Thank you! Can we also please mention this support in our docs ? may be at https://github.com/feast-dev/feast/blob/master/docs/reference/online-stores/mysql.md

Signed-off-by: Chimey Rock <trinhvanthoai99@gmail.com>
@chimeyrock999
Copy link
Contributor Author

@ntkathole Thank you for the feedback! I’ve added documentation to cover this support of MySQL Online Store.

@ntkathole ntkathole merged commit 3cfe4eb into feast-dev:master Oct 31, 2025
19 checks passed
franciscojavierarceo pushed a commit that referenced this pull request Nov 13, 2025
# [0.57.0](v0.56.0...v0.57.0) (2025-11-13)

### Bug Fixes

* Improve trino to feast type mapping with (real,varchar,timestamp,decimal) ([#5691](#5691)) ([f855ad2](f855ad2))
* Materialize API - ODFV views not looked-up (thinks views non existant)  - crashes materialize ([#5716](#5716)) ([1b050b3](1b050b3))
* Support historical feature retrieval with start_date/end_date in RemoteOfflineStore ([#5703](#5703)) ([ad32756](ad32756))
* Thread safe Clickhouse offline store ([#5710](#5710)) ([5f446ed](5f446ed))

### Features

* Add annotations to cronjob CRDs ([#5701](#5701)) ([be6e6c2](be6e6c2))
* Add batch commit mode for MySQL OnlineStore ([#5699](#5699)) ([3cfe4eb](3cfe4eb))
* Add possibility to materialize only latest values, to increase performance ([#5713](#5713)) ([8d77b72](8d77b72))
* Support table format: Iceberg, Delta, and Hudi ([#5650](#5650)) ([2915ad1](2915ad1))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants