Storage in AWS

Storage in AWS




There are 3 major storage type in AWS :

  • Block storage (Elastic Block Storage - EBS)
  • File storage (Elastic File Storage - EFS)
  • Object storage (S3 bucket)
HDD and SSD are the main storage units for all these three. 

Block storage - HDD and SSD are the devices that uses blocks to store information inside. Blocks are small fragment/cluster of data. Basically AWS provides this so that we can partition and format it easily. They are ideal for applications that require low-latency access to data, such as databases and enterprise applications.

File Storage - Is different than block storage, while under the hood it depends on block based storage units, it is connected to internet so that we upload/download files over internet. SSD and/or HDD units are inserted Network Attached Storage Servers so that is how it works. It is ideal for content management systems, web serving, and big data analytics.

Object Storage - S3 is unlike the others mentioned above. With the help of REST API or aws cli tool we can download or upload files easily. There is no format restrictions we can upload file of any kind.


Let's create our own EBS unit and use it.


  1. First need to create EC2 instance, click to the volumes section.






  2. And then create a volume, attach it to the EC2 instance we just created.







  3. Let's move on to the instance terminal and list all block storage available attached to this instance by lsblk  command. We will be able to see the block storage we just attached. it is 17 GB.


  4. Since this unit has no file system whatsoever our OS won't able to mount it, so we need to make file system by mkfs command as below.




  5. And then need to mount to the OS


  6. Let's create a file and save secret message into it.








  7. And detach the volume.




When we create a new EC2 instance and then attach volume to it, instead of making file-system again (If you use mkfs command again this will result to format that volume again eventually data loss) we just need to mount it directly to that instance. Finally we will able to see edit all the files, and of course our message file as well.



We can use EBS for other purposes as well, we can create AMI image snapshot and based on that create new EC2 instances easily.

  1.   Click to create image button.
     

  2. Name it and finish the operation. You will be able to see your AMI created here 



  3. Check out the snapshots, here is the EBS snapshot taken to create new image from it.



  4. All the  custom AMI's located in My AMI's section in the EC2 instance creation phase.


Consider that since the EBS snapshots are exact copy of the volume itself, this kind of mistakes might occur. If we create our EC2 instance based on the user-data I have provided to you and then create AMI from it. Previous EC2 instance's IP address will be shown in the index.html file. 




Comments

Popular posts from this blog

Identity Access Management - How to create user in IAM ?!

EC2 - User data

IAM - Roles