Roald de Vries | 30 Mar 13:07 2015
Picon

Ordered changes feed in v2.0

Hi all,

I’m considering how I can make my application forward compatible with v2.0, and I see a potential problem
with that (for my use case):

I have a front-end that generates events, which I store in CouchDB. An asynchronous back-end process
listens to a feed of these events, and writes an aggregate back to the db. I can’t use a view for this,
because the aggregate also depends on documents referenced from the event documents.

For this to work, I need to be sure to process every event, and in the correct order. I v1.X, I can simply store
the last processed change, and continue from there at any moment. Would this still work in v2.0? As I
understand now, the order of the changes in v2.0 is no longer ordered. Is there a way to still get a
consistently ordered feed from?

Thanks in advance, Roald
Roald de Vries | 30 Mar 12:45 2015
Picon

Stop replication immediately

Hi all,

I have a problem with stopping replication.

I have 1 main database containing all data, and then per-user databases containing limited data. The
user-databases are filled by filtered continuous replication. Specifically, some user-metadata
document for the user is replicated, containing a field for `receivesUpdates`. Now if I turn that field to
`false`, I want the replication job to stop immediately, and not send a document anymore. It could be a
privacy issue if another document is replicated after setting `receivesUpdates` to `false`.

The best I’ve come up with so far is to have a changes-feed listener that stops the replication job when it
detects such a change in the main database. But before the replication is stopped, I guess another change
might have come through.

My question is: is there a solution for this problem?

Thanks in advance, Roald
Matthieu Rakotojaona | 28 Mar 16:12 2015
Picon

[ANN] jqouch, a jq-based view server

Hello guys,

I'd like to announce a jq-based view server for couchdb. It's extremely
rudimentary, but works as a proof of concept of what can be achieved:

https://github.com/rakoo/jqouch

A bit of background: jq is a cli tool to extract and render information
from any json you give it, with a custom but powerful syntax:

$ curl localhost:5984 | jq '.vendor .version'
"1.6.1"

$ curl localhost:5984/mydb | jq '.disk_size - .data_size'
80892224

Looks like I'd better compact !

If you're dabbling with json and not using it already, I encourage you
to check it out.

Basically jq is invoked with a filter (that's the '.vendor .version'
from the example above); you then feed jq with a JSON document in stdin,
and it gives you all matches and transformations on stdout.  jqouch
works by taking the function given in "add_fun" and spawning an external
process with this fun as a filter, and forwarding documents in "map_doc"
to it. All output from jq is then sent back to CouchDB through jqouch
(jq processes are not killed after each doc, they stay alive as long as
the stdin is not closed, which jqouch never does until it dies)

(Continue reading)

Lena Reinhard | 26 Mar 20:06 2015
Alexander Shorin | 26 Mar 17:19 2015
Picon

py-couchdb project is looking for a new maintainer

Hi everyone,

py-couchdb[1] project is looking for a new maintainer. If someone
interested and would like to help, please contact with Andrey Antukh
<niwi@...>. Thanks!

[1]: https://github.com/niwibe/py-couchdb

--
,,,^..^,,,

Russell McOrmond | 25 Mar 20:49 2015
Picon

Is it possible to really "reduce" the output of a reduce?


  This is a beginner question from someone who only installed CouchDB a
few weeks ago.

  What I'm trying to do may be simple, but the current way I'm doing it
is extremely slow.   I have a view where after the work done by the
reduce, most of the keys have no value and I would like to skip them.
Out of hundreds of thousands of keys, there is more often less than a
hundred keys that actually have a value.  (When I don't return anything,
which shows up as a "null" value).

  Currently I have a _list which loops through all the values and skips
all the null's.  This takes quite a bit of processing time to go through
hundreds of thousands of nulls to find the few that are not null.

  Ideal is if the b-tree that my view created simply didn't include the
keys where the value is null.   Is this possible?  IE: Is it possible to
do an "emit" like thing rather than "return" from the reduce function,
and not include specific keys?

Note: I've heard about chained map/reduce that might solve this problem,
but hoping there is a shorter term solution that doesn't involve moving
away from CouchDB as we've invested a fair bit of time learning CouchDB
already.

--

-- 
Lead Systems Engineer, Canadiana.org   http://www.canadiana.ca

Michael Power | 25 Mar 18:14 2015

Couchdb db and view replication

We are trying to setup couchdb replication from one couchdb instance to the other with a master slave style
configuration.  We want to be able to switch from the master to the slave if the master goes down.  We have been
able to replicate data, we have been able to create the new databases automatically.  But when replication
happens the views do not get replicated.  Thus we would not be able to switch from master to slave when the
master goes down.

Is it possible to include the views in the replication?

Michael Power
Robert Nagy | 23 Mar 14:19 2015
Picon

Faking External Attachments Using Reverse Proxy

I’m looking into faking external attachments by rewriting all attachment related requests in a reverse
proxy so that they go to and from a storage service e.g. S3. From the clients point of view it should be “as
if” the attachments were in the database.

Rewriting the requests listed here
http://docs.couchdb.org/en/latest/api/document/attachments.html
<http://docs.couchdb.org/en/latest/api/document/attachments.html> should not be a problem.
However, I’m unsure whether there are any other attachment related requests that we might need to take
into account. I’m in particular worried about the scenario where a CouchDB with internal attachments
syncs up with a database behind the proxy. What is the API for attachments during sync/replication?
Best Regards,

Robert Nagy

Robert Nagy
Mail: robert.nagy@...
<mailto:robert.nagy@...> | Phone: +46 (0)735441639 | Web:
Boffins Technologies AB <http://www.boffins.se/>

Boffins Technologies
Södervägen 12
232 52 Åkarp
Sweden

Lena Reinhard | 20 Mar 10:17 2015

[BLOG] The CouchDB Weekly News is out

Hi folks,

this week’s CouchDB Weekly News is out:

http://blog.couchdb.org/2015/03/19/the-couchdb-weekly-news-march-19-2015/ <http://blog.couchdb.org/2015/03/19/the-couchdb-weekly-news-march-19-2015/>

If you want to help us promote the News, please share them, e.g. in these networks:  
Twitter:  https://twitter.com/CouchDB/status/578646061339783170 <https://twitter.com/CouchDB/status/578646061339783170>
Reddit: 
http://www.reddit.com/r/CouchDB/comments/2zmc17/the_couchdb_weekly_news_march_19_2015/ <http://www.reddit.com/r/CouchDB/comments/2zmc17/the_couchdb_weekly_news_march_19_2015/>
G+: https://plus.google.com/b/109226482722655790973/+CouchDB/posts/YY5nnJTRiXU <https://plus.google.com/b/109226482722655790973/+CouchDB/posts/YY5nnJTRiXU>
Facebook:
https://www.facebook.com/permalink.php?story_fbid=633635360002025&id=507603582605204 <https://www.facebook.com/permalink.php?story_fbid=633635360002025&id=507603582605204>
Linkedin:
https://www.linkedin.com/company/5242010/comments?topic=5984412823604723719&type=U&scope=5242010&stype=C&a=_0Yt&goback=%2Ebzo_*1_*1_*1_*1_*1_*1_*1_*1_apache*5couchdb <https://www.linkedin.com/company/5242010/comments?topic=5984412823604723719&type=U&scope=5242010&stype=C&a=_0Yt&goback=.bzo_*1_*1_*1_*1_*1_*1_*1_*1_apache*5couchdb>

In case you haven’t joined the CouchDB Advocate yet: we want to invite you to support us there and help us
spread the word about CouchDB: https://couchdb.influitive.com/ <https://couchdb.influitive.com/>

Best,
Lena
Michael Power | 19 Mar 19:51 2015

Couchdb flush to disk

Is there a way we can ask couchdb to flush to disk and block all writes.  We would like to get the disk in a
consistent state and do a disk based backup.  Is this possible?  The actual backup takes milliseconds we
just need the disk in a consistent state for those milliseconds.

Michael Power
Alexander Gabriel | 19 Mar 16:40 2015
Picon

why is first doc revision missing shortly after creating a doc?

I'm building an app in which teams can work together on projects.
The app uses pouchdb in the browser and couchdb on the server.

This is the architecture:

   - *a db per user* (= userDb): the user gets a role per project
   The user doc (= userDoc) in the _users db (= _usersDb) is not enough
   because it can't be synced to pouchdb without admin credentials. So I
   create a userDb for every user. UserDb's can be synced between pouchdb and
   couchdb using the user's credentials.
   I also have a server script that keeps the userDoc in userDb and
   _usersDb in sync by following the userDb's change feed and updating the
   userDoc in _usersDb when necessary

   - *a db per role* = projectDb's. Roles are the project names.
   The projectDb's are synced between pouchdb and couchdb using the user's
   credentials.
   The server script creates new projectDb's when it detects new roles in
   changes in the userDoc in the userDb.

When a new user signs up:

   - the server script detects the addition of a new document in the
   _usersDb
   it creates a new userDb in couchdb and writes the userDoc from _usersDb
   into userDb, deleting the _rev before
   couchdb now answers with a rev of '*1-f08290f92631a838d6775736478cb8f8*'
   for the userDoc
   - the app creates a new userDb in pouchdb
   - the app creates a new (initial) project including a new projectDb in
(Continue reading)


Gmane