Coder Social home page Coder Social logo

Clean up the registry API about dcell HOT 13 CLOSED

celluloid avatar celluloid commented on August 28, 2024
Clean up the registry API

from dcell.

Comments (13)

tarcieri avatar tarcieri commented on August 28, 2024

I think the registries should probably be actors. Now that celluloid/celluloid#287 is landed and the inheritance anomalies have been eliminated, perhaps registries should descend from an abstract base class that includes Celluloid by default.

from dcell.

spangenberg avatar spangenberg commented on August 28, 2024

What about a delete method like I did here https://github.com/parcydo/dcell/commit/efdda59ddb90859a88516704f3b861eff7664d30, it's pretty much related to #6

A TTL is one way to solve this but I do it right now different and this requires a delete in the registry.

node = DCell::Node[:foo]

dispatched = false

after(2) do
  unless dispatched
    Logger.warn "Delete node #{node.inspect}"

    node.delete
  end
end

dispatched = node[:bar].baz

from dcell.

halorgium avatar halorgium commented on August 28, 2024

In the floss impl, the registry backends are actors.
I don't think we should have these actors as Cells, but perhaps we can wait for my celluloid/celluloid#291 PR.

from dcell.

tarcieri avatar tarcieri commented on August 28, 2024

@halorgium why not?

from dcell.

halorgium avatar halorgium commented on August 28, 2024

@tarcieri dunno, was a thought. the RPC overhead especially for the floss project means double-accounting.

from dcell.

tarcieri avatar tarcieri commented on August 28, 2024

"Overhead" was my original motivation for designing the API the way it was. Fuck that. Make everything an actor FTW ;)

from dcell.

halorgium avatar halorgium commented on August 28, 2024

Haha! Good call.
@aflatter would you feel OK spiking out an impl which used actors?
I'm not sure how the bootup process would look like.

from dcell.

tarcieri avatar tarcieri commented on August 28, 2024

I should probably expound: lots of cases cropped up where the registry being an actor was advantageous. The most notable was Zookeeper where an actor could keep a local cache which Zookeeper could actively invalidate and replace with new values. Saving a network trip while still receiving push updates in realtime is a huge win

from dcell.

aflatter avatar aflatter commented on August 28, 2024

@tarcieri, @halorgium: I think the overhead is negligible for now. DCell::Registry::Base already is an actor: aflatter@b51d622#L2R2

@Neonlex I don't really like exposing such functionality. The Node#delete method removes a node from the directory, thus making it inaccessible for all other nodes too. DCell should handle node unavailability in a deterministic way, maybe using distributed concensus.

from dcell.

Asmod4n avatar Asmod4n commented on August 28, 2024

@tarcieri @aflatter @halorgium zeromq(czmq) can soonish be used to handle all registry needs, https://github.com/zeromq/czmq/blob/master/src/zgossip.c#L442 might be of interest.

Have also written a ruby ffi wrapper for czmq, here is a gossip example: https://github.com/Asmod4n/ruby-ffi-czmq/blob/master/examples/gossip.rb

from dcell.

tarcieri avatar tarcieri commented on August 28, 2024

Cool!

from dcell.

niamster avatar niamster commented on August 28, 2024

I've cleaned up a bit the Registry API in pull request #91
Though, as @tarcieri I have doubts whether those should be actors. I noticed a quite noticeable overhead in my stress testing.
Probably a particular implementation should be an actor if registry BE library can't handle asynchronous requests. Mainly DCell does read access so I don't see a good reason to serialize access.

from dcell.

niamster avatar niamster commented on August 28, 2024

No feedback means everybody satisfied with current registry API?

from dcell.

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.