Skip to content

Batch database queries in RdePipeline - #3190

Open
gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:rdeBatches
Open

Batch database queries in RdePipeline#3190
gbrodman wants to merge 1 commit into
google:masterfrom
gbrodman:rdeBatches

Conversation

@gbrodman

@gbrodman gbrodman commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Currently, we process (repoId, revisionId) pairs for DomainHistory and HostHistory individually -- they may be farmed out to worker nodes in parallel, but each EppResource uses a separate transaction and a separate read, which doesn't scale well when there are lots of domains/hosts. So as a result, we should batch them up so we can load (by default) 500 per transaction at a time.

We don't want to batch-load the domains/hosts at the same time that we retrieve the most recent history entry for each type -- this would mean passing relatively large objects across pipeline steps. Instead, we keep passing the KV<String, Long> and batch retrievals.

In loadResourcesByHistoryEntryIds we can query directly by the revisionIds because those are guaranteed to be unique.

Self-scan D.2 number 5


This change is Reviewable

@gbrodman
gbrodman force-pushed the rdeBatches branch 2 times, most recently from da64912 to bba0ba9 Compare July 30, 2026 21:10
Currently, we process (repoId, revisionId) pairs for DomainHistory and
HostHistory individually -- they may be farmed out to worker nodes in
parallel, but each EppResource uses a separate transaction and a separate read,
which doesn't scale well when there are lots of domains/hosts. So as a
result, we should batch them up so we can load (by default) 500 per
transaction at a time.

We don't want to batch-load the domains/hosts at the same time that we
retrieve the most recent history entry for each type -- this would mean
passing relatively large objects across pipeline steps. Instead, we keep
passing the KV<String, Long> and batch retrievals.

In loadResourcesByHistoryEntryIds we can query directly by the
revisionIds because those are guaranteed to be unique.

Self-scan D.2 number 5
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