我的应用程序需要可配置的列,并且这些列的标题在开始时配置。如果关系数据库我会在表中创建类似CodeA,CodeB等的泛型列,因为它有助于在这些列上排队(代码A = 11)它也有助于显示值(如果该列存储代码和值),但现在我正在使用非关系数据库数据存储(我是新手),我应该遵循相同的旧方法还是我应该使用集合(键值对)结构类型。
这些列上会有很多过滤器。请建议
解决方案您刚刚描述的是Key-Value数据库的经典场景之一。这里的限制是你不会有许多你习惯的基于集合的工具。
大多数KV数据库都非常适合加载一个记录或其中的一小部分。但是,他们往往不擅长加载任何可能需要加入的东西。鉴于您正在使用AppEngine,您可能会欣赏这种限制。但值得一提的是。
重要的是,并非所有K-V数据库都允许您按任意列选择。许多K-V商店实际上只允许通过主键进行选择。如果你看一下MongoDB,你会发现你可以查询任何听起来像是必要功能的列。
My application needs configurable columns , and titles of these columns get configured in the begining, If relation database I would have created generic columns in table like CodeA, CodeB etc for this need because it helps queering on these columns (Code A = 11 ) it also helps in displaying the values (if that columns stores code and value) but now I am using Non Relational database Datastore (and I am new to it), should I follow the same old approach or I should use collection (Key Value pair) type of structure .
There will be lot of filters on these columns. Please suggest
解决方案What you've just described is one of the classic scenarios for a Key-Value database. The limitation here is that you will not have many of the set-based tools you're used to.
Most of the K-V databases are really good at loading one "record" or small set thereof. However, they don't tend to be any good at loading anything that may require a join. Given that you're using AppEngine, you probably appreciate this limitation. But it's worth stating.
As an important note, not all K-V database will allow you to "select by any column". Many K-V stores actually only allow for selection by a primary key. If you take a look at MongoDB, you'll find that you can query any column which sounds like a necessary feature.
更多推荐
非关系数据库,键值或平面表
发布评论