Development Tip

어떤 키 / 값 저장소가 가장 유망하고 안정적인가요?

yourdevel 2020. 12. 4. 21:00
반응형

어떤 키 / 값 저장소가 가장 유망하고 안정적인가요?


일부 부수 프로젝트 (주로 학습 경험)에 키 / 값 저장소를 사용하기 시작하려고합니다.하지만 최근 과거에 너무나 많이 나타나서 어디서부터 시작해야할지 모르겠습니다. 기억에서 나열하면 다음과 같이 생각할 수 있습니다.

  1. CouchDB
  2. MongoDB
  3. Riak
  4. Redis
  5. 도쿄 내각
  6. 버클리 DB
  7. 카산드라
  8. MemcacheDB

그리고 내 수색 노력을 통해 빠져 나간 것들이 더 많이있을 거라고 확신합니다. 모든 정보를 가지고 있기 때문에 모든 경쟁 업체 간의 확실한 비교를 찾기가 어렵습니다. 내 기준과 질문은 다음과 같습니다.

  1. (가장 중요) 어떤 것을 추천하고 그 이유는 무엇입니까?
  2. 어느 것이 가장 빠릅니까?
  3. 어느 것이 가장 안정적인가요?
  4. 설정 및 설치가 가장 쉬운 것은 무엇입니까?
  5. Python 및 / 또는 Ruby에 대한 바인딩이있는 것은 무엇입니까?

편집 :
지금까지 Redis가 최상의 솔루션 인 것처럼 보이지만 ardsrk에서 하나의 확실한 응답을 얻었 기 때문입니다. 유용하고 정량적 인 정보의 방향을 알려주기 때문에 그의 답변과 같은 더 많은 답변을 찾고 있습니다. 어떤 키-값 저장소 사용하며 그 이유는 무엇입니까?

편집 2 :
CouchDB, Riak 또는 MongoDB에 대한 경험이있는 사람이 있다면 그들에 대한 귀하의 경험을 듣고 싶습니다 (여러 가지에 대한 비교 분석을 제공 할 수 있다면 더욱 그렇습니다).


어떤 것을 추천하고 그 이유는 무엇입니까?

Redis를 추천합니다. 왜? 계속 읽기 !!

어느 것이 가장 빠릅니까?

나는 그것이 가장 빠른지 말할 수 없다. 그러나 Redis는 빠릅니다 . 모든 데이터를 RAM에 저장하기 때문에 빠릅니다. 최근에 가상 메모리 기능이 추가되었지만 거의 사용되지 않는 값만 디스크로 스왑되고 모든 키가 주 메모리에 남아 있습니다.

어느 것이 가장 안정적인가요?

다시 말하지만, 다른 키-값 저장소에 대한 직접적인 경험이 없기 때문에 비교할 수 없습니다. 그러나 Redis는 GitHubInstagram같은 많은 웹 애플리케이션에서 프로덕션에 사용되고 있습니다.

설정 및 설치가 가장 쉬운 것은 무엇입니까?

Redis는 설정하기가 매우 쉽습니다. 소스를 잡고 Linux 상자에서 실행하십시오 make install. 그러면 redis-server경로에 넣고 시작할 수있는 바이너리가 생성 됩니다.

redis-server기본적으로 포트 6379에 바인딩됩니다. redis.conf더 많은 구성 및 설정 옵션에 대한 소스와 함께 제공 되는 것을 살펴보십시오 .

Python 및 / 또는 Ruby에 대한 바인딩이있는 것은 무엇입니까?

Redis는 뛰어난 RubyPython 지원을 제공합니다.

아래 Xorlev의 의견에 대한 응답으로 Memcached는 단순한 키-값 저장소입니다. Redis는 목록, 집합 및 정렬 된 집합과 같은 복잡한 데이터 유형을 지원 하는 동시에 이러한 데이터 유형에 대한 간단한 인터페이스제공합니다 .

make 32bit64 비트 컴퓨터에서도 모든 포인터를 32 비트 크기로만 만드는 것도 있습니다. 이렇게하면 RAM이 4GB 미만인 시스템에서 상당한 메모리를 절약 할 수 있습니다.


