Skip to content

Design for Postgres event transport #11

Description

@adamcharnock

Needed commands (mirroring from Redis event transport):

  • xadd
  • xread_group
  • xpending
  • xclaim
  • xrevrange

This requires:

  • Messages
  • Groups
  • Consumers

We will need to be able to:

  • Determine which message each group is up to
  • Determine which consumers are currently processing a message
  • Upto one consumer from each group can be processing a message
  • Each consumer can be processing multiple messages at any one time

Potential schema outline:

  • messages
    • id SERIAL INT
    • created_at TIMESTAMPTZ
    • stream VARCHAR(255)
    • content JSONB
  • groups
    • id SERIAL INT
    • name VARCHAR(255)
    • stream VARCHAR(255)
    • latest_id INT
  • pending_messages
    • message_id INT
    • consumer_name VARCHAR(255)
    • claimed_at TIMESTAMPTZ

Potentially move each stream into its own table.


Note: The old transaction event transport was deleted in 899e9b5

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions