問題タブ [key-value]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票する
6 に答える
383 参照

c# - キー/値形式でIPとポートを管理するためのアイデア?

ファイル内のIPアドレスとポートを管理するための優れた高速な方法を探しています。IPとポートの2つの列があり、DBを使用せずにファイル内にあるDBテーブルの一種。

追加、削除、更新をサポートする必要があります。並行性は気にしません。

0 投票する
1 に答える
1122 参照

java - コレクション内の検索/クエリ (Java)

多くの Geodata オブジェクト (名前、郵便番号、緯度、経度) を作成しました。後で別のエントリを検索するために、それらをコレクションに入れたいと思います。

すべてが objectOriented/in-memory で行われる必要があるため、リレーショナル データベースは必要ありません。

このようなクエリは次のようになります。

  • 名前またはplzで緯度と経度を検索
  • LAT1、LAT2 と LON1、LON2 の間のオブジェクトを検索

このような「単純な」データ構造に最適なコレクションはどれですか?

そのようなクエリにはどの程度の複雑さが必要ですか? マルチスレッドはメリットになるでしょうか? もしそうなら、どのコレクションがスレッドセーフのために最も良く使われていますか?

そのようなクエリを key=>value データベースに書き込む機会はありますか?

0 投票する
28 に答える
467699 参照

c# - 反復しながら汎用リストから要素を削除するにはどうすればよいですか?

それぞれが処理する必要のある要素のリストを操作し、結果に応じてリストから削除するためのより良いパターンを探しています。

(例外が発生するため).Remove(element)内で使用することはできません...また、を使用することはできません。また、コレクション内の現在の位置を混乱させるためです。foreach (var element in X)Collection was modified; enumeration operation may not execute.for (int i = 0; i < elements.Count(); i++).RemoveAt(i)i

これを行うためのエレガントな方法はありますか?

0 投票する
2 に答える
628 参照

nosql - Project Voldermortまたは同様のKeyValueストアが役立つシナリオを誰かが説明できますか?

Project Voldermortを使用して、従来のRDBMSクエリの結果をキャッシュしていることがわかります。ただし、この場合、EHcache Jcacheなどの他の(Java)キャッシングシステムに比べて大きな利点はほとんどありません。

Project Voldermortまたは同様のKeyValueストアを他にどこで使用できますか?これをビジネスアプリケーションでどのように使用していますか?

0 投票する
2 に答える
2523 参照

couchdb - Key-Valueストアを理解する

CouchDBやCassandraなどのKey-Valueストアに頭を悩ませようとしています。なぜそれらが有用なのかは理解していますが、MySqlのようなRDBMSをどのように置き換えるかについては、わかりません。

これが私が保存する必要があるものだとしましょう:

次に、青い車をすべて見つける必要があります。

Key-Valueストアは値を使用してキーをどのようにクエリしますか?そのmap-reduceが使用される可能性のある場所をいくつか読みましたが、いくつかのプロジェクトのソースを見ると、例が見つかりません。

私が正しい質問をしているのかどうか教えてください。

0 投票する
1 に答える
9428 参照

silverlight - ComboBoxItem のテキストと値を設定する

プログラムで ComboBox を作成しようとしています。ComboBoxItems を作成していて、そのテキスト (エンドユーザーに表示されるテキスト) とその値 (ユーザーが選択した後にバックグラウンドで処理するオブジェクト) を設定したいと考えています。

ただし、ComboBoxItem には、これら 2 つの要件に対するメンバーが 1 つしかないようです: Content 変数です。同時に、テキストと値のプロパティを区別し、データバインディングなしでこれを行いたいため、これは私のニーズには合いません。これを達成するための実行可能な解決策はありますか?

私の現在のコードは次のようになります。

0 投票する
8 に答える
197978 参照

c# - KeyValuePairのデフォルト

私はタイプのオブジェクトを持っていますIEnumerable<KeyValuePair<T,U>> keyValueList、私は使用しています

getResult正しい要素が見つからない場合、デフォルトであるかどうかを確認するにはどうすればよいですか?

構造体なnullので確認できません。KeyValuePair

