dat-ecosystem-archive / datproject-discussions

a repo for discussions and other non-code organizing stuff [ DEPRECATED - More info on active projects and modules at https://dat-ecosystem.org/ ]
65 stars 6 forks source link

Dat: A message-based system on top of raw streams #62

Open aschrijver opened 6 years ago

aschrijver commented 6 years ago

Current design concepts

(NOTE This showcase is part 2 of Positioning, vision and future direction of the Dat Project)

If I it understand it correctly, simply put, with Dat you now have:

    stream exchange --> file exchange --> dat exchange

All by using modules from the ecosystem. AFAIK you currently have a modular decomposition, but you do not yet have a full modular design. or call it framework, if you prefer.

This because transitive dependencies require me to untangle, recompose and add my own glue logic, in order to realign modules in such way that it supports my new cool use case. But the modularization is not what I wanted to talk about here. That's for a future topic maybe.

Refactoring proposal

Instead consider this: Wouldn't it be better if instead Dat was modelled as follows?

    stream exchange --> message exchange

So as a

decentralized message-based system on top of raw streams

In this design:

I think this constitutes a change that requires only little effort, yet comes with tremendous benefit:

Overhead and effort

The overhead of wrapping data payloads into messages is only very small, depending on the message format you choose. So would code changes to existing modules, I imagine (but I'm not the one to say)

[UPDATE: Both @mafintosh and @joehand have acknowledged the usefulness of this proposal. The next part deals with the actual design of the message layer]

Next part: Design of a message-based abstraction layer on top of hypercore

benrogmans commented 6 years ago

Awesome idea @aschrijver

aschrijver commented 6 years ago

thanks @benrogmans

unfortunately while liked by dat team members it is not high on the priority list for dat, i think :(

aschrijver commented 6 years ago

maybe i'll be looking into vert.x as core tech for this idea..