feat: Cassandra online store, concurrency in bulk write operations #3367
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This implements the counterpart of #3356 but for writing. Using the native concurrency offered by Cassandra drivers allows for much faster write operations to the online store, which is crucial especially in the Materialize phase.
On a realistic setup (EC2 instance running the materialization on a DB in the same region), speedups of a factor about 12x are achieved.
Similarly to the read-optimization mentioned above, a new
write_concurrency
parameter is introduced (with defaults and full backward-compatibility) to control the level of concurrency should it ever be needed (the defaults should be fine in all cases, anyway).In order to preserve the behaviour of the callbacks to
progress
during writes to the online store, which makes the progress bar behave correctly, in the functiononline_write_batch
an ad-hoc iterator is built (seeunroll_insertion_tuples
) which, while it unfolds the whole set of rows to write, takes the care of invokingprogress
once per entity (each entity in general entails multiple rows to the DB table).The documentation and the guided
feast init -t cassandra
procedure are also updated to reflect this.