Uploaded image for project: 'Couchbase Java Client'
  1. Couchbase Java Client
  2. JCBC-433

Java SDK Docs: comprehensive best practices example

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Won't Do
    • Critical
    • None
    • 1.3.2
    • Documentation
    • Security Level: Public
    • None

    Description

      As a possible improvement to our existing docs, I was thinking that a comprehensive example of Java code showing the various components and strategies that an end-user would need to be aware of and how to handle those within our best practices would be helpful.

      It's along the lines of the existing tutorial, but might actually be something separate since it's more about best practices rather than actually developing to Couchbase and can be used as a reference for seeing all those best practices come together.

      We certainly have a lot of this existing already, I just haven't been able to see it all in one place to point a customer to.

      From a format perspective, I think it would be helpful to have the full set of code on a page with various breakpoints/callouts/even inline comments that explain the various techniques and link further into the documentation for further reading. There can be commented-out sections for "other application logic <here>" as this really just needs to highlight the best practices of working with our Java library.

      At least to include:
      -Singleton creation and reuse of the client object across multiple threads. with error handling around if the connection can't be established
      -Using set to overwrite some data and add() to enforce uniqueness, maybe even incr() and append() examples
      -Using async operations with callbacks/listeners
      -Using the "AtomicInteger" to track outstanding async operations before shutting down the object
      -Proper exception catching and error handling around TMP_OOM, timeouts, failed add(), failed incr/decr, etc, possibly with some exponential back-off or other way of passing feedback up the stack
      -Handling of "not found" from the get()
      -Bulk gets
      -Example of bulk set()s (different than a single async set, if the user knows that there are many items they want to set in bulk)
      -Possibly putting some error handling code within the callbacks
      -Turning on of our profiling feature
      Object>JSON encoding/decoding as well as handling of writing/reading non-JSON data to CB
      -more?

      Obviously there's a lot to put in here but I would also think that it doesn't need to be an all-or-nothing but can start with some simple pieces and be built upon. Certainly as we add more functionality or different ways of doing things this doc will have to be extended anyway.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            daschl Michael Nitschinger
            perry Perry Krug
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty