본문 바로가기

Back-end/MongoDB

Big Data Storage

반응형

이 글은 전공 "빅데이터시스템" 강의 내용을 정리한 글입니다.

Centralized Storage

  • Data is stored on the database of one single machine
  • Relational databases
    • Allows related data to be stored across multiple tables, and linked by establishing a relationship between the tables ⇒ 다수의 테이블에 연관된 data를 저장하고, 테이블들간의 관계를 설정하여 연결할 수 있다.
    • Inflexible - 주로 structured data에 적합하고 다른 타입에 대해 유연성이 없다.
    • Velocity - 빠르게 증가하는 데이터보단 정적인 데이터를 위해 설계되어있다.
    • No scalability - 큰 크기로 확장하기 쉽지 않다.
    • Weak SQL - SQL 기본 쿼리로는 특정 쿼리를 구현하기 어렵다.

Decentralized storage

  • Database run on multiple machines at the same time
  • NoSQL databases

What is NoSQL?

  • Some claim for it to mean “No SQL” ⇒ 일부에서는 “No SQL”을 의미한다고 한다.
    • SQL을 사용하지 않고 다른 대체 쿼리 언어를 사용한다.
  • The definition is sometimes expanded to mean “Not only SQL” ⇒ 때때로 “Not Only SQL”으로 확장되기도 한다.
    • 시스템에서 SQL을 다른 기술/쿼리 언어와 함께 사용한다는 것을 의미한다.
  • Many argue that the one thing all NoSQL databases have in common is that they’re non-relational ⇒ 대다수는 모든 NoSQL 데이터베이스의 한 가지 공통점은 비관계적이라는 것이라고 한다.
    • “NoREL” is a more suitable name

Why NoSQL

  • Features of NoSQL
    • Flexible - 스키마가 없거나 여유 스키마를 가진다(데이터 스키마의 정의를 요구하지 않는다.)
    • Scalability - Scale-Up(vertical scaling)을 사용하는 RDBMS와 달리, Scale-Out(horizotal scaling)을 사용한다.
    • Fault tolerance - single machin보다 several machine이 더 fault tolerance가 높다.
    • Open Source - 대부분 NoSQL database는 oepn source이다.

NoSQL Databases

Representative NoSQL Databases

  • Key-Value Store
  • Column
  • Document
  • Graph

Key-Value Store Database

  • 데이터를 저장하기 위해서 간단한 key-value 방식을 사용한다.
  • 데이터 저장 방법이 간단하다(Simple method of storing data)
  • 확장이 잘된다.(Scale Well)
  • key-value pair는 많은 프로그래밍 언어에서 절 정립된 개념이다
    • ex) Dictionary, hash, associative array, etc

Example of Key-Value Stores

  • Stock Trading

What can a key-value store database be used for?

  • 웹사이트에서 User profiles and session info
  • 기사/블로그 댓글
  • 전화번호부
  • IP forwarding tables
  • etc...

Key-Value DBMS

  • Redis
  • Oracle NoSQL Database
  • Project Voldemort
  • Aerospike
  • Oracle Berkeley DB

Document Store Database

  • 데이터를 저장할 때 document-oriented model을 사용한다.
  • key-value store database와 유사하지만, Document store database는 semi-structure data로 구성된 값을 사용한다.
  • 하나의 document안에 연관된 데이터를 저장한다.
  • 각각의 document는 다양한 쿼리를 사용할 수 있는 semi-structured 데이터가 포함되어 있다.
    • Usually XML or JSON

What can a Document Database be used for?

  • Web application
  • 유저가 만드는 Content(Chat sessions, tweets, blog posts)
  • Networking/computing(Sensor data, log files)
  • Catalog Data

Examples of Document Store DBMS

  • MongoDB
  • DocumentDB
  • CouchDB
  • MarkLogic
  • OriendDB

Column Store Database

  • column oriented model을 사용하여 데이터를 저장한다.
  • column family는 여러개의 row들로 구성된다.
  • 각 row는 다른 row와 다른 수의 colums으로 구성될 수 있다.
    • 다른 column 이름, 데이터 유형 등을 가질 수 있다.

 

 

  • Row Key : 각 row는 식별하 수 있는 unique key를 가진다.
  • Column: 각 column은 이름, 값, timestamp를 가진다.

Examples of column store databases include

  • Bigtable
  • Cassandra
  • HBase
  • Vertica
  • Druid

Graph Database

  • 데이터를 표현하고 저장하기 위해 graphical model을 사용한다.
  • relational model의 대안이다.
    • relational database에서, 데이터는 미리 정의된 스키마가 있는 견고한 구조를 사용하여 테이블에 저장된다.
    • graph database에서는, 미리 정의된 스키마가 없다.(단순하게 입련된 데이터의 reflection이다.)
  • 연결된 데이터로 작업하는데 매우 적합하다.

  • circle은 node이고, 데이터를 포함한다.
  • 화살표는 node 사이 관계를 표현한다.

Example of Graph Databases

  • Neo4j
  • Blazegraph
  • GraphBase
반응형