RFC: mongo "_id" fields in the multi-environment juju server world
John Weldon
johnweldon4 at gmail.com
Fri Jul 4 14:06:10 UTC 2014
On Fri, Jul 4, 2014 at 6:56 AM, Gustavo Niemeyer <gustavo at niemeyer.net>
wrote:
> > 1. change the _id field to be a "composed" field where it is the
> > concatenation of the environment id and the existing id or name field.
> > If we do take this approach, I strongly recommend having the fields that
> > make up the key be available by themselves elsewhere in the document
> > structure.
>
> I'd go with this, including your suggestion of splitting the data
> apart in proper fields. Sounds straightforward and comfortable to deal
> with.
>
>
I'd be interested in trying this approach with Actions. We've gone back
and forth
between encoding units *only* in the _id or *also* in the document.
Both have pro's and con's, but it seems to me that a composite _id
would address most of the con's on each approach.
I'm also interested in figuring out how the watchers will work in this
approach.
The Actions watcher is a StringsWatcher, and the .Changes() are []string
I'm assuming that will have to become a more specialised watcher where
.Changes() returns a list of objects representing the composite key? Also
how the watcher detects relevant events might have to be adjusted somewhat.
--
John Weldon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju-dev/attachments/20140704/769be353/attachment.html>
More information about the Juju-dev
mailing list