The raw disk-drives that you can buy from stores and connect it to your machine is an example of a block storage. Block storage stores information as fixed size blocks. A software program would interact with block storage to write, read and manage blocks. In case of Cloud, block storages can be created, deleted and attached to VMs whenever you need.
In case of AWS, block storage service is called Elastic Block Storage (EBS). Let’s say you have an external hard disk. If someone gets their hand-on your hard disk, they can read the data as it is. In order to prevent that from happening, you may want to encrypt the data and store it. You can just give the data to EBS and it would store it securely using a key.
A EBS volume created in availability-zone can only be used by machines running in that zone. You can take snapshots of the block storage and use it in another availability zone or keep it as a backup. Some EBS volumes can be attached to multiple VMs at the same time. Check multi-attach document.
On day-to-day basis, we interact with block storage using a file-system. File-systems are structured for example, you may store some PDF file under E drive or at /Users/jigar/Desktop. You would need to install a file-system on an empty block storage to use it.
After creating an EBS Volume on AWS, you can attach it to VM of your choice very easily. The VM would not be able to write anything to EBS volume yet. To do so, You need to create a file system on an empty EBS volume and mount it on the VM. For more information checkout ebs-using-volumes.html .
What would happen when your disk is full?
There are several options here
- You buy a bigger drive and mount it on the VM
- You can copy data from older drive to new and delete old volume or keep 2 drives
What if you can store unlimited data ?
In case of AWS, Elastic File System (EFS) is the answer. It can also be available across different Availability zones and can be used by multiple VMs. You can take advantage of spot instance + EFS combo.
Following is a screenshot from AWS Console. It shows Network information for a sample Elastic File System. Notice that the same EFS drive is available across multiple Availability Zone (AZ) and has IP address in each AZ. Such kind of drives which are connected to a network is called Network File System (NFS). To know more about NFS checkout Huawei on NFS.
EFS does not work on Windows. Also there are different file systems available out there. To give users flexibility to try out different file systems, AWS created a product called File System x (FSx). As of Aug 2022, FSx works with following:
So far we looked at disk drives: Block storage and Network File Systems. Now, I want to uncover another type of important storage class.
Usually, your application would be writing important data into a database. Often you want to store PDFs, images, documents and other types of files. Instead of storing such data into a database, you can upload them into Object storage.In the case of AWS, Simple Storage Service (S3) allows you to create a bucket where you can store files.
Every time data stored in a bucket changes, it gets versioned. This allows you to move back and forth between different versions. To safely store data into the bucket,
- You can either upload encrypted objects (client side encryption) or
- Configure S3 to encrypt the uploaded data (server side encryption)
In this post, I covered following concepts at a high level,
- Block Storage, File Storage & Object Storage
- Elastic Block Storage (EBS)
- Elastic File Systems (EFS) — Network File System (NFS)
- File System x (FSx) — Other types of NFS
- Simple Storage System (S3)
Reference
Explanation of File, block & object storage by Redhat— https://www.redhat.com/en/topics/data-storage/file-block-object-storage
Netapp — cvo-blg-what-is-block-storage-pros-cons-and-comparisons
EBS overview — https://youtu.be/ljYH5lHQdxo
AWS doc on mounting EBS on a VM — ebs-using-volumes.html
EFS intro 2015— https://youtu.be/AvgAozsfCrY
Evolution of Network File System 2019— https://youtu.be/pCbDfTKry-c
FSx AWS 2021 — https://youtu.be/hPJSIZD099o
Simplify file architecture 2021 — https://youtu.be/TfGzDmepsko
Simple Storage Service intro — https://youtu.be/77lMCiiMilo
Encryption options for Simple Storage Services — https://youtu.be/-PVATgxOGuw
Simple Storage Service 2015 — https://youtu.be/tY5yMChT3i4
Deep dive on Object Storage 2017 — https://youtu.be/bfDpK45Faa0