Article Source

  • Title: NoSQL Distilled; A Brief Guide to the Emerging World of Polyglot Persistence, 2013.
  • Authors: Pramod J. Sadalage, Martin Fowler

Key-Value Model and Document Data Model

키-값 데이터베이스와 문서 데이터베이스는 강력하게 집합 지향적이다. 이런 데이터베이스는 주로 집합을 통해 구축됨을 뜻한다. 이 두 형태의 데이터베이스는 모두 많은 집합으로 구성되어 있고 각 집합은 데이터를 얻는 데 사용하는 키나 아이디를 가지고 있다.

두 모델은 차이가 있다. 키-값 데이터베이스에서는 집합 구조가 불투명하다. 즉 대부분 의미 없는 바이너리 데이터처럼 취급된다. 이와 반대로 문서 데이터베이스는 집합의 구조를 볼 수 있다. 불투명성의 장점은 집합 안에 무엇이든 저장할 수 있다는 점이다. 데이터베이스에 일반적인 크기 제한 같은 것은 있을 수 있지만, 그 외에는 완전 자유다. 문서 데이터베이스는 집합에 허용되는 구조와 타입을 정의해 그 안에 들어갈 수 있는 것을 제한한다. 그러나 데이터에 접근할 때 융통성이 더 많다.

키-값 저장소에서는 키를 통해서만 집합에 접근할 수 있다. 문서 데이터베이스에서는 집합의 필드를 이용해 데이터베이스에 질의를 보낼 수 있고, 집합의 전체 대신 일부를 조회할 수 있으며, 집합의 내용을 이용해 인덱스를 만들 수도 있다.

실제로는 키-값 저장소와 문서 데이터베이스 간 구분이 조금 모호해졌다. 사람들은 키-값 형식으로 검색하려고 문서 데이터베이스에 ID 필드를 넣기도 한다. 키-값 데이터베이스로 분류된 데이터베이스는 불투명한 집합 이상의 데이터 구조 정의를 허용한다. 예를 들어 리악은 인덱스 생성이나 집합 간 연결을 위한 메타데이터 추가를 허용하고, 레디스(Redis)는 집합을 리스트나 집합(set)으로 분해하는 것을 허용한다. 솔라(Solr) 같은 검색 도구를 통합해 쿼리를 지원할 수도 있다. 예로 리악에는 JSON이나 XML 구조로 저장된 집합에 솔라와 비슷한 방식으로 검색을 실행할 수 있는 기능이 포함되어 있다.

모호한 면이 있기는 하지만 일반적인 구분은 여전히 유효하다. 키-값 데이터베이스에서는 키를 통해 집합을 찾는다. 문서 데이터베이스에서는 문서 내부 구조를 기초로 어떤 형태의 쿼리를 실행한다. 키를 사용할 수도 있지만 대부분의 경우는 다른 것을 사용한다.


We said earlier on that key-value and document databases were strongly aggregate-oriented. What we meant by this was that we think of these databases as primarily constructed through aggregates. Both of these types of databases consist of lots of aggregates with each aggregate having a key or ID that’s used to get at the data.

경축! 아무것도 안하여 에스천사게임즈가 새로운 모습으로 재오픈 하였습니다.
어린이용이며, 설치가 필요없는 브라우저 게임입니다.
https://s1004games.com

The two models differ in that in a key-value database, the aggregate is opaque to the database—just some big blob of mostly meaningless bits. In contrast, a document database is able to see a structure in the aggregate. The advantage of opacity is that we can store whatever we like in the aggregate. The database may impose some general size limit, but other than that we have complete freedom. A document database imposes limits on what we can place in it, defining allowable structures and types. In return, however, we get more flexibility in access.

With a key-value store, we can only access an aggregate by lookup based on its key. With a document database, we can submit queries to the database based on the fields in the aggregate, we can retrieve part of the aggregate rather than the whole thing, and database can create indexes based on the contents of the aggregate.

In practice, the line between key-value and document gets a bit blurry. People often put an ID field in a document database to do a key-value style lookup. Databases classified as key-value databases may allow you structures for data be “yond just an opaque aggregate. For example, Riak allows you to add metadata to aggregates for indexing and interaggregate links, Redis allows you to break down the aggregate into lists or sets. You can support querying by integrating search tools such as Solr. As an example, Riak includes a search facility that uses Solr-like searching on any aggregates that are stored as JSON or XML structures.

