Git Product home page Git Product logo

Comments (4)

heyitsanthony avatar heyitsanthony commented on May 29, 2024

The path naming could probably stand to be redone to be more efficient overall. Maybe a debugging tag to build with human-readable paths vs the normal release using binary encodings?

from zetcd.

wrouesnel avatar wrouesnel commented on May 29, 2024

Something I'm not clear on is why it's done that way in the first place? The best I can come up with is it's to deal with '/' characters which aren't path separators but since all the calculation is done based on '/' characters anyway...why not just keep them?

from zetcd.

heyitsanthony avatar heyitsanthony commented on May 29, 2024

It encodes the depth for efficient directory listing. Consider:

/a/b
/a/b/1
/a/b/2
/a/b/3/x

Since etcd3 doesn't have a hierarchy, only a flat keyspace, it can only do range requests on keys. If I want to list /a/b/, it's inefficient to do a prefix list on /a/b/ since that will also fetch /a/b/3/x. Instead, it prefixes the path with a depth <3>/a/b/1, <3>/a/b/2, <3>/a/b/3, <4>/a/b/3/x. Listing /a/b/ becomes a prefix request on <3>/a/b/; it does not fetch /a/b/3/x since <4>/a/b is not a prefix of <3>/a/b.

from zetcd.

wrouesnel avatar wrouesnel commented on May 29, 2024

Ah right, thanks.

from zetcd.

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.