You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
it might not be needed for journals with bounded set of persistence_id
could be sharded per persistence_id otherwise
Later, if data and index sizes need to be reduced, consider using metadata.id as foreign key in the journal table instead of persistence_id.
The text was updated successfully, but these errors were encountered:
fredfp
changed the title
PartitionedJournalDao does not gurantee unicity of sequence_number per persistence_id
Performance and safety Improvements to PartitionedJournalDao
May 7, 2021
Safety issue
Since https://github.com/SwissBorg/akka-persistence-postgres/releases/tag/v0.5.0-M1, unicity of sequence_number per persistence_id is guaranteed across a single partition. We still should guarantee it across all partitions.
Performance issues
A few queries are slow because they require scanning all available partitions.
Possible fix
Create a metadata table that is automatically checked and updated on insertions, and query that table instead of scanning all partitions.
Columns for new metadata table:
When inserting a new message for a given persistence_id, use trigger to:
Queries we could improve:
Consider how to partition/shard such table:
Later, if data and index sizes need to be reduced, consider using metadata.id as foreign key in the journal table instead of persistence_id.
The text was updated successfully, but these errors were encountered: