[PD] Announcing CouchPdb development

Thomas Mayer thomas at residuum.org
Sat Aug 27 01:00:35 CEST 2011


inspired by the great effort of Louis-Philippe with Puredis, I have
started developping a library for another of the NoSQL databases out
there, CouchDB.

CouchDB is a database with a RESTful interface, i.e. you connect to the
database with HTTP requests and depending on the HTTP method you perform
the operations. The data you send to CouchDB for storage and the data
you receive back from CouchDB are JSON objects, so (more or less) as a
lemma, the library also contains objects for encoding and decoding JSON

The current version is online at https://github.com/residuum/CouchPdb

A reason for developping the library is Ubuntu One, as it offers a free
5GB space and includes a CouchDB database.

All is in an early stage of development, so do not expect anything to
work, it is still very experimental.

I mainly uploaded it to Github to discuss a few points, where I do not
know how to deal with in a manner fitting Pd, especially when it comes
to encoding and decoding JSON data:

- How should JSON data be dealt with in general? I am currently just
outputting one long symbol separated by spaces, so an object of
	{"id":1, "name": "my-name"}
	id 1 name my-name
	{"id":1, "name": "my name", "year":2011}
	id 1 name my name year 2011
and thus breaks the pattern of "key value key value key value".

I could output this as list, which would make spaces in values not break
the pattern of "key value key value key value" (really?). But is this
really a way to represent data in the correct Pd way, i.e. does this
data format fit the principle of least surprise?

- How should nested objects and arrays be handled? Should they be
handled at all?

- How to implement attachments (binary files) for data? Or should I
forget about this stuff and e.g. store images as base64 encoded strings?
I am asking this one in particular, because one application of the
object that came into my mind would be a website to upload pictures that
are downloaded by a Pd patch in an installation in some gallery, or
multiple gallery installations worldwide uploading snapshop images and
interacting somehow.

Please do not read the code ;) I have not programmed C for ~10 years,
and I have never coded anything but simple stuff for university. So
actually: Read the code and give me pointers (no pun intended) to
problematic code.

Best regards,
"Prisons are needed only to provide the illusion that courts and police
are effective. They're a kind of job insurance."
(Leto II. in: Frank Herbert, God Emperor of Dune)

More information about the Pd-list mailing list