[英]What's the name for a cached copy in a document store?
Nontechnical, naming question: 非技术性的命名问题:
I've got a document that contains a reference to another document. 我有一个文档,其中包含对另一个文档的引用。 Most times I access it I need a couple fields from the referred document, so I store those alongside the reference to avoid the lookup. 多数情况下,我需要从引用的文档中获取几个字段,因此我将这些字段与引用一起存储以避免查找。
Mongo example: Mongo示例:
auto 汽车
{
'color' : 'blue',
'maker' : {
'_id' : '1234',
'name' : 'Ford'
}
...
}
maker 制作者
{
'_id' : '1234',
'name' : 'Ford',
'ceo' : 'Alan Mulally'
...
}
So the auto.maker.name is not a primary source-- it should never be changed, except as a result of the maker's name being changed, which is costly but very rare. 因此,auto.maker.name并非主要来源-绝不可更改,除非更改了制造商的名称,这很昂贵,但非常罕见。
What do you call this field? 你怎么称呼这个领域? The best I've seen is 'cached' but that's pretty overloaded, particularly when talking about data storage. 我所见过的最好的方法是“缓存”,但是这非常重载,尤其是在谈论数据存储时。 Is there a better term? 有更好的名词吗?
To be completely honest, you should really look at changing your schema to fit within the guidelines of NoSQL and in particular Mongo. 老实说,您应该真正考虑更改架构以使其符合NoSQL(尤其是Mongo)的准则。
You really don't want an architecture where you're having to look things up on each query. 您确实不想要一种必须在每个查询中查找内容的体系结构。
If you have to name it something; 如果您必须命名的话; I'd name this data what it's pointing to; 我将此数据命名为指向的数据; in this case your _id is marker_id or at least have it reference your secondary lookup table so that in the code you're using to query this you can write a generic condition on the particular column and will know where to find it's lookup value. 在这种情况下,您的_id是marker_id,或者至少让它引用了辅助查找表,以便在您用来查询它的代码中,您可以在特定列上编写通用条件,并知道在哪里可以找到它的查找值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.