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 <[email protected]>

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

Signed-off-by: Chimey Rock <[email protected]>
@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

@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
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