Datomic 分区解决了哪些性能问题?
What performance problems do Datomic partitions solve?
我正在尝试为我的 Datomic 模式规划分区,但我不确定分区可以解决哪些问题,哪些问题不能解决。
分区不正确怎么会出错?
是关于网络往返吗?减少对等内存占用?内存中查询性能?
具体来说,以下哪种方法无效?
- "I have a lot of 'website user' entities, but most of their bytes weight is in their hashed password and salt. So I'll put those attributes in a different entity in another partition so it does not fill up my Peers when doing aggregation jobs."
- "I have a few hundreds entities that will be involved in almost every query, so I'll make a partition just for those to make sure they're always in the object cache".
- "The entities I query together tend to be created at the same time, so I'll have several partitions that contain the same kind of entities, but I'll change the one in which I save new entities every 3 months."
EAVT
索引包含按实体 ID 排序的数据。分区以这些 ID 的高位编码。因此,分区用于通过为您提供一种控制数据局部性的方法来改进对等缓存。
如果您知道查询通常涉及一组公共属性,则应将所有这些属性放在同一个分区中,以便从存储中取出的段包含尽可能多的有用数据。
为了回答您的问题,有效地选择分区将通过利用对等缓存来提高查询性能,即避免额外的网络往返存储。
我正在尝试为我的 Datomic 模式规划分区,但我不确定分区可以解决哪些问题,哪些问题不能解决。
分区不正确怎么会出错?
是关于网络往返吗?减少对等内存占用?内存中查询性能?
具体来说,以下哪种方法无效?
- "I have a lot of 'website user' entities, but most of their bytes weight is in their hashed password and salt. So I'll put those attributes in a different entity in another partition so it does not fill up my Peers when doing aggregation jobs."
- "I have a few hundreds entities that will be involved in almost every query, so I'll make a partition just for those to make sure they're always in the object cache".
- "The entities I query together tend to be created at the same time, so I'll have several partitions that contain the same kind of entities, but I'll change the one in which I save new entities every 3 months."
EAVT
索引包含按实体 ID 排序的数据。分区以这些 ID 的高位编码。因此,分区用于通过为您提供一种控制数据局部性的方法来改进对等缓存。
如果您知道查询通常涉及一组公共属性,则应将所有这些属性放在同一个分区中,以便从存储中取出的段包含尽可能多的有用数据。
为了回答您的问题,有效地选择分区将通过利用对等缓存来提高查询性能,即避免额外的网络往返存储。