[Sugar-devel] On datastore object IDs
Benjamin M. Schwartz
bmschwar at fas.harvard.edu
Thu Jul 2 13:40:23 EDT 2009
Eben Eliason wrote:
> Hmm, I think that only objects have titles and user editable metadata
> (tags/description, etc.). If I open Write, and name that Document in
> the usual way, that title should be associated with that object. The
> action will happen to read like:
>
> Wrote [My Story]
>
> And clicking on the icon next to "My Story" in the action should
> resume the activity, but the name is actually belonging to the object
> that the action refers to.
I think sessions can have names too. If I start an instance of the Chess
activity and share it with the name "Bedford Middle School Chess Club
Summer Tournament", then that's the name of the entire session, even if it
produces multiple Documents or no Documents.
>> extend it to objects. However, I think that we can keep this as it
>> currently is: a metadata attribute like any other. When I share an object
>> with you, it may get a new tree_id and a version_id of 1, but it keeps all
>> its metadata, including its title.
>
> This seem fundamentally wrong to me, but perhaps that's because I'm
> not actually seeing how these 2 problems you bring up are problems.
What seems wrong? What problems?
> Why can't a given Document (tree_id, version_id) be referenced from
> any number of actions?
It could be. It just seemed simpler to disallow it.
If editing a Document's metadata produces a new Document, as befitting our
Copy-on-Write model of versioning, then the process of editing the
"associated_actions" field produces a new version. Therefore, every time
an Action adds a Document to itself, the process of adding the
back-reference would produce a new version of the Document, so only one
Action would ever end up referring to one version of the a Document.
If editing a Document's metadata doesn't produce a new Document, then we
have a hilarious race condition in which two Activities, both referencing
the same Document, edit the "associated_actions" field at the same time,
and one of them ends up getting dropped, producing a corrupted datastore.
If back-references aren't stored in the Document's metadata, then either
the datastore has to maintain an inverted index of the references in the
Actions, or it has to perform an enormously expensive search to find which
Actions are associated with a given Document. This adds complexity.
--Ben
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
Url : http://lists.sugarlabs.org/archive/sugar-devel/attachments/20090702/1a0f741e/attachment.pgp
More information about the Sugar-devel
mailing list