非关系数据库,键值或平面表

编程入门 行业动态 更新时间:2024-10-21 11:49:28
本文介绍了非关系数据库,键值或平面表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我的应用程序需要可配置的列,并且这些列的标题在开始时配置。如果关系数据库我会在表中创建类似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.

更多推荐

非关系数据库,键值或平面表

本文发布于:2023-07-27 23:06:58,感谢您对本站的认可!
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:键值   平面   关系   数据库

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!