Google Datastore Strong consistency and Entity Group max size

拟墨画扇 提交于 2019-12-22 10:00:07

问题


In a shared expenses app that shows payments dues and shared expenses details for each group. As a financial application, so many operations are transactional, which requires strong consistency to ensure data integrity. We used Entity Groups and ancestor queries which seems to have solved the issue of strong consistency, this caused the entity group to be large in size. As the shared 'group' is now the parent of members, expenses, payments, dues..etc. Until now we don't see a problem, but we are worried as this scales, expenses and/or payments can scale to the order of 10~100K entities.

After a bit of research we found these suggestions:

  1. Turning back to eventual consistency, and writing to memcache to overcome eventual consistency. Is this the best solution? We couldn't find enough docs on how to update an entity in memcache, if you know any please share! Also how can we ensure writes are transactional in that case?
  2. Keep things as is, as there is no entity group size. But we are worried of what would happen later, as the docs mentioned keeping entity groups no larger than a single user's worth of data
  3. Switch to RDBMS, might be too late for that now

We don't have a problem with the 1 write/sec rule right now as usually in those groups there isn't much going on per second for this to cause a problem, but we don't want to run into an issue later. It would be cumbersome to migrate or change the data models, specially that changing or removing ancestors, requires rewriting the entities, lots of delete and write requests which also costs!

Appreciate your input

来源:https://stackoverflow.com/questions/48613205/google-datastore-strong-consistency-and-entity-group-max-size

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!