Skip to content

Data Engine v2 #1782

@twitu

Description

@twitu

Based on extensive discussion, we've come up with a new design for the data engine which is closely tied to the new design for the message bus (#1712). This is an overview of the current design where the message bus is responsible for two different kinds of communications.

  • Message passing between components
  • Data request/response between actors and data engines
shapes at 24-07-09 23 16 59 shapes at 24-07-09 23 14 47

Design v2

In the new design we want to move the data req/response flow out of the message bus -

  • message bus does send, pub/sub
  • data engine does data req/response

shapes at 24-07-07 11 16 22

The new design

The main advantages of this architecture are -

  • The internal state of the actor is not shared across threads in a closure thus removing the need for the locks
  • It removes a layer of indirection between actors and data engines

We want to embrace the actor model. The actor has only one job and to process data responses. The data engine takes responses, maps them to the appropriate actor task and As it processes a data response, it can choose to communicate with other components via the message bus or send new data requests to the data engine. Internally the actor wraps state that it can share with other handlers, these handlers can be registered with the message bus and can be called by other components.

shapes at 24-07-10 16 21 25

From the actors perspective this simplifies the control flow in the new design -

  • data engine "drives" the actor
  • actors send new data requests to the data engine - indirectly "driving" it

shapes at 24-07-07 10 40 28

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestrustRelating to the Rust core

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions