Skip to content

Prefetching/Caching of messages should perhaps be a concern of a caching wrapper, not of the engine #9

@hjohn

Description

@hjohn

This issue contains three concerns:

  • The Postgres engine queries currently up to 50 messages that match a given set of criteria. Due to the nature of the engine interface, it will be hard to externalize this in a generic caching component that can wrap an EventStorageEngine.

  • Caching of message ranges should also be possible as messages are immutable, which may be another concern better packed into a wrapper.

  • The prefetching in Postgres may find that there aren't 50 messages matching the criteria, but their consumption speed may be low enough that new messages have arrived in the mean time that match the criteria. Should the implementation do a final check when the last message is consumed, or should it assume no new messages have appeared?

Currently this results in say 5 messages being fetched with a SELECT, and then when the final message is consumed, another SELECT occurs to make sure there are no further matches meaning that in many cases a minimum of two queries is needed to source or stream messages.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Priority 1: MustHighest priority. A release cannot be made if this issue isn’t resolved.Status: Under DiscussionUse to signal that the issue in question is being discussed.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions