Skip to content

debezium/dbz#2229 feat: implement batching interfaces for vector stor…#17

Open
KMohnishM wants to merge 1 commit into
gsoc-week-7-guidesfrom
gsoc-week-8-benchmarks
Open

debezium/dbz#2229 feat: implement batching interfaces for vector stor…#17
KMohnishM wants to merge 1 commit into
gsoc-week-7-guidesfrom
gsoc-week-8-benchmarks

Conversation

@KMohnishM

Copy link
Copy Markdown
Contributor

…e adapters and add benchmark script

Description

This PR implements the first part of the GSoC Week 8 milestone for the PyDebeziumAI project. It introduces list-based batch processing interfaces to the VectorStoreAdapter contract and implements them across all three backends (Chroma, PGVector, and Milvus). It also adds a performance profiling utility to establish a baseline and measure batching speedup.

Proposed Changes

  • pydebeziumai.adapters.base:
    • Added abstract upsert_batch(self, documents: list[Document]) and delete_batch(self, doc_ids: list[str]) methods to the VectorStoreAdapter interface.
  • pydebeziumai.adapters.chroma / pgvector / milvus:
    • Implemented the batching methods using the underlying vector stores' native bulk client operations (e.g., add_documents and delete using array parameters) to reduce network round-trips.
  • tools/benchmark.py:
    • Added a benchmark script that runs sequential vs. batched synchronization cycles against an in-memory Chroma instance using synthetic document streams, measuring end-to-end latency and throughput.

Verification Results

Running the benchmark suite (python3 tools/benchmark.py --num-records 100 --batch-size 20) demonstrates a 5.23x throughput speedup:

  • Sequential Sync: ~50.88 records/sec (Average latency: 19.65 ms per document)
  • Batched Sync: ~266.26 records/sec (Average latency: 75.11 ms per batch of 20)

Unit tests have been updated to ensure all mock adapters implemented in test suites comply with the updated interface.

@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch 2 times, most recently from fe6caa0 to 3986f6a Compare July 15, 2026 04:44
@KMohnishM
KMohnishM force-pushed the gsoc-week-7-guides branch from c987006 to b66b70b Compare July 15, 2026 04:54
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 3986f6a to f746a2f Compare July 15, 2026 04:54
@KMohnishM
KMohnishM force-pushed the gsoc-week-7-guides branch from b66b70b to 6a341ed Compare July 15, 2026 05:03
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from f746a2f to 3c020d5 Compare July 15, 2026 05:03
@KMohnishM
KMohnishM force-pushed the gsoc-week-7-guides branch from 6a341ed to 31fc9f8 Compare July 18, 2026 12:57
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 3c020d5 to 6ee0c05 Compare July 18, 2026 12:57
@KMohnishM
KMohnishM force-pushed the gsoc-week-7-guides branch from 31fc9f8 to d0bec60 Compare July 22, 2026 11:32
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 6ee0c05 to d4effec Compare July 22, 2026 11:32
@KMohnishM
KMohnishM force-pushed the gsoc-week-7-guides branch from d0bec60 to 7af1b13 Compare July 22, 2026 11:40
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from d4effec to 73433c9 Compare July 22, 2026 11:40
@KMohnishM
KMohnishM force-pushed the gsoc-week-7-guides branch from 7af1b13 to 166db5d Compare July 22, 2026 11:47
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 73433c9 to 55eddb4 Compare July 22, 2026 11:47
@KMohnishM
KMohnishM force-pushed the gsoc-week-7-guides branch from 166db5d to b2c082f Compare July 22, 2026 11:52
…e adapters and add benchmark script

Signed-off-by: KMohnishM <kmohnishm@gmail.com>
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 55eddb4 to dc59b09 Compare July 22, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant