fully tuned couchbase except two views. code can be made little pythonic for views handling