AWS - RDS

생활코딩

RDS (Relational Database Service)

관계형 데이터베이스를 서비스로서 제공하는 제품
AWS 의 데이터베이스 전용서비스 MySQL, MariaDB, PostgreSQL, SQL Server, ORACLE 등을 직접 운영하지 않고 AWS에 대행

S3 vs. RDS

Difference between S3 and RDS
While S3 is strongly consistent, its consistency is limited to single storage operations.
On the other hand, RDS supports transactions that allow one to execute a series of operations while maintaining consistency and even providing an option to roll back the operations in case of the steps go wrong.

Amazon Simple Storage Service provides a fully redundant data storage infrastructure for storing and retrieving any amount of data, at any time, from anywhere on the web.
Amazon RDS belongs to “SQL Database as a Service” category of the tech stack, while Amazon S3 can be primarily classified under “Cloud Storage”.

S3

  • 파일서버를 서비스화
  • 파일 서버를 인스턴스별로 만들어서 관리하는게아니라 AWS S3 서비스 활용
  • 페이스북이나 구글에 사진,글을 올릴 때 파일 upload / 삭제..등의 기능
  • Amazon S3 provides the following key features:

    • Write, read, and delete objects containing from 1 byte to 5 terabytes of data each. The number of objects you can store is unlimited.
    • Each object is stored in a bucket and retrieved via a unique, developer-assigned key.
    • A bucket can be stored in one of several Regions. You can choose a Region to optimize for latency, minimize costs, or address regulatory requirements. Amazon S3 is currently available in the US Standard, US West (Oregon), US West (Northern California), EU (Ireland), Asia Pacific (Singapore), Asia Pacific (Tokyo), Asia Pacific (Sydney), South America (Sao Paulo), and GovCloud (US) Regions. The US Standard Region automatically routes requests to facilities in Northern Virginia or the Pacific Northwest using network maps.

      RDS

  • RDB의 서비스화
  • 직접 DB를 인스턴스별로 관리하는 것이 아닌 AWS RDS 서비스활용
  • Some of the features offered by Amazon RDS are:

    • Pre-configured Parameters
    • Monitoring and Metrics
    • Automatic Software Patching

RDS 소개

  • 관계형 데이터베이스
  • 우리가 EC2를 실행할 때 우리 컴퓨터에 MySQL, Oracle등을 설치할 듯
  • 근데 DB규모가 커졌을 때 DB를 관리하는것이 매우 어려워짐

  • 따라서 AWS RDS 서비스가 활용

  • RDB : 관계형 데이터 베이스
    • MySQL : Web의 등장과함께 성장한 오픈소스, 오라클에서 유지보수하는 DB
    • MariaDB : MySQL 창업자가 만든 DB, MySQL과 호환되는 서비스
    • Aurora : AWS 에서 개발한 MySQL과 호환되는 서비스
    • ORACLE : 가격이 비쌈, 관공서에서 사용하는 DB 시스템

RDS 서버 생성

  • AWS -> Services -> Database -> RDS
  • RDS Dashboard -> Instances -> Launch DB Instance (지역 설정 Asia Pacific(Seoul))

RDS 백업 & 복원

  • Multi-AZ Development (Availability Zone)
    • 여러개의 가용지역에서 DB 사용할 목적일때
    • 한대의 DB를 backup용으로 다른 AZ쪽에 저장
    • 성능향상과는 무관한 기능
  • Snapshots : Create Snapshot > Restore DB Instance
    • DB의 shapshot을 만들고 저장해두고 DB에서 문제가 생길 때 Snapshots 기준으로 DB복원
    • Restore 시에 기존의 인스턴스를 교체하는 것이아니라 기존의 인스턴스를 그대로 두고 새로운 인스턴스를 만들어 내는 것

RDS Scale up & out

  • Scalability : DB처리량이 한계에 도달했을 때
    • Scale-UP : DB의 인스턴스 타입 조정 / DB configuration 조절 / 해당 인스턴스의 DB 성능 조정
      • 한대의 instance의 DB의 성능을 Modify
    • Scale-OUT : 여러개의 instance를 추가
      • master instance / slave instance
      • master : Write
      • slave : Read
        • RDS Dashboard > Instances > Instance Action > Create Read Replica
        • Read Replica Source : 어떤 DB 가 Master 가 될 것인지 설정
    • cf ) Sharding : 데이터를 쪼개서 처리

Categories:

Updated: