Clarion OS Communication Architecture #7
Replies: 9 comments 26 replies
-
You lost me when you said you post message to eden. And you failed when you wanted to sync to cain. Didnt you know cain can be the evil cia,. |
Beta Was this translation helpful? Give feedback.
-
I ran fidonet node before and this is way more efficient approach. It should work without affecting mobile data limits too much. Most challenging problem appears to be communication channel itself - carriers (ATT, Verizon, etc) that can block unwanted IP's/traffic. |
Beta Was this translation helpful? Give feedback.
-
Similar architecture to this? OrbitDB is a peer-to-peer database meaning that each peer has its own instance of a specific database. A database is replicated between the peers automatically resulting in an up-to-date view of the database upon updates from any peer. That is to say, the database gets pulled to the clients. This means that each application contains the full database that they're using. This in turn changes the data modeling as compared to client-server model where there's usually one big database for all entries: in OrbitDB, the data should be stored, "partitioned" or "sharded" based on the access rights for that data. For example, in a twitter-like application, tweets would not be saved in a global "tweets" database to which millions of users write concurrently, but rather, each user would have their own database for their tweets. To follow a user, a peer would subscribe to a user's feed, ie. replicate their feed database. |
Beta Was this translation helpful? Give feedback.
-
Naturally storage requirements will grow with time, service worker in particular on iOS could be a bottleneck. How would something like IPFS pinning work on Clarion OS? Different users would like to keep different data, so unpinned data would have to be kept anyway, even more when original authors disappear. |
Beta Was this translation helpful? Give feedback.
-
Hey @bytemaster, I think there is an opportunity for layer 0 protocols to work together on this problem. We (Streamr) are in our third year building towards a similar technical specification to Clarion. Our contribution is a layer 0 decentralised P2P network designed on a pub-sub architecture. No consensus layer, and blockchain agnostic, but we require a blockchain to incentivize the nodes to contribute their bandwidth/storage. We've designed the system to be optimized for performance and scalability. If you reach out to me over email - [email protected] I will setup a call with our Network team to discuss the sort the sort of engineering questions you might have at the moment. |
Beta Was this translation helpful? Give feedback.
-
What are your thoughts on RadixDLT? |
Beta Was this translation helpful? Give feedback.
-
A few questions:
|
Beta Was this translation helpful? Give feedback.
-
Serious question: How can Clarion avoid the irrelevant messages? Take Facebook as an example, if Eve follows Adam and Adam posts a message that Eve doesn't want, she can mark as "Hide this post". In future, the similar messages from Adam may be ignored from Eve's device, but not the important updates from Adam. Of course Eve can read all messages from Adam if she likes. I think Facebook pre-process the message before sending it to New Feed of anyone. Is it possible for the filter to be implemented by ClarionOS? |
Beta Was this translation helpful? Give feedback.
-
I think, the rom space of Phone would used up quickly! How to resolved it ! |
Beta Was this translation helpful? Give feedback.
-
The purpose of this discussion is to explore the evolving design for Clarion OS message passing and work with the community to identify the best approach given the goals. Before getting started on Clarion, lets address the "goto" approach: DHTs.
Why not use a DHT (Distributed Hash Table) such as IPFS?
This is a question that comes up frequently in various forms. Based upon the other discussion threads people frequently reference projects such as Holochain or Berty and others. The first thing that I look for when reviewing these existing projects for ideas is the use of a DHT. At first glance a DHT seems like the "perfect" data store for a peer to peer network; however, I have some serious concerns over how they perform in practice.
Using IPNS to update dynamic content is incredibly slow but to publish and then to fetch. This means that IPFS can be used as a long-term cache of content but is not really suitable for interactive sites.
The conclusion that can be drawn from this is that DHTs and IPFS based solutions are barking up the wrong tree in terms of delivering a scalable, high-performance user experience. In a certain respect they are "logically centralized" in that everyone is part of a single namespace / routing system and everyone is expected to talk to everyone. This generates a large number of outgoing connections and can overload NATs which have a limited number of ports.
Scuttlebutt / Patchwork
Another existing system is known as Patchwork aims to allow you to connect to friends without relying about central servers. It is an electron application and my initial experience was slow and buggy.
Clarion OS
Clarion is being designed with a mobile-first approach for the simple reason that the vast majority of social media interactions occur on a mobile device. It is also being designed as a Progressive Web Application (PWA) so that App stores cannot censor it. These two considerations have a major impact on design. All things must grow organically and start from a single node and expand as new users are invited. What follows below is a user story of how the network grows from a single user to fully distributed.
Everything starts with a single "node", which we will call Eden, owned by a single "identity" who we will call Adam. Adam is a user and maintainer of Eden. Adam is lonely, so he creates an invite and gives it to a beautiful lady he met online, her name is Eve.
Eve visits eden.com (hosted by Adam) using the invite link and is asked to create an "identity" by generating a private key and providing some profile information. Eve now becomes a user on eden.com which she accesses with her browser. She is also automatically following the identity of Adam and Adam is automatically following the identity of Eve. Any message Adam or Eve post will be uploaded to eden.com because they are both users of eden.com.
Eve decides she likes Clarion (as hosted on eden.com) and installs it as a PWA on her phone. Everything Adam and Eve post is replicated to her phone which maintains a local database used to render the interface.
After a while Eve makes friends with Cain and Abel who both send her an invite. Loading the invite into her PWA she connects to cain.com and Abel.com (by DNS or by IP). The PWA will then upload her profile and post history to Cain.com and Abel.com and she they will be following each other automatically.
At this point in time Eve gets to see all of the cat and dog pictures posted by Cain, Abel, and Adam. If Eve likes something Adam posts then Even will forward Adam's message on to Cain and Abel along with the message that she "liked" it. At his point Cain may choose to follow Adam. This will result in a message that Cain sends to Eve. From this point on every time Eve gets a message from Adam, she will automatically forward it on to Cain (assuming Cain hasn't already received Adam's message from another source).
Everything Eve posts is uploaded to every node on which she is a user.
Everything Adam posts is pushed to Eve because Eve is following Adam
Everything that Eve receives from Adam is forwarded to Cain because Eve knows Cain is following Adam
Everyone knows that Eve is a user on every node (so far).
Cain knows about the Identity (profile) of Adam (because Eve share his cat picture and he is following Adam), but Adam is not a user on Cain's node. Only users can establish a connection to nodes.
Even if Eden.com goes away (the server that originally provided the PWA), Eve can still post and interact with Cain and Abel.
While the Clarion PWA can only be installed from a domain with a valid HTTPS certificate, it can communicate with any node it can connect to over websocket HTTPS connections.
At this point Eve decides she likes Clarion and wants to install the desktop version on her home computer. This is an electron application. Upon opening the electron application the first time the app will ask her if she wants to import a profile or create a new one. Since Eve already has a profile on her PWA from Eden.com, she asks to import her profile. She will be given an "invite" link which she will load into Eden.com on her phone. Her PWA application will then connect to her Electron app via WebSocket (connection info provided in invite link) and her electron application will sync her account to her desktop computer. Eve will then have to enter her password in the electron application in order to utilize the electron interface.
At this point Eve's phone is connected to eden.com, cain.com, and able.com, and her own personal desktop electron application. Her electron app will then connect to eden.com, cain.com, and able.com because Eve is a user on those nodes. The next time Adam posts a cat picture it will automatically be sent to her desktop and forwarded on to Cain even if she doesn't have her phone open.
Suppose Noah is friends with Cain and has given Cain a user account on Noah.com. When Cain.com receives a message it will automatically forward it to the mirror provided by Noah. If Cain likes Adam's cat picture as well then Noah could see it and decide to start following Adam.
The next time Adam posts a cat picture, it will flow from Eden.com -> EveDesktop -> Cain.com -> Noah.com.
If Eve happened to be on her phone, then it might flow from Eden.com -> EvePWA -> Cain.com -> Noah.com
To the extent possible Cain.com will de-dupe messages so Noah.com only gets it once and hopefully EvePWA doesn't need to send it to Cain.com if Cain.com already received the message via EveDesktop.
Any time two nodes connect they synchronize any unseen messages. This means that if Cain.com goes down for a while, Noah might not get Adam's cat picture until Cain.com comes backup and synchronizes with one of Eve's computers.
QUIC Connections
Full nodes hosted in the cloud or as part of the Electron application will support QUIC and NAT traversal. This means eventually most people with a desktop computer can connect directly to each other.
WebRTC
Peers can also use WebRTC to connect to each other through a coordinating server.
The next post will explore private messaging.
Beta Was this translation helpful? Give feedback.
All reactions