0 投票する
10 に答える
9085 参照

python - Reliable and efficient key--value database for Linux?

I need a fast, reliable and memory-efficient key--value database for Linux. My keys are about 128 bytes, and the maximum value size can be 128K or 256K. The database subsystem shouldn't use more than about 1 MB of RAM. The total database size is 20G (!), but only a small random fraction of the data is accessed at a time. If necessary, I can move some data blobs out of the database (to regular files), so the size gets down to 2 GB maximum. The database must survive a system crash without any loss in recently unmodified data. I'll have about 100 times more reads than writes. It is a plus if it can use a block device (without a filesystem) as storage. I don't need client-server functionality, just a library. I need Python bindings (but I can implement them if they are not available).

Which solutions should I consider, and which one do you recommend?

Candidates I know of which could work:

  • Tokyo Cabinet (Python bindings are pytc, see also pytc example code, supports hashes and B+trees, transaction log files and more, the size of the bucket array is fixed at database creation time; the writer must close the file to give others a chance; lots of small writes with reopening the file for each of them are very slow; the Tyrant server can help with the lots of small writes; speed comparison between Tokyo Cabinet, Tokyo Tyrant and Berkeley DB)
  • VSDB (safe even on NFS, without locking; what about barriers?; updates are very slow, but not as slow as in cdb; last version in 2003)
  • BerkeleyDB (provides crash recovery; provides transactions; the bsddb Python module provides bindings)
  • Samba's TDB (with transactions and Python bindings, some users experienced corruption, sometimes mmap()s the whole file, the repack operation sometimes doubles the file size, produces mysterious failures if the database is larger than 2G (even on 64-bit systems), cluster implementation (CTDB) also available; file grows too large after lots of modifications; file becomes too slow after lots of hash contention; no built-in way to rebuild the file; very fast parallel updates by locking individual hash buckets)
  • aodbm (append-only so survives a system crash, with Python bindings)
  • hamsterdb (with Python bindings)
  • C-tree (mature, versatile commercial solution with high performance, has a free edition with reduced functionality)
  • the old TDB (from 2001)
  • bitcask (log-structured, written in Erlang)
  • various other DBM implementations (such as GDBM, NDBM, QDBM,, Perl's SDBM or Ruby's; probably they don't have proper crash recovery)

I won't use these:

  • MemcacheDB (client-server, uses BereleleyDB as a backend)
  • cdb (needs to regenerate the whole database upon each write)
  • http://www.wildsparx.com/apbcdb/ (ditto)
  • Redis (keeps the whole database in memory)
  • SQLite (it becomes very slow without periodic vacuuming, see autocompletion in the in the location bar in Firefox 3.0, even though versions 3.1 and later of sqlite allow auto_vacuuming; beware: small writing transactions can be very slow; beware: if a busy process is doing many transactions, other processes starve, and they can never get the lock)
  • MongoDB (too heavy-weight, treats values as objects with internal structure)
  • Firebird (SQL-based RDBMS, too heavy-weight)

FYI, a recent article about key--value databases in the Linux magazine.

FYI, an older software list

FYI, a speed comparison of MemcacheDB, Redis and Tokyo Cabinet Tyrant

Related questions on StackOverflow:

0 投票する
3 に答える
566 参照

php - 配列なしでphpキーと値のペアのインスタンスを作成する

多次元配列を構築するための再帰関数を書いています。基本的に、問題は次のとおりです。

考え?関数の構造を書き直して機能させることができることは知っていますが、それは不要なようです。

0 投票する
6 に答える
1086 参照

scalability - 安定した本番品質の nosql データストアはありますか?

実稼働システムで使用できる実稼働品質の nosql ストアはありますか。私はcassandra、tokyodb、couchdbなどを見てきましたが、どれも本番環境のような環境に展開する準備ができていないようです. 毎分数千のリクエストと、大量の読み取り/書き込み/更新について話しています。私の唯一の懸念は、速度とサービス時間です。nosqlストアを効果的に使用する本番システムを知っている人はいますか? Google/Yahoo/IBM などの大企業が支援する nosql ストアを知っている人はいますか?