본문 바로가기
BACKEND/PostgreSQL

PostgreSQL 개요

by 드로니뚜벅이 2022. 7. 13.

PostgreSQL 이란?

PostgreSQL은 오픈 소스 객체-관계형 데이터베이스 시스템(ORDBMS)입니다. 오픈소스 DBMS로 더 널리 알려져 있습니다.

약 20여년의 오랜 역사를 갖는 PostgreSQL은 다른 관계형 데이터베이스 시스템과 달리 연산자, 복합 자료형, 집계 함수, 자료형 변환자, 확장 기능 등 다양한 데이터베이스 객체를 사용자가 임의로 만들 수 있는 기능을 제공함으로써 마치 새로운 하나의 프로그래밍 언어처럼 무한한 기능을 손쉽게 구현할 수 있습니다.

  • - PostgreSQL은 북미와 일본에서 높은 인지도와 많은 인기를 얻고 있는 RDBMS
  • - Enterprise 급 DBMS의 기능과 차세데 DBMS에서 볼 수 있을 법한 많은 기능 제공
  • - 확장 가능성 및 표준 준수를 강조하는 객체 관계형 데이터베이스 관리 시스템
  • - BSD 허가권으로 배포되며 오픈소스 개발자 및 관련 회사들이 개발에 참여
  • - 소규모 단일 머신으로부터 수많은 동시 접속 사용자가 있는 대형의 인터넷 어플리케이션에 이르기까지 여러 부하를 관리가 가능

 

PosgtreSQL Architecture

PostgreSQL은 클라이언트/서버 모델을 사용한다. 서버는 데이터베이스 파일들을 관리하며, 클라이언트 애플리케이션으로부터 들어오는 연결을 수용하고, 클라이언트를 대신하여 데이터베이스 액션을 수행합니다. 서버는 다중 클라이언트 연결을 처리할 수 있는데, 서버는 클라이언트의 연결 요청이 오면 각 커넥션에 대해 새로운 프로세스를 fork합니다. 그리고 클라이언트는 기존 서버와의 간섭 없이 새로 생성된 서버 프로세스와 통신하게 됩니다.

 

PostgreSQL 역사

- PostgreSQL의 조상에는 여러 제품이 있는데, 그 중 Ingres(Interactive Graphics REtrieval System)는 PostgreSQL 시조

- Ingres는 데이터베이스계의 거장 Michael Stonebraker가 시작한 프로젝트

- 제품 변천사

 

PostgreSQL 기능

■ Data Types

- Primitives: Integer, Numeric, String, Boolean

- Structured: Date/Time, Array, Range, UUID

- Document: JSON/JSONB, XML, Key-value (Hstore)

- Geometry: Point, Line, Circle, Polygon

- Customizations: Composite, Custom Types

 

■ Data Integrity

- UNIQUE, NOT NULL

- Primary Keys

- Foreign Keys

- Exclusion Constraints

- Explicit Locks, Advisory Locks

 

■ Concurrency, Performance

- Indexing: B-tree, Multicolumn, Expressions, Partial

- Advanced Indexing: GiST, SP-Gist, KNN Gist, GIN, BRIN, Bloom filters

- Sophisticated query planner / optimizer, index-only scans, multicolumn statistics

- Transactions, Nested Transactions (via savepoints)

- Multi-Version concurrency Control (MVCC)

- Parallelization of read queries

- Table partitioning

- All transaction isolation levels defined in the SQL standard, including Serializable

 

■ Reliability, Disaster Recovery

- Write-ahead Logging (WAL)

- Replication: Asynchronous, Synchronous, Logical

- Point-in-time-recovery (PITR), active standbys

- Tablespaces

 

■ Security

- Authentication: GSSAPI, SSPI, LDAP, SCRAM-SHA-256, Certificate, and more

- Robust access-control system

- Column and row-level security

 

■ Extensibility

- Stored procedures

- Procedural Languages: PL/PGSQL, Perl, Python (and many more)

- Foreign data wrappers: connect to other databases or streams with a standard SQL interface

- Many extensions that provide additional functionality, including PostGIS

 

■ Internationalisation, Text Search

- Support for international character sets, e.g. through ICU collations

- Full-text search

 

PostgreSQL 제한사항

항목 제한사항
최대 DB 크기 (Database Size) 무제한
최대 테이블 크기 (Table Size) 32TB
최대 레코드 크기 (Row Size) 1.6TB
최대 컬럼 크기 (Field Size) 1GB
테이블당 최대 레코드 개수 (Rows per Table) 무제한
테이블당 최대 컬럼 개수 (Columns per Table) 250 ~ 1600개
테이블당 최대 인덱스 개수 (Indexing per Table) 무제한

 

PostgreSQL 내부구조

□ 프로세스 구조

 

□ 서브 내부의 질의 수행 과정

 

PostgreSQL 장점 및 비교

RDMS 엔진 순위

RDBMS 엔진 순위 트랜드

 

■ 시스템 속성

Name PostgreSQL
Description Widely used open source RDBMS
Primary database model Relational DBMS
Secondary database models Document store, Spatial DBMS
Website www.postgresql.org 
Technical documentation www.postgresql.org/docs 
Developer PostgreSQL Global Development Group
Initial release 1989
Current release 14.2, February 2022
License Open Source
Cloud-base only no
DBaaS offerings ScaleGrid for PostgreSQL
Implementation Language C
Server operating systems FreeBSD, HP-UX, Linux, NetBSD, OpenBSD,
OS X, Solaris, Unix, Windows
Data Scheme yes
Typing yes
XML support yes
Secondary Indexes yes
SQL yes
APIs and other access methods ADO.NET, JDBC,
native  C library, ODBC, streaming API for large objects
Supported programming languages .Net, C, C++, Delphi, Java, JavaScript(Node.js),
Perl, PHP, Python, Tcl
Server-side scripts user defined functions
Triggers yes
Partitioning methods partitioning by range, list and (since PostgreSQL 11) by hash
Replication methods Source-replica replication
MapReduce no
Consistency concepts Immediate Consistency
Foreign keys yes
Transaction concepts ACID
Concurrency yes
Durability yes
In-memory capabilities no
User concepts fine grained access rights according to SQL-standard

http://db-engines.com/en/system/PostgreSQL

 

 

GIS add-on 지원 (PostGIS)

PostgreSQL에 OpenGIS 규격(http://www.opengeospatial.org/standards/sfs)을 준수하며 Geographic object를 지원 가능하게 하는 미들웨어 형태의 확장 가능

 

'BACKEND > PostgreSQL' 카테고리의 다른 글

Ubuntu PostgreSQL 백업(backup) 및 복구(restore)  (0) 2023.03.12
Linux(Ubuntu) pgAdmin4 설치  (0) 2023.03.11
pgRouting 설치  (0) 2023.01.31
PostGIS 설치  (0) 2023.01.31
PostgreSQL 설치  (0) 2022.07.14