>From previous threads, it seems that the datastore prefers few large
entities to more smaller ones - this is also reflected in pricing, you
pay per operation as well as per byte. Storing a Map of Name->Value is
exactly what the datastore is made for.

I did talk to Jeff at Objectify about this (because I'm using
Objectify for all my other entities) and he said that although this
use case is probably valid and I'm (clearly now) not the only one
doing it, making Objectify handle this case would complicate it too
much. I think I agree with this, especially since the datastore
handles properties like this so nicely.

In addition, I can now make use of Objectify's CachingDatastoreService
which means I don't have to worry about Memcache :-)

One thought - can you search based on an item in a collection? If not
and you do need to search based on these values, you might need to be
more creative about how to split them.
MyName->MyValue1
and
MyName->MyValue2
which might become...
MyName->Collection([MyValue1, MyValue2])
or perhaps...
MyName.1->MyValue1
and
MyName.2->MyValue2
if MyName.1 will never be a property name itself, and you can deal
with parsing this.

Thanks,
Mat.

On 4 November 2011 07:53, Mister Schtief <[email protected]> wrote:
> hi gerald,
>
> thx for your answer but this is the ugliest solution ;) why serializing all
> pairs and storing them in one.property .... it will never be searchable...
>
> using one entity property for every map.entry or using one entity of a key
> value pair type, thats the question ;)
>
> schtief
>
> Am 04.11.2011 07:10 schrieb "Gerald Tan" <[email protected]>:
>>
>> You can serialize a Map<String,String> property into a byte array to be
>> stored in the entity
>> The easiest way to do this would be to use Objectify with the @Serialized
>> annotation
>>
>> http://code.google.com/p/objectify-appengine/wiki/IntroductionToObjectify#@Embedded
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine for Java" group.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msg/google-appengine-java/-/_tZZPKf5r6cJ.
>> To post to this group, send email to
>> [email protected].
>> To unsubscribe from this group, send email to
>> [email protected].
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.

Reply via email to