Code Monkey home page Code Monkey logo

Comments (3)

hhblaze avatar hhblaze commented on July 24, 2024

Hi, can you give a small example of your purpose?

from dbreeze.

HardySmith avatar HardySmith commented on July 24, 2024

I try to replace LevelDb (or Rocksdb) with DBreeze. I really like it. Seems to be really fast and realible.
However, my datastructures are binary only.

First 16 bits describe the table, next 8 some attributes, then indexnumber, later on a keytype and the byte[] value of something. maybe a rowident for an index-entry.

To maintain an order and to produce some secundary indexes, I have to compare my bytearray. In LevelDb this is possible by obening a Database and pass a option:

        options.Comparator = Comparator.Create(
            "MyCompare",
            (xs, ys) => Compare.Comparer.BinaryCompare(((NativeArray<byte>)xs).Select(x => x),
                ((NativeArray<byte>)ys).Select(y => y)));

Maybe that's not the intended way to use dbreeze, however a custom comparator might be comfortable sometimes.

from dbreeze.

hhblaze avatar hhblaze commented on July 24, 2024

I understand, this meaning you took from LevelDb and I am not sure it is possible so directly in DBreeze. Here keys are lexicographically sorted for maximal efficient search. There are some special functions to help to covert numerical data types into "lexicographically" sortable.

Here are some docs, like How DBreeze index works, to have understanding about the fact that we create indexes depending upon queries we are going to apply and Object-DBreeze to see that query types can be so different that leads to rearranging of the key and appearance of the secondary indices.

Keys are created for different types of range search and traversing and can be created manually by using functions from
DBreeze.Utils.BytesProcessing that contains rich library to work with byte[]: conatenating, comparation (_ByteArrayEquals), cutting and so on...

Please reopen that issue if you have practical advices that are really implementable concerning your question.

from dbreeze.

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.