현대 NoSQL 현상이 무엇인지 이해해야합니다.
키-값 저장소에 관한 것이 아닙니다. 수십 년 동안 사용 가능했습니다 (예 : BerkeleyDB). 왜 지금 소란 스럽습니까?

멋진 문서 나 객체 지향 스키마에 대한 것이 아니며 "임피던스 불일치"를 극복하는 것이 아닙니다. 이러한 기능의 지지자들은 수년 동안 이러한 기능을 선전 해 왔지만 어디에도 없었습니다.

이는 단순히 자동 (관리자 용) 및 투명 (애플리케이션 개발자 용) 장애 조치, 샤딩 및 복제의 3 가지 기술적 문제를 해결하는 것입니다. 따라서이 전면에서 제공하지 않는 트렌디 한 제품은 무시해야합니다. 여기에는 Redis, MongoDB, CouchDB 등이 포함됩니다. 그리고 cassandra, riak 등과 같은 진정한 분산 솔루션에 집중합니다.

그렇지 않으면 SQL이 제공하는 모든 좋은 기능 (임시 쿼리, 상사를위한 Crystal Reports, 타사 도구 및 라이브러리)을 잃어 버리고 대가를받을 수 없습니다.


올해 PyCon에서 Reddit의 Jeremy Edberg는 다음과 같이 연설했습니다.

http://pycon.blip.tv/file/3257303/

그는 Reddit이 PostGres를 키-값 저장소로, 아마도 간단한 2 열 테이블과 함께 사용한다고 말했습니다. 그의 강연에 따르면 그들이 시도한 다른 키-값 저장소보다 더 빨리 벤치마킹했습니다. 그리고 물론 매우 성숙합니다.

궁극적으로 OverClocked가 옳습니다. 사용 사례에 따라 최상의 매장이 결정됩니다. 그러나 RDMBS는 오랫동안 (ab) 키-값 저장소로 사용되어 왔으며 매우 빠를 수도 있습니다.


저는 MongoDB를 가지고 놀았는데 제 애플리케이션에 딱 맞는 한 가지가 있습니다. 바로 데이터베이스에 복잡한지도 / 목록을 저장할 수 있다는 것입니다. 각 값이 목록 인 큰 맵이 있으며 모든 다른 키와 목록 값을 알지 못한 채 작성하고 검색하기 위해 특별한 작업을 수행 할 필요가 없습니다. 다른 옵션에 대해서는 잘 모르지만 속도와 그 능력으로 인해 Mongo가 내 응용 프로그램에 완벽합니다. 또한 Java 드라이버는 사용이 매우 간단합니다.


그들은 모두 다른 기능을 가지고 있습니다. 그리고 각 릴리스 전에 LinkedIn이 프로덕션에서 실제로 사용 / 테스트 한 Project Voldemort잊지 마십시오 .

비교하기 어렵습니다. 필요한 것이 무엇인지 스스로에게 물어봐야합니다. 예를 들어 파티션을 원하십니까? 그렇다면 CouchDB와 같은 일부는 지원하지 않습니다. 이 레이저 코딩을 원하십니까? 그렇다면 그들 대부분은 그것을 가지고 있지 않습니다. 기타.

Berkeley DB는 매우 기본적인 저수준 스토리지 엔진으로,이 논의에서 제외 될 수 있습니다. 복제, 버전 관리, 코딩 등과 같은 추가 기능을 제공하기 위해 여러 키-값 시스템이 그 위에 구축됩니다.

또한 응용 프로그램에 필요한 것은 무엇입니까? 일부 솔루션에는 필요하지 않은 복잡성이 포함되어 있습니다. 예를 들어 변경되지 않는 정적 데이터 만 저장하는 경우 데이터의 SHA-1 콘텐츠 해시 아래에 저장할 수 있습니다 (예 : 콘텐츠 해시를 키로 사용). 이 경우 최신 성, 동기화, 버전 관리에 대해 걱정할 필요가 없으며 많은 복잡성을 제거 할 수 있습니다.


One distinction you have to make is what will you use the DB for? Don't jump on board just because it's trendy. Do you need a key value store? or do you need a document based store? What is your memory footprint requirement? running it on a small VM or a separate one?

I recommend listing your requirements first and then seeing which ones overlap with your requirements.

With that said, I have used CouchDB/MongoDB and prefer to use MongoDB for its ease of setup and best transition from mysql style queries. I chose mongodb over sql because of dynamic schemas(no migration files!) and better data modeling(arrays, hashes). I did not evaluate based on scalability.

MongoMapper is a great MongoDB orm mapper for Ruby and there's already a working Rails 3 fork.

I listed some more details about why I prefered mongodb in my scribd slides http://tommy.chheng.com/index.php/2010/02/mongodb-for-natural-development/


I notice how everyone is confusing memcached with memcachedb. They are two different systems. The op asked about memcachedb.

memcached is memory storage. memcachedb uses Berkeley DB as its datastore.


I only have experience with Berkeley DB, so I'll mention what I like about it.

  • It is fast
  • It is very mature and stable
  • It has outstanding documentation
  • It has C,C++,Java & C# bindings out of the box. Other language bindings are available. I believe Python comes with bindings as part of its "batteries".

The only downside I've run into is that the C# bindings are new and don't seem to support every feature.


There is also zodb.


Which key value store is the most promising/stable?

G-WAN KV store looks rather promising:

DB engine            Traversal
-----------          ----------------------------
SQLite               0.261 ms  (b-tree)
Tokyo-Cabinet (TC)   4.188 ms  (hash table)
TC-FIXED             0.103 ms  (fixed-size array)
G-WAN KV             0.010 ms  (unamed)

Also, it is used internally by G-WAN webserver, known for its high concurrency performances (that's for the stability question).


I really like memcached personally.

I use it on a couple of my sites and it's simple, fast, and easy. It really was just incredibly simple to use, the API is easy to use. It doesn't store anything on disk, thus the name memcached, so it's out if you're looking for a persistent storage engine.

Python has python-memcached.

I haven't used the Ruby client, but a quick Google search reveals RMemCache

If you just need a caching engine, memcached is the way to go. It's developed, it's stable, and it's bleedin' fast. There's a reason LiveJournal made it and Facebook develops it. It's in use at some of the largest sites out there to great effect. It scales extremely well.


Cassandra seems to be popular.

Cassandra is in use at Digg, Facebook, Twitter, Reddit, Rackspace, Cloudkick, Cisco, SimpleGeo, Ooyala, OpenX, and more companies that have large, active data sets. The largest production cluster has over 100 TB of data in over 150 machines.


Just to make the list complete: there's Dreamcache, too. It's compatible with Memcached (in terms of protocol, so you can use any client library written for Memcached), it's just faster.


As the others said, it depends always on your needs. I for example prefer whatever suits my applications best.

I first used memcached to have fast read/write access. As Java API I´ve used SpyMemcached, what comes with an very easy interface you can use for writing and reading data. Due to memory leaks (no more RAM) I was required to look for another solution, also I was not able scale right, just increase the memory for a single process seemed to be not an good achievement.

After some reviewing I saw couchbase, it comes with replication, clustering, auto-failover, and a community edition (MS Windows, MacOs, Linux). And the best thing for me was, the Java client of it implements also SpyMemcached, so I had almost nothing else to do as setup the server and use couchbase instead of memcached as datastore. Advantage? Sure, my data is now persistent, replicated, and indexed. It comes with a webconsole to write map reduce functions for document views in erlang.

It has Support for Python, Ruby, .Net and more, easy configuration through the webconsole and client-tools. It runs stable. With some tests I was able to write about 10k per second for 200 - 400 byte long records. Reading Performance was way higher though (both tested locally). Have a lot of fun making your decision.


Only have experience with mongoDB, memchache and redis. Here's a comparison between them and couchDB.

Seems mongoDB is most popular. It support sharding and replication, eventually consistent, has good support in ruby (mongoid). It also have a richer feature set than the other two. All of mongo, redis and memchache can store the key-value in memory, but redis seems to be much faster, according to this post, redis is 2x write, 3x read faster than mongo. It has better designed data structures and more 'light-weight'.

I would say they have different usages, mongoDB is probably good for large dataset and document storage while memchache and redis are better to store caches or logs.

참고URL : https://stackoverflow.com/questions/2376846/which-key-value-store-is-the-most-promising-stable

반응형