首页 \ 问答 \ 为具有多个值的密钥建议数据库,具有高度可扩展性(Suggest a database for key with multiple values , highly scalable)

为具有多个值的密钥建议数据库,具有高度可扩展性(Suggest a database for key with multiple values , highly scalable)

我们有key-multipleValues的数据。 每个密钥可以有大约500个值(每个值大约为200-300个字符),这些密钥的数量大约为1000万。 主要操作是检查给定键的值。

我一直在使用mysql,我有两个选项:每个键值一行,每个键一行,文本字段中的所有值。但这些对我来说似乎没有效率,因为第一个模型有很多行,冗余和第二个模型文本字段将变得非常大。

我正在考虑使用nosql数据库为此目的,我以前使用mongodb,我不认为它适合我目前的情况。 基于keyvalue或基于列系列的nosql db会更好。不需要分发。使用riak,redis,cassandra等的人分享你的想法。

谢谢


We have data with key-multipleValues. Each key can have around 500 values (each value will be around 200-300 chars) and the number of such keys will be around 10 million. Major operation is to check for a value given a key.

I've been using mysql for long time where i've got 2 options: one row for each keyvalue, one row for each key with all values in a text field.But these does not seem efficient to me as the first model has lot of rows,redundancies and second model text field will become very large .

I am considering using nosql database for this purpose, i've used mongodb before and i dont think it is suitable for my current case. keyvalue based or column family based nosql db would be better.It need not be distributed.Someone who used riak,redis,cassandra etc pls share your thoughts.

Thanks


原文:https://stackoverflow.com/questions/6649535
更新时间:2023-06-13 20:06

最满意答案

我会考虑比较查询正常工作的示例远程服务时的数据,然后比较从控制器检索数据时的数据。 我怀疑这可以让您轻松查看数据显示格式的不同之处,以及需要采取哪些步骤来更改数据。 如果你仍然被卡住,你可以从这里发布结果json,我可能会给你进一步的指导,让你的他们排队。


I would consider comparing what the data looks like when you query the example remote service that works properly, and then comparing what the data looks like when you retrieve it from your controller. I suspect this could make it easy to see what is different with the format your data is appearing, and what steps need to be done to change it. If you are still stuck you could post the resulting json from both here, and I could likely give you further guidance to make yours line up with theirs.

相关问答

更多
  • 您的控制器代码必须是: - public function tambah() { $namaNegara[''] = 'select a option'; $namaNegaras = $this->registrasi_model->get_nama_negara(); foreach($namaNegaras as $namaNegaranew) { $namaNegara[$namaNegaranew->i ...
  • 创建一个片段(其他人可以玩)会有很长的路要走。 与我的网站上有预设OPTIONS的示例不同,您的选择没有任何选项。 代码示例基于EXISTING选项。 在你的情况下,你没有任何东西,所以原始的SELECT没有任何选项可以设置一旦selectize被销毁。 你需要添加Javascript来做到这一点: var value = $(this).val(); // store the current value of the select/input $(this)[0].selectize.destroy(); ...
  • 将{{$row->class_id}}更改为{{$row->class_id}} {{$row->id}} 因为您的classes表没有class_id列。 Change {{$row->class_id}} to {{$row->id}} Because your classes table does not have class_id column.
  • 试试这个(请记住,我不知道你是如何从数据库中获取值的,所以要相应调整): // However it is being passed.