← Back to team overview

u1db-discuss team mailing list archive

Re: Data Model

 

On Wed, 2011-11-16 at 09:49 +0000, John Rowland Lenton wrote:
> On Sat, 12 Nov 2011 17:12:52 -0500, Rodney Dawes <dobey.pwns@xxxxxxxxx> wrote:
> > Hi all,
> > 
> > Are we going to specify a data model at all for how the content of the
> > JSON objects should be structured for storing in the DB? Sort of like
> > the schema definitions we had for Contacts/etc… in desktopcouch?
> 
> I think this is a layer above u1db, and I don't think u1db should
> mandate this (unless it turns out to be necessary for performance or
> readability or whatever). And... I wouldn't be upset if one particular
> backend or implementation had some kind of restriction (e.g. "toplevel
> must be a json object, not list, and all entries must have the same
> keys). I'd recommend against it, as it makes it less useful, however.

I agree this is a layer above u1db, but I think we should design the
u1db API in such a way that this is very easy for people to implement,
and easy for us to provide index/search of. Which basically means that
we define the toplevel is a JSON object, and it has a _type field which
is a string containing a URI (basically the same as we had with dc).

Also does not the index API basically dictate the toplevel being a JSON
object? Why would all the keys need to be the same, if it were an object
instead of a list? From what I can tell, having it be a list is pretty
much completely useless to any actual application developers.




References