Skip to content

Group database operations within a single context #327

@A248

Description

@A248

The database access can be more efficient by utilizing the following:

  1. A re-usable connection context that allows sharing the database connection across disconnected parts of the codebase. Yes, we already use a connection pool, but implementing such practices will reduce pool thrashing.
  2. Multiple transactions for each logical operation. Following point 1, connections should start in an uncommitted state. We can commit after things like updating the name and IP address history, fetching the player's ban, or fetching punishment formatting information.
  3. Perform retries on a per-transaction basis. This follows point 2 and will involve some refactoring, since the operation-retry is currently coupled to the connection acquisition itself.

Metadata

Metadata

Assignees

No one assigned

    Labels

    improvementIdeas for streamlining existing features

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions