in reply to Re^2: [OT] Merging messages between users on different machines
in thread [OT] Merging messages between users on different machines

Starting at the end:

Do these additions sound sane?

Um. After my 3rd reading, nothing you've described leaps off the page as unimplementable; but ... having designed and implemented a couple of comms protocols in the past, neither would I expect to detect any flaws from reading the description.

Such protocols are inherently asynchronous, and as such, it is extremely hard to envisage them from wordy descriptions. There are only 3 ways I know of to adequately design/envisage/test a protocol of this type:

"Suggested" messages might also be handy in case when (for some reason I need to think through) two nodes happen to have the same number of messages, but some of the messages differ.

This sounds dangerous to me. The only 'secret' for a good comms protocol I can offer, is keep it simple.

The above sounds very like a case of: "Oh. This might be nice.". And that is (IMO) the start of the rot.

The very moment you start adding things; without having a very clear, real scenario that must be addressed you have started on the slippery slope of either featuritise or futuritise; and that is the very opposite of KISS. As soon as you start down that road; you are on a journey to failure.(IMO :)

Perhaps the best advice I could offer at this point is: Have you really looked at all the existing mechanisms and alternatives?

And the second best is: Keep your communications protocol (the triple handshake stuff) entirely separate from the inbox synchronisation stuff (the binary chop).

The third would have to be: if you go the route of writing this from scratch; mock up your simulation early, and run it hard. And make sure that you can quickly relate the logs back to your state/flow diagrams.

And if that all sounds like I am trying to put you off from doing this all yourself; I kind of am. Because reading your description above suggests that you are conflating the triple-handshake mechanism -- who's purpose as I described it was just for guaranteed delivery -- with the synchronisation mechanism -- which I suggested should be a secondary process.

A major purpose of the guaranteed delivery is that communicating ids should never be in the situation where they have differing opinions of their communications history. Either the message was sent and received, and both ids know that. Or, the delivery failed; and both ids know that.

The synchronisation process only happens between devices owned by the same ID; not between IDs.

I wish I could do a better job of conveying my meaning here; but I hope that this will be of some use to you. However, what you are asking for here is well beyond the scope of the type of help you should expect to get from a forum such as this.


With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!
-----------------

Replies are listed 'Best First'.
Re^4: [OT] Merging messages between users on different machines
by Anonymous Monk on Jul 25, 2015 at 18:36 UTC

    Well.

    I knew I was trying to jump over my head, so it's not entirely unexpected.

    without having a very clear, real scenario that must be addressed you have started on the slippery slope of either featuritise or futuritise; and that is the very opposite of KISS
    I've read so much about featureism, and now I fall prey to it myself. It must be easier when one is both the developer and one's own customer and, also, when one is too enthusiastic about the project. Having admitted that I must also say that it is possible for syncing between owner's devices to be not enough; i.e. I've been myself in a situation when one of my devices had received a message, then went offline, then I was using another device and had no other way to read the message but to ask the sender (who was online for the whole time) to send it again (except the protocol did not offer any way to sync messages, so I had lost from the beginning). This is why I suggested to implement between-account sync in addition to inter-account sync.

    Have you really looked at all the existing mechanisms and alternatives?
    Some people solve the problem by dropping local storage and leaving everything on the one and only central server. Reliable delivery is thus reduced to secure (HTTPS) and reliable (just hit F5 and reload 2M (not counting images) of javascript web application if something happens) R/W access to the message storage. Others do deliver messages via a central server to end-user devices, but don't even try to ensure that the history is consistent between clients (except for protocol extensions for delivery confirmation messages which get lost as easily as the messages themselves and server-side history storage). I've seen a program behave as if the synchronisation happens like I want it to, but I can't know for sure if it really does and what the program does with the clear text in the meantime because the protocol is closed and the binary is obfuscated (and I don't have the right to examine it anyway: I agreed to EULA). There are also programs which manage to be P2P by some means (over-the-internet networks/NAT hole punching/pure magic) but keep the computer/account ratio strictly equal to one and don't ensure delivery anyway. This also means that the problem I want to solve is a very hard one and I shouldn't be working on it because I'm not a professional programmer. But I will keep looking.

    And if that all sounds like I am trying to put you off from doing this all yourself; I kind of am.
    At this point I'm rather reluctant to continue too and I'd rather stop before I embarass myself even further. One last question though: I understand that it won't be enough to achieve my original goal, but can you suggest me a book which could enlighten me on network protocols and/or data storage formats? Most programming books I stumble upon tend to describe the language itself or algorithms in general. Clearly, there must be something I'm missing: either a classic covering these topics, or a fundamental principle (like "it's impossible to describe data storage in general without accompanying algorithms").

      can you suggest me a book which could enlighten me on network protocols and/or data storage formats?

      I don't have a book recommendation; but one of the ways of validating asynchronous protocols is a technique called Petri Net Modeling;. Besides the (rather overly academic) wikipedia page, a google search turns up a bunch of introductions, slide stacks and lecture notes and pdfs that might help you.


      With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority". I knew I was on the right track :)
      In the absence of evidence, opinion is indistinguishable from prejudice.
      I'm with torvalds on this Agile (and TDD) debunked I told'em LLVM was the way to go. But did they listen!