5 Replies Latest reply: Nov 29, 2011 10:00 AM by greybird RSS

    Modifying KV examples

      Hello all,

      I am trying to understand the schema examples which are available in the download and am doing this by trying to modify the code.
      The code says the following about the deleteExistingData:

      * This method is unrealistic in that it uses KVStore.storeKeysIterator to
      * iterate over all user Keys and delete each of them individually. In a
      * real application with multiple clients or client threads, this approach
      * wouldn't work well because the set of deletion operations is not atomic,

      Is it possible to do a bulk delete instead of iterating over all user Keys?

      regards Hans-Peter

      Edited by: user551641 on 28-nov-2011 12:21
        • 1. Re: Modifying KV examples
          Hello Hans-Peter,

          In general, any set of operations that modifies or deletes many different major key paths will be expensive, because it operates on many (or all) nodes in the system. The example clears the entire store this way to make the example simpler, and the warning is because we don't expect apps to use that approach.

          No, there is currently no bulk delete operation. This FAQ describes one approach:

          Could you please describe your use case for bulk deletion, so we can keep it in mind as we go forward?

          • 2. Re: Modifying KV examples

            Thanks for your reply.

            I am, as an Oracle RDBMS dba, just looking into the NoSql database to see how it works.
            The example mentions that the iterative delete is not realistic. That made wonder if there are more efficient
            Perhaps it is just 'works as designed' and is the iterative delete fine.
            I do not know whether a bulk delete would be appropriate for the use that NoSQL is designed for.

            On the other hand, if it is possible to implement a bulk delete in any form then why not?

            regards Hans-Peter
            • 3. Re: Modifying KV examples
              A bulk delete is definitely something we would like to consider in the future, but for us it is all about prioritizing. :-) That's why I wondered if you had a specific use case in mind -- would you need to delete all data in the store (which I would see as a future admin function), or all records with a specific key prefix, etc?

              • 4. Re: Modifying KV examples
                Hi Mark,

                I would expect that it would be able to remove all entries of a certain type.
                Since the data in NoSQL can be of any kind I think it would be good if all the data belonging to a certain type.
                So that would be : delete all the entries with major part '/user'.
                And also delete all the entries of entries with major part '/user/user4@example.com/'

                regards Hans-Peter
                • 5. Re: Modifying KV examples
                  Thanks for the feedback.
                  So that would be : delete all the entries with major part '/user'.
                  This is currently done as described in the FAQ, and we may add bulk delete alternatives in the future.
                  And also delete all the entries of entries with major part '/user/user4@example.com/'
                  This is currently done efficiently with KVStore.multiDelete.

                  Thanks again,