1

I have an entity Account which Contain mainly two groups of information.

Account {
    a1 // Group 1 rarely change
    a2
    a3
    a4
    ...
    b1 // Group 2 change frequently
    b2
    b3
    b4
    ...
}

First group is general info which will not update too frequent but group two will be changing frequently.

I wonder if I should extract Group 2 into another entity and store the key in Account so when I update group 2, I only need to put() the data of group 2.

My concern is, almost all operation to server would mostly require data from both group 1+2. If I split Account into 2, I need to do two get() to retrieve both data.

I know that read form data store is much inexpensive than write. But splitting the entity don't reduce the call to put(). In this case, I don't know if I should focus performance on put() or get().

Thanks

4

1 回答 1

1

如果第 1 组中的数据没有变化,则索引不会更新,因此更新它们不涉及金钱成本,而进行第二次提取则有成本。

您总是需要所有数据,因此拆分它们没有意义。

您从拆分中获得的好处将是性能。获取/放置一个小实体比一个大实体花费更少的时间。因此,例如,如果第 1 组真的很大(以字节为单位的总大小)并且您不需要数据,您可以通过仅获取/放入第 2 组的实体来提高性能。这听起来不像你的场景。

如果说第 1 组是 500KB,我会考虑拆分它。尽管无论如何您都必须始终获取第 1 组,但这会使好处无效。

于 2013-08-16T15:35:25.490 回答