atomicdata-dev / atomic-data-docs

Atomic Data is a specification to make it easier to exchange data.
https://docs.atomicdata.dev
MIT License
17 stars 7 forks source link

Incoming messages, inbox, notifications, subscribe, publish, pubsub #28

Open joepio opened 3 years ago

joepio commented 3 years ago

I want to be able to:

Usecases

Interesting technologies

Possible approaches

Use commits - all Commits are messages

When you want to notify some server of a change, simply send the commit there. Incoming messages or notifications are not anything special, they are simply commits.

This however does not solve filtering and following

joepio commented 3 years ago

If we use Commits as messages, the server should know which Commits it should ignore and which it should follow. How should it make this decision?

Users have a follows array

Let's say Users can follow things by storing a list of Resources they follow. This list should probably be a private resource that only they can access. Whenever a Commit comes in, and the Commit shares a Subject with that resource, it should be applied.

However, this still leaves new resources that could be interesting, such as new blog posts or messages.

Users have a followsParents array

When a Commit comes in that has a parent which matches one of the items in followsParents, the commit is applied, too.

joepio commented 2 years ago

the Subscription class

A Subscription is a resource that describes a publish-subscribe relationship between a User and some Collection.

Protocol

But how does the server of the subscriber now know if it is interested in this resource? Let's consider some solutions