Despite this blurriness, the general distinction still holds. With key-value databases, we expect to mostly look up aggregates using a key. With document databases, we mostly expect to submit some form of query based on the internal structure of the document; this might be a key, but it’s more likely to be something else.

 

[출처] http://sungsoo.github.io/2014/05/18/key-value-and-document-data-model.html

 

 

본 웹사이트는 광고를 포함하고 있습니다.
광고 클릭에서 발생하는 수익금은 모두 웹사이트 서버의 유지 및 관리, 그리고 기술 콘텐츠 향상을 위해 쓰여집니다.
번호 제목 글쓴이 날짜 조회 수
공지 오라클 기본 샘플 데이터베이스 졸리운_곰 2014.01.02 86232
공지 [SQL컨셉] 서적 "SQL컨셉"의 샘플 데이타 베이스 SAMPLE DATABASE of ORACLE 가을의 곰을... 2013.02.10 78701
공지 [G_SQL] Sample Database 가을의 곰을... 2012.05.20 95445
22 Docker에서 SQL Server 컨테이너 이미지 구성 file 졸리운_곰 2020.01.23 1552
21 MSSQL 설치형 한글 환경으로 변경 file 졸리운_곰 2020.01.23 2885
20 PRIMARY KEY 와 FOREIGN KEY 를 전부 뽑아주는 쿼리 졸리운_곰 2018.12.16 1773
19 [MSSQL] CASE 문 . 조건에 따라 값 정하기 ! CASE WHEN THEN 졸리운_곰 2018.07.24 1567
18 Track Data Changes (SQL Server) file 졸리운_곰 2018.07.02 1302
17 Docker가 있는 SQL Server 2017 컨테이너 이미지를 실행 하는 빠른 시작 file 졸리운_곰 2018.06.26 1054
16 [MSSQL] Management Studio 이용해 데이터베이스 생성하기 file 졸리운_곰 2018.06.17 1281
15 [MSSQL - GROUP BY HAVING 을 이용한 중복 데이타 체크] file 졸리운_곰 2018.06.15 1278
14 [SQL] select 한 결과로 update 처리, SQL한문장, How to UPDATE from SELECT in SQL Server 졸리운_곰 2018.01.22 1470
13 UNION으로 결과 집합 조합 졸리운_곰 2017.08.27 1340
12 uniqueidentifier(Transact-SQL) file 가을의곰 2017.06.10 1754
11 하위 쿼리를 사용하여 다른 쿼리 또는 식에 쿼리 중첩 [MS-ACCESS : ms offce suit] 가을의곰 2017.06.10 1638
10 [MS-SQL] 테이블명, 컬럼명 검색 졸리운_곰 2017.04.17 1932
9 DB의 모든 테이블에서 데이터 검색 졸리운_곰 2017.04.17 1716
8 Microsoft SQL Server DBA 가이드-DBA라면 이정도는 알아야한다!!! file 졸리운_곰 2017.01.15 1302
7 SQL Server DBA 가이드 file 졸리운_곰 2017.01.15 1685
6 IDENTITY_INSERT가 OFF로 설정되면 ‘테이블명’ 테이블의 ID 열에 명시적 값을 삽입할 수 없습니다 file 졸리운_곰 2017.01.15 1503
5 MS SQL 서버에서 자동증가, autoincrement 처리 file 졸리운_곰 2017.01.15 1773
4 MS SQL 서버의 날짜, 시간 => 문자열 변환 포멧 설명 졸리운_곰 2017.01.15 1215
3 MS SQL 서버 코딩 표준 가이드 file 졸리운_곰 2017.01.14 1654
대표 김성준 주소 : 경기 용인 분당수지 U타워 등록번호 : 142-07-27414
통신판매업 신고 : 제2012-용인수지-0185호 출판업 신고 : 수지구청 제 123호 개인정보보호최고책임자 : 김성준 sjkim70@stechstar.com
대표전화 : 010-4589-2193 [fax] 02-6280-1294 COPYRIGHT(C) stechstar.com ALL RIGHTS RESERVED