IT story

NoSQL-MongoDB vs CouchDB

hot-time 2020. 6. 13. 09:43
반응형

NoSQL-MongoDB vs CouchDB


나는 NoSQL 운동과 관련하여 완전한 멍청한 놈입니다. MongoDB와 CouchDB에 대해 많이 들었습니다. 둘 사이에 차이점이 있다는 것을 알고 있습니다. NoSQL 세계로의 첫 걸음으로 어떤 것을 배우기를 권장합니까?


다음 링크를 참조하십시오

업데이트 : NoSQL 데이터베이스를 크게 비교했습니다 .

몽고 DB (3.2)

  • 작성 : C ++
  • 요점 : JSON 문서 저장소
  • 라이센스 : AGPL (드라이버 : Apache)
  • 프로토콜 : 사용자 지정, 이진 (BSON)
  • 마스터 / 슬레이브 복제 (복제 세트를 사용한 자동 장애 조치)
  • 샤딩 내장
  • 쿼리는 자바 스크립트 표현식입니다.
  • 서버 측에서 임의의 자바 스크립트 함수 실행
  • 지리 공간 인덱싱 및 쿼리
  • 성능 특성이 다른 여러 스토리지 엔진
  • 기능에 대한 성능
  • 문서 검증
  • 저널링
  • 강력한 집계 프레임 워크
  • 32 비트 시스템에서 ~ 2.5Gb로 제한
  • 텍스트 검색 통합
  • 빅 데이터 + 메타 데이터 (실제로 FS 아님)를 저장하는 GridFS
  • 데이터 센터 인식

가장 적합 : 동적 쿼리가 필요한 경우. 함수를 매핑 / 축소하지 않고 인덱스를 정의하려는 경우. 큰 DB에서 좋은 성능이 필요한 경우. CouchDB를 원했지만 데이터가 너무 많이 변경되어 디스크를 채우는 경우.

예를 들어 : MySQL 또는 PostgreSQL로 할 수있는 대부분의 작업에 대해 사전 정의 된 열을 보유하면 실제로 방해가됩니다.

소파 DB (1.2)

  • 에랭 : Erlang
  • 요점 : DB 일관성, 사용 편의성
  • 라이센스 : Apache
  • 프로토콜 : HTTP / REST
  • 양방향 (!) 복제
  • 연속 또는 임시
  • 충돌 감지
  • 따라서 마스터-마스터 복제. (!)
  • MVCC-쓰기 조작이 읽기를 차단하지 않습니다
  • 이전 버전의 문서를 사용할 수 있습니다
  • 충돌 전용 (신뢰할 수있는) 디자인
  • 때때로 압축해야 함
  • 뷰 : 임베디드 맵 / 축소
  • 뷰 형식화 : 목록 및 쇼
  • 서버 측 문서 검증 가능
  • 인증 가능
  • '_changes'를 통한 실시간 업데이트 (!)
  • 첨부 파일 처리

최선의 사용 : 미리 정의 된 쿼리를 실행할 데이터를 누적하고 가끔 변경하는 경우. 버전 관리가 중요한 곳.

: CRM, CMS 시스템. 마스터-마스터 복제는 특히 흥미로운 기능으로 다중 사이트 배포가 용이합니다.


MySQL 세계에서 온다면 MongoDB는 쿼리와 같은 언어 지원으로 인해 훨씬 ​​자연스럽게 느껴질 것입니다.

나는 그것이 많은 사람들에게 그렇게 친절하게 생각합니다.

CouchDB is fantastic if you want to utilize the really great master-master replication support with a multi-node setup, possibly in different data centers or something like that.

MongoDB's replication (replica sets) is a master-slave-slave-slave-* setup, you can only write to the master in a replica set and read from any of them.

For a standard site configuration, that is fine. It maps to MySQL usage really well.

But if you are trying to create a global service like a CDN that needs to keep all global nodes synced even though read/write to all of them, something like the replication in CouchDB is going to be a huge boon to you.

While MongoDB has a query-like language that you can use and feels very intuitive, CouchDB takes a "map-reduce" approach and this concepts of views. It feels odd at first, but as you get the hang of it, it really starts feeling intuitive.

