Skip to content

Embed Nats server in gitea #33821

Open
Open
@TheFox0x7

Description

@TheFox0x7

Feature Description

Since gitea and nats are both written in go, gitea can embed nats service and have it always available regardless of environment.

Why is it beneficial?

  • ability to have a single provider for a feature set regardless of environment (standalone binary, container, cluster all have it available with the same feature set)
  • Simplification of queues - nats can handle them replacing need for multiple providers in the first place.
  • PubSub channel is already there if needed in the future
  • Various services and system might benefit from having a request/reply channel
  • JetStream features can be enabled if needed providing an even wider feature set out of the box
  • Common system between clustered gitea and standalone

Potential issues I've identified so far:

  • Migration from current user setups
  • Added memory usage is unknown
  • New binary size is unknown pulling just the client (but not doing much with it - only connecting) brings less than 800kB. Server adds 5.5MB.
  • Redis is also used for cache so this won't be removing a dependency (aside from queue only ones but they aren't as big)
  • Nats does not have counters for future rate limiting cases (they are planned to be in alpha for 2.12 release)

It's a very low priority idea but I figured I should write it down so there's a place for discussions on this. I've seen it mentioned in relation to preparing gitea for clusters before.

Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/proposalThe new feature has not been accepted yet but needs to be discussed first.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions