Skip to content

Async API for Notifications & Delay-Tolerant Synchronisation #248

@CMCDragonkai

Description

@CMCDragonkai

Specification

The notifications system is better understood as a message queueing system (https://en.wikipedia.org/wiki/Message_queue). Communications is currently implemented with gRPC, meaning notifications is built in the RPC paradigm.

There are some benefits to choosing a messaging paradigm instead.

All these models make it possible for one software component to affect the behavior of another component over a network. They are different in that RPC- and ORB-based middleware create systems of tightly coupled components, whereas MOM-based systems allow for a loose coupling of components. In an RPC- or ORB-based system, when one procedure calls another, it must wait for the called procedure to return before it can do anything else. In these synchronous messaging models, the middleware functions partly as a super-linker, locating the called procedure on a network and using network services to pass function or method parameters to the procedure and then to return results.
https://en.wikipedia.org/wiki/Message-oriented_middleware

It's possible to build a messaging system on top of RPC. Actually RPC and messaging are sort of equivalent, in that RPC can be built on top of a messaging protocol and messaging can be built on top of RPC. See https://github.com/yarpc/yarpc-go as an example of messaging system on top of gRPC.

Right now our architecture has gRPC on top of a lower transport-level network domain. We could build a messaging system on top of gRPC but we would be reimplementing alot of features that other messaging protocols already have.

In addition to notifications, there's also the desire to build lazy gossip protocol that helps us replicate and have eventually consistent gestalt graph as well as ACL state.

We need to think holistically here and ensure that anything we build for an asynchronous messaging-paradigm can be used for all these usecases and constraints:

  • Notification messaging
  • ACL & GG synchronisation
  • CQRS/streaming & consistency to clients (CLI & GUI)
  • Wide-spread interoperability
  • Open standards
  • JS-runtime and potentially usable directly in the browser and native script and mobile platforms
  • How does pagination come into play here?

A good place to start would be to review the AsyncAPI standard: https://www.asyncapi.com/docs/specifications/v2.2.0#definitionsProtocol. This standard is about describing asynchronous protocols similar to OpenAPI which is used primarily for RESTful or RPCful HTTP APIs.

We should also be aware of how this relates to synchronous transactions that are currently occurring in a blocking manner. If they can be redesigned to be asynchronous, we could improve UX and avoid blocking operations over the network.

Additional context

Tasks

  1. ...
  2. ...
  3. ...

Metadata

Metadata

Assignees

Labels

designRequires designepicBig issue with multiple subissuesr&d:polykey:core activity 3Peer to Peer Federated HierarchyresearchRequires research

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions