dsgw8802 2013-08-16 13:20
浏览 35
已采纳

关于将实体分为两个以提高性能的GAE。(golang)

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

  • 写回答

1条回答 默认 最新

  • doushi4633 2013-08-16 15:35
    关注

    If the data in group 1 doesn't change, indexes don't get updated, so there's no monetary cost involved with updating them, while there is a cost to doing the second fetch.

    You always need all the data so it doesn't make sense for you to split them.

    The benefit you would get from splitting would be in performance. Fetching/putting a small entity takes less time than a big entity. So, for example, if Group 1 was really big (as in total size in bytes) and you didn't need the data, you could improve your performance by only fetching/putting an entity with Group 2. This doesn't sound like your scenario.

    If say group 1 was 500KB, I'd consider splitting it. Although if you have to fetch group 1 all the time anyways, that nullifies the benefit.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 全部备份安卓app数据包括密码,可以复制到另一手机上运行
  • ¥15 Python3.5 相关代码写作
  • ¥20 测距传感器数据手册i2c
  • ¥15 RPA正常跑,cmd输入cookies跑不出来
  • ¥15 求帮我调试一下freefem代码
  • ¥15 matlab代码解决,怎么运行
  • ¥15 R语言Rstudio突然无法启动
  • ¥15 关于#matlab#的问题:提取2个图像的变量作为另外一个图像像元的移动量,计算新的位置创建新的图像并提取第二个图像的变量到新的图像
  • ¥15 改算法,照着压缩包里边,参考其他代码封装的格式 写到main函数里
  • ¥15 用windows做服务的同志有吗