Giter Site home page Giter Site logo

Explicit Merge Nodes about ipfs-log HOT 6 CLOSED

aphelionz avatar aphelionz commented on June 15, 2024 1
Explicit Merge Nodes

from ipfs-log.

Comments (6)

satazor avatar satazor commented on June 15, 2024 1

The reason of having explicit merge is to keep the list of heads small. Consider a highly concurrent scenario were replicas are mostly offline. If they sync with each other at nearly the same time, the 'log' will have a large list of heads. The list of heads will remain like so until a new add is performed. There are cases in which we may want to explicitly create a merge to keep the list of heads small.

The use-case was discussify, where each comment contains the list of heads. This will be inside a CRDT, which we want to keep it small so that synching and coldboot are shorter because the CRDT state would be kept small.

from ipfs-log.

aphelionz avatar aphelionz commented on June 15, 2024

cc @satazor

from ipfs-log.

aphelionz avatar aphelionz commented on June 15, 2024

Perhaps this can be an argument passed to join?

log1.join(log2) //normal behavior, default false, vs
log1.join(log2, true) //or log1.join(log2, { merge: true })

The second line, either option, would create a merge entry to become the new singular head of the log.

cc @haadcode @thiagodelgado111 @satazor @shamb0t

from ipfs-log.

haadcode avatar haadcode commented on June 15, 2024

I don't think we should have explicit merge-nodes (it adds complexity, imo is not a good abstraction, we already have it and it can be formally defined as the union of all heads in the log).

We discussed this with @satazor and @pgte in the original issue and in a call we had before starting the work. What, iirc, @satazor meant with a merge-node was that there should be a way to query the heads of the log which we have as log.heads. @satazor correct me if I remember incorrectly.

I believe we don't need this at all and this issue can be closed, but do let me know if you see it differently 👍

from ipfs-log.

aphelionz avatar aphelionz commented on June 15, 2024

Closing for now, then. Re-open if necessary.

from ipfs-log.

aphelionz avatar aphelionz commented on June 15, 2024

Just to learn more about this proposal, is this simply accomplished by:

// let log1 and log2 be loges with >1 entries each
log1.join(log2)

// let MergeEntry be either an entry with an empty payload
log1.append(MergeEntry) // this becomes the new head

from ipfs-log.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.