ReferenceClientAdvancedAuto Commit

Auto-Commit

Control when written data becomes visible with auto-commit settings.

By default, writers are configured with auto-commit enabled, meaning each write is immediately committed and available for read access. This is ideal for real-time data acquisition where data should be immediately available for monitoring and analysis.

When to Disable Auto-Commit

Disabling auto-commit may be beneficial in the following scenarios:

  • Chunk-based file ingestion -> When loading historical data from files, committing data in logical chunks (e.g., after processing each file) ensures atomic visibility of complete datasets.
  • Batch processing -> When ingesting large volumes of historical data where real-time visibility is not required and performance optimization by reducing commit overhead is desired.
  • Atomic transactions -> When multiple writes need to appear together atomically to maintain data consistency across channels.

Disabling Auto-Commit

To disable auto-commit, set the enable_auto_commit option to False when opening the writer.

Commit Frequency Best Practices

When auto-commit is disabled, call commit periodically to persist data. However, calling commit on every write is inefficient because it requires a round-trip to the cluster. This can be very slow when writing large volumes of data. Instead, commit every few seconds or use auto-commit (which is enabled by default).

Avoid this pattern - Committing on every write:

Recommended approach - Use auto-commit (enabled by default):