Skip to content

Abstract packet processing DB operations to a standalone trait #6050

@NumberFour8

Description

@NumberFour8

Description

Operations performed within the packet processor involve the database, should be separated into a trait.
Such trait can then be implemented multiple times, such that it represents a composable model:

  • DB access base implementation
  • composable caching implementation as a middleware

e.g.

trait PacketDbOps { ... }

struct PacketDbOpsImpl { ... }

impl PacketDbOps for PacketDbOpsImpl { ... }

struct CachingDbOps<Inner: PacketDbOps> {...}

impl<Inner: PacketDbOps> PacketDbOps for CachingDbOps<Inner> { ... }

Relevant issues

Refs #5891
Refs #6031

Definition of DONE

  • All DB read operations in packet processing are using a cache
  • All DB write operations in packet processing cause cache invalidation

Metadata

Metadata

Assignees

Labels

epicAn issue which tracks multiple issues

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions