Module 5: Storage and Databases --- part 1
學習目標
- Storage and Databases 基本概念
- Amazon Elastic Block Store (Amazon EBS) 優點
- Amazon Simple Storage Service (Amazon S3) 優點
- Amazon Elastic File System (Amazon EFS) 優點
- Storage solutions
- Amazon Relational Database Service (Amazon RDS) 優點
- Amazon DynamoDB 優點
- Database services
Block-level Storage
Block-level storage volumes behave like physical hard drives. Sizes up to 16 TB each.
A file being a series of bytes that are stored in blocks on disc.
When you modify a file in block storage, only the pieces that are changed are updated.
This makes it an efficient storage type when working with applications like databases, enterprise software, or file systems.
EC2 Block-level Storage Options
- Instance Store
- EBS Volume
(1) Instance Store
An instance store provides temporary block-level storage for an Amazon EC2 instance (virtual servers).
- An instance store is disk storage that is physically attached to the host computer for an EC2 instance, and therefore has the same lifespan as the instance. When the instance is terminated, you lose any data in the instance store.
- EC2 instances 連接的 Instance store volumes (local storage),經過 stop 或 terminate 後再次重啟,EC2 instance 會在另一台 host 上啟動,資料會消失 (因為資料是寫在原本的 Instance store volumes 上)。
- Use cases:
- Temporary data (you can lose the data) that you do not need in the long term.
(2) EBS Volume
Amazon Elastic Block Store (Amazon EBS) is a service that provides block-level storage volumes that you can use with Amazon EC2 instances.
- 緣起:
- You don't want your entire database getting deleted every time you stop an EC2 instance.
- 功能:
- Best for data that requires retention.
- If you stop or terminate an Amazon EC2 instance, all the data on the attached EBS volume remains available (persistent).
- Separate drives from the host computer of an EC2 instance.
- EBS allows you to take incremental backups of EBS volumes by creating Amazon EBS snapshots.
- Incremental backups are different from full backups.
Object Storage
In object storage, each object consists of data, metadata, and a key.
When a file in object storage is modified, the entire object is updated.
- Data
- The data might be an image, video, text document, or any other type of file.
- Metadata
- Metadata contains information about what the data is, how it is used, the object size, and so on.
- Key
- An object’s key is its unique identifier.
Amazon Simple Storage Service (Amazon S3)
Amazon S3 is a service that provides object-level storage. It stores data as objects in buckets.
It allows you to store and retrieve a virtually unlimited amount of data at any scale. (unlimited storage space)
- Serverless
- You pay only for what you use.
- The maximum file size for an object that you can upload is 5 TB.
- Write-once-read-many (WORM)
- Amazon S3 versioning feature to track changes to your objects over time
- Set permissions to control visibility and access to it
- Use cases:
- Upload any type of file to Amazon S3, for backup or archive
Amazon S3 Storage Classes
- S3 Standard
- S3 Standard-Infrequent Access (S3 Standard-IA)
- S3 One Zone-Infrequent Access (S3 One Zone-IA)
- S3 Intelligent-Tiering
- S3 Glacier Instant Retrieval
- S3 Glacier Flexible Retrieval
- S3 Glacier Deep Archive
- S3 Outposts
關於考慮 S3 Storage Classes 的兩項因素:
- How often you plan to retrieve your data?
- How available you need your data to be?
(1) S3 Standard
- High availability
- 11 nines of durability (99.999999999 %)
- Durability refers to "how safe data is from being lost"
- That means an object stored in S3 Standard has a 99.999999999 percent probability that it will remain intact (完好無損) after a period of 1 year.
- Higher cost than other storage classes intended for infrequently accessed data and archival storage
- Use cases:
- static website hosting
- content distribution
- data analytics
(2) S3 Standard-Infrequent Access (S3 Standard-IA)
- Same level of availability as Amazon S3 Standard
- Use cases:
- store backups, disaster recovery files
- long-term storage
(3) S3 One Zone-Infrequent Access (S3 One Zone-IA)
- This makes it a good storage class to consider if the following conditions apply:
- You want to save costs on storage.
- You can easily reproduce your data in the event of an Availability Zone failure.
(4) S3 Intelligent-Tiering
- Amazon S3 monitors objects’ access patterns.
- If you haven’t accessed an object for 30 consecutive days, Amazon S3 automatically moves it to the infrequent access tier, S3 Standard-IA.
- If you access an object in the infrequent access tier, Amazon S3 automatically moves it to the frequent access tier, S3 Standard.
(5) S3 Glacier Instant Retrieval
(6) S3 Glacier Flexible Retrieval
- Compliance requirements & No need it to be retrieved very rapidly
- S3 Glacier vault lock policy
- You can specify controls such as write once, read many, or WORM, in a vault lock policy and lock the policy from future edits.
- Once locked, the policy can no longer be changed.
- S3 Lifecycle policies (policies you can create that can move data automatically between tiers)
- For example, keep an object in S3 Standard for 90 days, and then move it to S3 Standard-IA for the next 30 days. Then after 120 days total, move it to S3 Glacier Flexible Retrieval.
- Use cases:
- store audit data for several years
- store archived customer records or older photos and video files
(7) S3 Glacier Deep Archive
- All objects from this storage class are replicated and stored across at least 3 geographically dispersed Availability Zones.
- Use case:
- Long-term retention and digital preservation for data that might be accessed once or twice in a year
(8) S3 Outposts
- Amazon S3 Outposts is designed to store data durably and redundantly across multiple devices and servers on your Outposts.
- Amazon S3 Outposts 是一種專為本地化需求設計的 Amazon S3 解決方案,將 S3 的物件儲存功能延伸至客戶的內部部署環境或資料中心。
- 優點
- 本地化儲存:數據儲存在自己的資料中心內,同時提供與 Amazon S3 相同的 API、工具和功能
- 與 AWS 完全整合:簡化了混合雲或多雲環境中的運行和管理
- 低延遲
- 合規性
留言
張貼留言