Increase Airbyte emitted at timestamp precision from milliseconds to nanoseconds for improved event ordering #144
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.
Summary
This change increases the precision of the Airbyte
emitted_attimestamp from milliseconds to nanoseconds when emitting records from the PlanetScale Airbyte source.This enhancement ensures that each record receives a more accurate and unique emission timestamp, improving event ordering and temporal consistency — especially during high-throughput syncs.
Problem
Previously, the
emitted_atfield used millisecond precision, meaning multiple records emitted within the same millisecond would share identical timestamps.This led to:
Solution
The timestamp precision has been increased to nanoseconds, providing distinct
emitted_atvalues even when records are emitted in rapid succession.This allows downstream systems and destinations to order events more accurately and deterministically.
Implementation Details
time.Now().UnixNano().emitted_atfield — only its numeric precision increased.This modification may be considered a breaking change for any destination or downstream system that:
emitted_atis in millisecondsAffected systems may need to update their parsing logic to handle nanosecond precision values correctly.
Impact
Example
emitted_at: 1730312345123emitted_at: 1730312345123456789Testing
This change was tested by performing multiple update operations within the same SQL transaction on a PlanetScale database.
In the resulting Airbyte output, all emitted records had distinct
emitted_atvalues, confirming that nanosecond precision successfully differentiates events that previously shared identical timestamps.