Here is a quick overview so it makes some sense:

  • CouchDB stores all your data in a b-tree
  • You cannot "query" it dynamically with something like "SELECT * FROM user WHERE..."
  • Instead, you define discrete "views" of your data... "here is a view of all my users", "here is a view of all users older than 10" "here is a view of all users older than 30" and so on.
  • These views are defined using map-reduce approach and are defined as JavaScript functions.
  • When you define a view, the DB starts feeding all the documents of the DB you assigned the view to, through it and recording the results of your functions as the "index" on that data.
  • There are some basic queries you can do on the views like asking for a specific key (ID) or range of IDs regardless of what your map/reduce function does.
  • Read through these slides, it's the best clarification of map/reduce in Couch I've seen.

So both of these sources use JSON documents, but CouchDB follows this more "every server is a master and can sync with the world" approach which is fantastic if you need it, while MongoDB is really the MySQL of the NoSQL world.

So if that sounds more like what you need/want, go for that.

Little differences like Mongo's binary protocol vs the RESTful interface of CouchDB are all minor details.

If you want raw speed and to hell with data safety, you can make Mongo run faster than CouchDB as you can tell it to operate out of memory and not commit things to disk except for sparse intervals.

You can do the same with Couch, but it's HTTP-based communication protocol is going to be 2-4x slower than raw binary communication with Mongo in this "speed over everything!" scenario.

Keep in mind that raw crazy insane speed is useless if a server crash or disk failure corrupts and toasts your DB into oblivion, so that data point isn't as amazing as it might seem (unless you are doing real-time trading systems on Wall Street, in which case look at Redis).

Hope that all helps!


Have a look at these links:

  1. MongoDB vs CouchDB (from MongoDB side)

  2. CouchDB vs MongoDB: An attempt for a More Informed Comparison

  3. CouchDB vs. MongoDB Benchmark(perfomance comparison)


There are now many more NoSQL databases on the market than ever before. I suggest even having a look at the Gartner Magic Quadrant if you're looking for a database that will also be great for enterprise applications based on support, expandability, management, and cost.

http://www.gartner.com/technology/reprints.do?id=1-23A415Q&ct=141020&st=sb

I would like to suggest Couchbase to anyone who's not tried it yet, but not based on the version that is shown in the report (2.5.1) because it is nearly 2 revisions behind where CB Server is today, nearing release of 4.0 in 2H15.

http://www.couchbase.com/coming-in-couchbase-server-4-0

The other part about Couchbase as a vendor/product is that it is a multi-use type of DB. It can act as a pure K/V store, Document Oriented Database with multi-dimensional scaling, Memcached, cache-aside with persistence, and supports ANSI 92 compliant SQL with automatic joins, replication to DR clusters with the push of a button, and even has a mobile component built-in to the ecosystem.

If nothing else, it's worth checking out the latest benchmarks:

http://info.couchbase.com/Benchmark_MongoDB_VS_CouchbaseServer_HPW_BM.html http://info.couchbase.com/NoSQL-Technical-Comparison-Report.html


Edureka videos in youtube regarding NoSQL are some of the best video tutorials. I have started on MongoDb & Cassandra after watching these videos.

https://www.youtube.com/watch?v=gJFG04Sy6NY
https://www.youtube.com/watch?v=KSq6tMMXZ8s
https://www.youtube.com/watch?v=3z1KFA2qcSo

Good presentations are available in slideshare.net

http://www.slideshare.net/quipo/nosql-databases-why-what-and-when?qid=3bb9f7f6-a53d-41b1-8403-cd6f181d0ca7&v=qf1&b=&from_search=1

http://www.slideshare.net/EdurekaIN/no-sql-databases-35591065?qid=f1b9c095-6d70-4d0a-91da-1df664c4f389&v=qf1&b=&from_search=3 

Edureka presentation in slideshare is extension of the video in youtube. You can treat this presentation as summary of youtube video.

참고URL : https://stackoverflow.com/questions/3375494/nosql-mongodb-vs-couchdb

반응형