This discussion is archived
4 Replies Latest reply: Jan 31, 2012 7:03 AM by greybird RSS

A few questions about the design of the scheme

910873 Newbie
Currently Being Moderated
Hello, all!

I want ask some question about design of the scheme.

1) If i store info about user (for example: /Smith/Bob - /phone values{+1 964 258 46 52}), i can request information by user (input parameters: /Smith/Bob - /phone, output:+1 964 258 46 52), but if i want get username by phone i must generate in store second string /19642584652 values{Smith Bob}. But I must duplicate any string - very prodigally. Are existing some work aruond?

2) if i want store some string with different minor key i put: ( /Smith/Bob - /phone, /Smith/Bob - /image, /Smith/Bob - /adress), but i already get duplicate date. Are existing any compressin major`s key? If yes - how it works

3) Are existing in Oracle NoSQL something like secondary index? If exist - how it works?

4) If i want get value by major key, im use get function(for example /Smith/Bob - /phone). How works searching algoritm? What mathematical basis of search?
  • 1. Re: A few questions about the design of the scheme
    Charles Lamb Pro
    Currently Being Moderated
    user13299586 wrote:
    Hello, all!

    I want ask some question about design of the scheme.

    1) If i store info about user (for example: /Smith/Bob - /phone values{+1 964 258 46 52}), i can request information by user (input parameters: /Smith/Bob - /phone, output:+1 964 258 46 52), but if i want get username by phone i must generate in store second string /19642584652 values{Smith Bob}. But I must duplicate any string - very prodigally. Are existing some work aruond?

    2) if i want store some string with different minor key i put: ( /Smith/Bob - /phone, /Smith/Bob - /image, /Smith/Bob - /adress), but i already get duplicate date. Are existing any compressin major`s key? If yes - how it works

    3) Are existing in Oracle NoSQL something like secondary index? If exist - how it works?
    You are correct that secondary index support would solve these three issues. That will be available in some future release.
    4) If i want get value by major key, im use get function(for example /Smith/Bob - /phone). How works searching algoritm? What mathematical basis of search?
    We hash the major key to locate the rep group that holds the record. On the rep group (a BDB JE/HA instance), we look up the record in a B+Tree using the major and minor keys.

    Charles Lamb
  • 2. Re: A few questions about the design of the scheme
    greybird Expert
    Currently Being Moderated
    2) if i want store some string with different minor key i put: ( /Smith/Bob - /phone, /Smith/Bob - /image, /Smith/Bob - /adress), but i already get duplicate date. Are existing any compressin major`s key? If yes - how it works
    There are two issues here.

    First, you should normally not use a separate minor key for every property. Multiple properties should be combined into one value (addressed by one key) to conserve system resources. You must design this based on your app access patterns. This is described in detail in the Getting Started Guide and also in the examples/schema program source code and comments. Please be sure you understand this concept.

    Second, it is often the case that many keys have the same prefix. NoSQL DB uses prefix compression to avoid redundant storage in this case.

    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
  • 3. Re: A few questions about the design of the scheme
    910873 Newbie
    Currently Being Moderated
    We hash the major key to locate the rep group that holds the record. On the rep group (a BDB JE/HA instance), we look up the record in a B+Tree using the major and minor keys.
    So, some a few clarifying questions.

    1) Request comes from the client(to cluster). It identifies the major key. And any rep group understand: contained in it is this line?
    2) If contains - they use b-tree map to find the right key (as local index in Oracle DB).

    Is it correct?

    Can i use any different algoritm to search, different indexes(function based) for example (on step 2)?
    You are correct that secondary index support would solve these three issues. That will be available in some future release.
    when the expected release of this option?
    it is often the case that many keys have the same prefix. NoSQL DB uses prefix compression to avoid redundant storage in this case.
    What algorithm used to compress the prefix of the key. And how it work`s.
  • 4. Re: A few questions about the design of the scheme
    greybird Expert
    Currently Being Moderated
    >
    So, some a few clarifying questions.
    1) Request comes from the client(to cluster). It identifies the major key. And any rep group understand: contained in it is this line?
    2) If contains - they use b-tree map to find the right key (as local index in Oracle DB).
    Is it correct?
    >

    No. Please read the doc and the other forum threads. They explain this issue.

    >
    Can i use any different algoritm to search, different indexes(function based) for example (on step 2)?
    >

    No.
    when the expected release of this option?
    Oracle employees cannot talk about future release dates and contents.
    What algorithm used to compress the prefix of the key. And how it work`s.
    If you're interested in the implementation details you can read the BDB JE documentation on key prefixing and the BDB JE source code. See com.sleepycat.je.DatabaseConfig.setKeyPrefixing.
    http://docs.oracle.com/cd/E17277_02/html/index.html

    --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points