비관계형 DB(NoSQL)

6337 단어
비관계형 DB란?

이전 기사에서 관계형 모델에 대해 배웠습니다. NoSQL이라고도 하는 비관계형 데이터베이스는 이 모델을 따르지 않고 대신 키-값 구조를 따르는 데이터베이스입니다.

비관계형 DB를 언제 선택해야 하는지 어떻게 알 수 있습니까?

일상적인 작업의 일부가 모든 크기의 복잡하고 구조화되지 않은 데이터를 매우 유연하게 조작하고 분석해야 하는 경우 NoSQL이 최선의 선택입니다.

일부 업계 비관계형 DB 사용 사례는 무엇입니까?

  • 웹사이트, 전자상거래 시스템 및 앱(고객 상호 작용에 대해 생각)
  • 신용카드(이력)
  • 실시간 입찰
  • 쇼핑 카트
  • 소셜
  • 제품 카탈로그
  • 고객 선호도
  • 트래픽이 많은




  • 이제 비관계형 데이터베이스에 대한 일반적인 아이디어를 얻었으므로 계속해서 더 깊이 파고들어 AWS 비관계형 리소스를 탐색하고 구축해 보겠습니다.
  • Amazon DynamoDB

  • Amazon Amazon DynamoDB란 무엇입니까?

    Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. DynamoDB lets you offload the administrative burdens of operating and scaling a distributed database so that you don't have to worry about hardware provisioning, setup and configuration, replication, software patching, or cluster scaling.



    Amazon DynamoDB에 대한 몇 가지 중요한 특징을 살펴보겠습니다.

    
    Performance: 
    
    - More than 10 trillion requests per day
    - Database tables can store and retrieve any amount of data and serve any level of request traffic
    - Provides on-demand backup capability and enable point-in-time recovery of DynamoDB tables
    - 20 million requests per second
    - Can restore a table to any point in time during the last 35 days
    - Global table replication
    - Availability to switch between read/write capacity modes once every 24 hours.
    - No need to change any code or applications to use or manage encrypted tables.
    
    Scalability: 
    
    - Automatic data replication over three availability-zones in a single region
    - Scale up or down tables throughput capacity with zero downtime or performance degradation
    
    
    Availability:
    
     - Maximum size per item is 400KB
     - 2,500 tables per AWS Region
     - Read/write capacity mode: 
    
     Capacity unit sizes for provisioned tables:
    
         - One read capacity unit = one strongly consistent read per second, or two eventually consistent reads per second, for items up to 4 KB in size.
         - One write capacity unit = one write per second, for items up to 1 KB in size.
         - Transactional read requests require two read capacity units to perform one read per second for items up to 4 KB.
         - Transactional write requests require two write capacity units to perform one write per second for items up to 1 KB.
    
     Request unit sizes for on-demand tables:
    
         - One read request unit = one strongly consistent read, or two eventually consistent reads, for items up to 4 KB in size.
         - One write request unit = one write, for items up to 1 KB in size.
         - Transactional read requests require two read request units to perform one read for items up to 4 KB.
         - Transactional write requests require two write request units to perform one write for items up to 1 KB. 
    
    - Throughput capacity: 
    
      - On-Demand:
        - Per table
          1. 40,000 read request units and 40,000 write request units
    
        - Per account
          1. Not applicable
    
        - Minimum throughput for any table or global secondary index
          1. Not applicable
    
      - Provisioned:
        - Per table
          1. 40,000 read request units and 40,000 write request units
    
        - Per account
          1. 80,000 read capacity units and 80,000 write capacity units
    
        - Minimum throughput for any table or global secondary index
          1. read capacity unit and 1 write capacity unit
    
    
    Security: 
    
      - DynamoDB encryption at rest provides enhanced security by encrypting all your data at rest using encryption keys stored in AWS Key Management Service (AWS KMS)
      - AWS owned key – Default encryption type. The key is owned by DynamoDB (no additional charge).
      - AWS managed key – The key is stored in your account and is managed by AWS KMS (AWS KMS charges apply).
      - Customer managed key – The key is stored in your account and is created, owned, and managed by you. You have full control over the KMS key (AWS KMS charges apply).
      - Can switch between the AWS owned key, AWS managed key, and customer managed key at any given time.
      - IAM administrators control who can be authenticated (signed in) and authorized (have permissions) to use Amazon DynamoDB resources.
    


    이러한 제한 사항 중 일부는 조정 가능하고 다른 제한 사항은 조정할 수 없습니다.

    이러한 특성에서 볼 수 있듯이 DynamoDB는 개발자를 위한 완벽한 도구입니다👩‍💻.

    아 맞다 구축 중입니다 👷 이제 Terraform을 사용하여 이 데이터베이스를 구축하겠습니다



    Find the Terraform repo and directions for this project here

    Terraform 코드 이전:

    resource "aws_dynamodb_table" "dynamodb-table" {
      name           = "GameScores"
      billing_mode   = "PROVISIONED"
      read_capacity  = 20
      write_capacity = 20
      hash_key       = "UserId"
      range_key      = "GameTitle"
    
      attribute {
        name = "UserId"
        type = "S"
      }
    
      attribute {
        name = "GameTitle"
        type = "S"
      }
    
      attribute {
        name = "TopScore"
        type = "N"
      }
    
      ttl {
        attribute_name = "TimeToExist"
        enabled        = false
      }
    
      global_secondary_index {
        name               = "GameTitleIndex"
        hash_key           = "GameTitle"
        range_key          = "TopScore"
        write_capacity     = 10
        read_capacity      = 10
        projection_type    = "INCLUDE"
        non_key_attributes = ["UserId"]
      }
    
    }
    


    도표



    참조:

    https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/identity-and-access-mgmt.html
    
    

    좋은 웹페이지 즐겨찾기